Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access / Assign and AddProperty methods
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00170142
Message ID:
00170241
Views:
16
Hello,

Although I've yet to upgrade to 6.0. I've found many cases where I MIGHT want to use AddProperty - especially in the case of creating objects on the fly that are based on user defined vlaues from some table for instance. Example - My Security object currently holds the user's current rights in an array property (pulled in at log-on). I need to traverse the array to see if they have a particular right - which works fine. It might be better, however, to simply create properties named after the right, Then all I have to do is check for existance of the property. Just an idea.

As for all the hoopla about being "OOP compliant" - geez, I tire - it reminds me of talk about database normalization - it's only useful when it's useful. Who cares if something is "OOP" if it works better without being "OOP"? Now - inheritance, subclassing, polymorphism, etc, etc, etc, are GREAT things - I use them fully - more than most I would venture - but treating OOP like it's some holy cow reeks of Academia - you know - those people who write books and papers but have never actually programmed anything real (ie for a business, that actually works) in their life - this of course does not include the brilliant members of this thread who do both <bg>

>Hi Silvio,
>
>>>As for AddProperty, other than using it for creating public vars while my oo >>conscience is blackmailed into silence, I still have to find how to use it. >>It seems to me that if I need to add an undocumented property at runtime I am >>>already into the patching part of our job. If a property is that important, >>I should have added it from the beginning, otherwise, if it's needed because >>the original specs for the program have changed, it certainly warrants >>documenting.
>
>My take on the usefulness of Addproperty comes in the idea of generic data handlers. If you want to write adaptive front end and middleware components you need something like an addproperty method. Before 6.0 the only way to do this was with SCATTER NAME which would create properties on the fly. When we developed our first set of data aware classes we found that it would be a pain from a pure OOP standpoint to have to change classes and recompile our app every time we wanted to make a schema change. What we did to alleviate this problem was to create a generic data controller that presented a set of properties from a table. Whenever the database was changed so went the data controller.
>
>Anyway, this is where we find Addproperty useful. I am interested in hearing other people's opinions.
>
>Rod
Ken B. Matson
GCom2 Solutions
Previous
Reply
Map
View

Click here to load this message in the networking platform