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.
- Business Logic - Manager classes (functionaly grouped code to centralize methods of getting and putting data to the database, fetches and saves) and Validator classes.
- LLBL DBGeneric generated code and currently partial classes for 50% of entity classes.
- 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