Class references, or using ClassInfo to instantiate classes?

Jarrett Billingsley kb3ctd2 at yahoo.com
Thu Feb 1 07:21:14 PST 2007


"Vladimir Panteleev" <thecybershadow at gmail.com> wrote in message 
news:op.tm2e1ndim02fvl at cybershadow...

-------------------------------------
The basic idea here is to allow inferior (in design layers) code to 
instantiate derived classes of which it does not know - but it could know 
that it is derived from a specific base type.

The basic application of this is any kind of "object factory" class which 
needs to be able to instantiate (and work with) different types of objects.
-------------------------------------

This is possible with reflection.  Check out FlectioneD; it has (at least a 
limited form) of instantiating classes by a string name.  In fact, classes 
are represented by (gasp) the Class type. 





More information about the Digitalmars-d mailing list