Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abstract classes useful?
Message
From
04/06/2008 04:14:39
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
 
To
04/06/2008 02:04:47
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:
01320973
Message ID:
01321510
Views:
16
Hi Olaf,

>I see putting an abstract button on an abstract form as a valid way to compose some class, so I don't see the point to forbid that.

For me "abstract class" is merely a definition/description of usage: don't base an object on this class. In different languages there is more or less need for such consturcts: I see abstract classes really close to the definition of interfaces<g>.

In vfp or Python I see no *technical* reason for interfaces (unless you need COM-behaviour, like having different methods called by the same name depending on the interface active) or abstract classes. Some (more in the Python group) beleive that using interfaces and abstract classes in more dynamically oriented languages puts unnecessary shackles on these languages. Here I disagree: for some projects / people such mechanisms are helpful. Just don't go overboard and write exact java-style in vfp.

>I see it's a problem to add an abstact button at runtime and it would instanciate because of it's parentship only. That makes my Vartype(This.Parent) check invalid, true. Reverting back to the Class check only, that prevents to use such buttons this way. Then you would have the need to subclass such buttons before even using them on an abstract form.

Using add object or adding "things based on other classes" in the vcx had a special name - was it "instance subclassing" ? And since the name is "Add Object" instead of "Add Class" I think it is add least a fringe case<bg>.

>... But you might design an abstract factory to have some methods implemented, which work for all concrete factories you plan to implement. And at it's init you'd pass a parameter, from which that abstract factory decides what concrete factory it adds to itself and maybe then binds it's own methods to the concrete factory subobject. Now would that kind of abstract factory really be an abstract factory? It's not having the concrete methods, but it's composing it's runtime version to be a concrete factory. Then it would be it's own interface or adapter.

New pattern: class_Boot_Strap <g>

BTW: In Databases,Tables, Views, Indexing and SQL syntax/ Re: CursorAdapters and VARCHAR(MAX) columns in SQL
I wrote about your recent Chr(0) findings with CA - perhaps take a look.

regards

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform