Partial Classes vs TwoClasses (Adapter)

Posts   
 
    
Heather
User
Posts: 17
Joined: 16-Jan-2009
# Posted on: 12-Feb-2009 18:29:59   

Wasn't sure whether to put this into the Architecture or Generated Code forum but ended up here.

We are using v2.6 Final, Adapter, currently General2008.

We have 3 assemblies.

  1. Business Logic - Manager classes (functionaly grouped code to centralize methods of getting and putting data to the database, fetches and saves) and Validator classes.
  2. LLBL DBGeneric generated code and currently partial classes for 50% of entity classes.
  3. LLBL DBSpecific generated code

My question is what are the pros/cons to using TwoClasses2008 and extending the "MyEntity" via partial classes vs. using General and extending the Entity via partial classes. We currently put "low level business logic" in the extended entity classes. Low level bl would be an AddChild(ChildEntity) method that automatically adds the childentity to both the m:n collection and the 1:n collection when an intermediate table exists, setting an entrydate to the current date and calculated or combined properties (like full name). Our "high level/usage business logic" would be always pulling the orders collection when retrieving a customer and that is located in the manager classes. Things like orderdate must be before today would be in the validation classes.

We're early in the project but reaching a point where we're not going to want to change direction so I'd love to hear what others have found when working with one approach or the other. My instinct was to do what some have done and "hide" the llbl entities from the presentation layer via a custom business layer which maps llbl entities to our own custom entities but have decided not to go that far (somewhat due to time constraints) so now I'm just focusing on how to best use/extend the llbl objects.

Thanks in advance,

Heather

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Feb-2009 06:11:03   

Hi Heather,

Reading your scenario I think you don't need geenrta for 2-classes preset (My<Entity> derived entity classes). See this: http://llblgen.com/TinyForum/Messages.aspx?ThreadID=15308&StartAtMessage=0&#85252

David Elizondo | LLBLGen Support Team