how to define businessmanager or businesscomponent

Posts   
 
    
vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 12-Apr-2008 02:15:50   

http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=723&HighLight=1

is relationentity is the one that solves the problem of businessmanager or businesscomponent or is the UnitOfWork is the one that solves this ?

I am working with a legacy distributed system that it dictates that there is very few foreign key relations defined in the system.

I found through an earlier discussion & exploring to do myself that it is not possible to add relations dynamically. It has to be done in the designer & generated.

Hence, should I define my businesscomponent relation ahead of time in the designer for entity. So when I am fetching the business component, the prefetch path is specified as well for that one entity or do I have to retrieve each of the entity & entity collections related to be specified.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 15-Apr-2008 07:13:55   

Hence, should I define my businesscomponent relation ahead of time in the designer for entity. So when I am fetching the business component, the prefetch path is specified as well for that one entity or do I have to retrieve each of the entity & entity collections related to be specified.

I don't understand your _businessmanager _and _businesscomponent _concepts in this context. But regarding to the relations, you can define your own typed relations in LLBLGenPro Designer.

David Elizondo | LLBLGen Support Team
vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 16-Apr-2008 21:09:58   

I will try to explain this scenario.

Order OrderItem

These are not related in database using foreign key.

I am building a business component for UI that has one Order & corresponding multiple OrderItem in the same window entered. So my business component object should have an OrderEntity instance & and a collection of OrderItemEntity. fetch, add, update all are managed by the business component using UnitofWork. call validations for Order & OrderItem in the preferred order.

OR

define the relation in genpro designer between Order & OrderItem. It constructs prefetch path, relations. so fetch, add, update happens for OrderItem as well. so the adapter can call Order.update to take care of all changes to be updated using unitofwork have code in Order to call validations for OrderItem as well.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Apr-2008 05:44:17   

I would go on your second approach. Even if you make the first one, is recommended that you define the relationship at LLBLGenPro Designer (or retrieve them from DB) so you can take advantage on relations, prefetchPaths, recursive saves, validate orderDetails on your order validation logic, etc.

David Elizondo | LLBLGen Support Team