Entity Factory

Posts   
 
    
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 19-Nov-2004 22:23:36   

Hi, Frans. How about a way to create an entity object based on an EntityType as opposed to having to know which entity factory to use. Something like


Dim employee as EmployeeEntity
employee = EntityFactory.CreateEntity(EntityType.EmployeeEntity)

Thanks.

Jeff...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Nov-2004 10:55:08   

Since the 1.0.2004.1 runtime update, you have that factory for selfservicing simple_smile Check the GeneralEntityFactory class. I didn't create that class for adapter because it is more likely the entity factories there are overridden in derived classes, making the entityfactory not that useful.

Frans Bouma | Lead developer LLBLGen Pro
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 20-Nov-2004 21:59:39   

Otis wrote:

Since the 1.0.2004.1 runtime update, you have that factory for selfservicing simple_smile Check the GeneralEntityFactory class. I didn't create that class for adapter because it is more likely the entity factories there are overridden in derived classes, making the entityfactory not that useful.

Actually, I was talking about Adapter....

That wasy easy...using the new Template Studio I just copied the template code for the Selfservicing GeneralEntityFactory to the EntityFactoriesAdapter template and changed IEntity to IEntity2. Very nice. I'm thinking of building a singleton/stateful factory class that will allow me to override the factory for a given Entity...

Jeff...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Nov-2004 11:27:39   

Cool simple_smile

Also, don't forget to send me suggestions for the template studio editor simple_smile

Frans Bouma | Lead developer LLBLGen Pro