Re: dynamic object creation



"B.r.K.o.N.j.A." <thebrkonja@xxxxxxx> wrote in message
news:djsro1$arb$1@xxxxxxxxxxxxxxxxx

> All classes are descendent of one base class, they have no new methods
> just different implementations of base ones. Basicaly I need to get
> different calculation object according to value stored in database.
>
> Does this simplify things?

It does. You will have no probles with a solution based on class
references. The remaining trick is to get the right class reference
in the first place, based on your value from the database. You're
trying to avoid a linear search, whether it is your original repeated
if statement or a lookup table.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: OOD Question
    ... your work order task might have the work order ... instance of the derived classes will give the same information, ... > makes a database call. ... > If theres some change in base class I need to take care of these in all the> derived classes as well. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Scrubbing MySQL Values and CSVtoArray()
    ... Sanders Kaufman wrote: ... then a base class that does the business logic. ... the mysql-specific scrubbing function in the business logic base class - ... it defeats the purpose of putting ALL of the database work in database.php. ...
    (comp.lang.php)
  • Re: Using a Resource as a Class Property
    ... I'm aggragating the database object into a base class, ... other classes that "extend" that base class. ... But if you want to overwrite some methods to ...
    (comp.lang.php)
  • Re: Strongly typed DataSets: Relation between DataTable and TableAdapter
    ... Assuming I create a generic base base class like ... Public MustInherit Class MyBusinessObjectBaseClass(Of TDataRow As DataRow) ... update the database records in the base class. ... Is there a way to get the DataTable a TableAdapter 'belongs' to by code? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How many virtual functions before needing dispatch tables?
    ... implementations of your base class implements/overrides ... AND most of the many subclasses that exist only need ... distribute a library in binary form only, ...
    (comp.lang.cpp)