I have been looking at the Repository Pattern. While trolling around the net I have come across many implementations and examples. Many of these examples have code like:
ObjectDataSource1.Datasource = CustomerRepository.GetAll();.
Since the Repository basically serves as the Data Access Layer, doesn't this violate the principles of a layered approach by having a UI component accessing the data access layer? If so, my assumption is that I would need to wrap the call CustomerRepository.GetAll() in some business object like:
ObjectDataSource1.Datasource = CustomerManager.GetAll();
where CustomerManager calls CustomerRepository.GetAll();.
If this is correct, what benefit am I getting by wrapping a business class around the Repository? It seems like I am adding an extra layer for the sole purpose of avoiding calling the DataAccessLayer/Repository directly from the UI?
Is it okay for the UI to have access to my Data Access layer in order to read data from the database?
View Complete Post