> I am a little curious as to the reasons for avoiding the use of classes in
> FreeTrade.  While classes in PHP 3 are not as robust in c++ or Java they
> still allow for quite a bit.  I have been considering building classes for
> things like the shopping cart and users and moving their related functions
> in as methods.  Just thinking it might be a good idea if I ask why not
> first.

There are a few reasons.  First, consider that while classes are not used,
the design is object oriented.  Each module is like an object in that it
collects functions and data.  Second, it seemed like a lot of overhead
at the time.  Third, because objects in PHP do not offer private methods
and properties, they aren't as useful.  If you have  to have the
discipline not to reach into objects when you shouldn't, then you might
as well just use functions and avoid typing $this-> all the time.

Anyway, that's my thinking, but I'm willing to argue about it.  Check out
how I modularized things in FreeTrade 2, though.  I've greatly increased
the cohesion and reduced the coupling.

Leon

---
Leon Atkinson <http://www.leonatkinson.com/>



------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to