A more specific question that I have is - who is responsible for invoking the DAL operations? Several options I see are: 1. BLL has methods to call the DAL and perform DB operations (ex. User.Load(id), User.Save(), etc). This results in the UI/Controllers calling
User.Save(), etc and not knowing anything about the DAL. 2. UI/Controllers know about the DAL and call its methods (ex. UI calls PersistentStore.Save(User) or User = PersistentStore.Load(typeof(User), id). This results in the BLL not knowing anything about
the DAL, but the UI knows about both BLL and DAL. Personally, I favor option #2 right now. This is because I favor a "cleaner" BLL that doesn't necessarily care if it is persisted or not. I view the UI layer as the area of the code that knows if an object
should be persisted and who to give the object to to accomplish the save. I can see this leading to some duplicate code though, if you have an application that has both a Windows and Web GUI. Perhaps this is a "pick your poison" type of argument. I'm just
curious as to how others are handling this coupling. Smoke
rsmoke21
Contributor
3931 Points
792 Posts
Re: Best Architecture
Oct 12, 2004 09:22 PM|LINK