On 23 Jun 2011, at 18:26, Aparajita Fishman wrote:

from experience I can say that the reality is quite different than what you described

I accept that (how could I not !?) :) - you certainly have more experience than me in OOp. However, object tools is essentially a property bag for storing data as I understand.

I was more thinking about class modules of the type found in Visual Basic which implemented the full extent of the 4D language - i.e. where the property calls actually execute code inside the object and the client method is not aware if the property being returned is being evaluated dynamically or just returning a static value held internally by the object.

I found that building classes was ok if you had done a huge amount of forward planning and didn't need to 'evolve' them - i.e. do refactoring. These days in 4D, I tend to write a code module like a 'class' which uses globals to hold it's internal properties. Although they aren't real classes, they're a whole lot simpler to write and flexible to evolve while still offering many of the benefits in terms of well structured, auditable and documentable code. ok, you can't multiply instantiate objects from them but I never find I need more than 1 instance at a time anyway.

For years I tried to avoid globals due to their 'programming stigma', but I've ditched that prejudice and now find them immensely powerful when used within this type of object based paradigm.

Peter

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to