I've been reading recently about EF4, and how to build an architecture
for asp.net web forms application using it.
I explored using POCOs (self tracking entities), with WCF,
but found out that my application will be deployed on a single box (i.e. one
tier), so I started reading about logical separation of layers, and came up
with the following solution:
- DAL layer that contains EDMX
model and EF APIs, and also generated context object.
- Entities DLL that holds all
generated POCO entities using ADO.NET POCO entity generator. (for persistence
ignorance, and decoupling entities from DAL).
- Business layer that
contains a faÃÂ§ade for each related group of business functions, the faÃÂ§ade will
be aware of and using DAL layer. And in each function, it will initiate context
and uses different entities to carry out specific job (i.e. function).
- UI layer that only calls
the business layer faÃÂ§ade classes. With no awareness of DAL, but it will be
aware of entities (i.e. using entities DLL), as the business layer will return
results basically as entity collections.
I want to know what you think about this architecture.
I also read about an architecture that uses repository and
unit of work patterns, but what I understand that context object is already
implementing a UOF pattern, and also object sets
View Complete Post