Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing composites
Message
From
17/02/2006 21:05:07
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
17/02/2006 19:00:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01096874
Message ID:
01097255
Views:
17
Hi Dragan

>>>Data drive the cosmetic features or have custom properties that you can change that then get read at Init to change the form.
>>
>>The cosmetic aspect was a simple example. Are you suggesting a decorator class that acts on frmApplicationSpecificSuperForm to make a frmCountryForm? That would require a factory to create frmCountryForm, created by an abstract factory.

I meant the cosmetic part was just to have a visual effect. What about functionality? If there is a functional change made to frmApplicationSpecficSuperForm I'd have to make that to frmCountry too.

>
>Not necessarily. I've tried the other day, just for fun, a simple decorator objects that recurses through the form's objects and sets the fontname of any object that has the property (just had enough of Arial everywhere :). The decorator is about six lines of .prg (it relies on each form already having a thisform.oRecurser object :), and commits harakiri when done. It took just three lines to instantiate it, run it and then kill it in the end of form's .init... which, in your case, could simply be done at the frmSuperForm level: have a property called DecoratorClass, and then sometime when the coffee is getting cold in .init
>
if not empty(this.DecoratorClass)
>oDecorator=createobject(this.DecoratorClass)
>oDecorator.Upholster(this)
>release oDecorator
>OK, you may need DecoratorClassLib if you want newobject() instead of createobject(), but that's it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform