We're developing a layered web application. The specs:
- 3 layers, data layer, business layer, ui layer.
- Programmed in C#
- Data Layer uses the entity framework
Currently we plan on having the data layer return IEnumerable<T>
to the business layer via linq 2 entities, and the business layer will return data开发者_开发技巧 to the ui layer.
Since the ui layer has no knowledge of the existance of the data layer, how would it handle a result of IEnumerable passed to it from the BLL, where T is defined in the data layer?
Are there any GOOD example out there on how to do this. Please note that I'm extremely new to factories / interfaces / abstraction to loosely couple layers.
I saw the question here passing data in an ntier application and it was recommended to have the entity layer shared amongst all layers... however I do not want the other layers to be able to query the database.
Have your data objects defined in a separate project, or at least a separate namespace, so the Display layer can have a reference to the objects, but not the DAL that has access to the db.
精彩评论