Chapter 5: DataLayers Question
I just wanted to mention that I have doing ASP.NET for about 6 months now and would recommend this book but only after reading the beginner ones. The author assume that you have a good grasp on OOP concepts and experience with the n tier structure.
Back to my question, I was wondering is it really necessary for the BLL to rewrap the data returned from DAL in essentially the same wrapper?
for example: Returning a single Article by ID
- The UI (Show Article.aspx.cs) calls BLL.Article GetArticleByID(ID)
- The BLL calls the DAL.GetArticlesByID which creates an instance of the ArticleDetails object and wraps the data retrieve from the database and exposes the object with ArticleDetails public class members.
- The ArticleDetails object is then used as an argument for the BLL.GetArticleFromArticleDetails method, which then creates and an Article object from it and exposes the object with Article public class members (which are the same members as the DAL). The Article object is then returned to the UI.
Is there a way for the BLL to call the DAL and just pass the object to UI directly without rewrapping it?
|