Architecture : am I doing things right?
Posted
by
Jeremy D
on Programmers
See other posts from Programmers
or by Jeremy D
Published on 2012-11-22T05:38:44Z
Indexed on
2012/11/23
17:18 UTC
Read the original article
Hit count: 257
I'm trying to use a '~classic' layered arch using .NET and Entity Framework. We are starting from a legacy database which is a little bit crappy:
- Inconsistent naming
- Unneeded views (view referencing other views,
select *
views etc...) - Aggregated columns
- Potatoes and Carrots in the same table
- etc...
So I ended with fully isolating my database structure from my domain model. To do so EF entities are hidden from presentation layer. The goal is to permit an easier database refactoring while lowering the impact of it on applications.
I'm now facing a lot of challenges and I'm starting to ask myself if I'm doing things right.
My Domain Model is highly volatile, it keeps evolving with apps as new fields needs are arising. Complexity of it keeps raising and class it contains start to get a lot of properties.
Creating include strategy and reprojecting to EF is very tricky (my domain objects don't have any kind of lazy/eager loading relationship properties):
DomainInclude<Domain.Model.Bar>.Include("Customers").Include("Customers.Friends") // To... IFooContext.Bars.Include(...).Include(...).Where(...)
Some framework are raping the isolation levels (Devexpress Grids which needs either XPO or
IQueryable
for filtering and paging large data sets)
I'm starting to ask myself if :
- the isolation of EF auto-generated entities is an unneeded cost.
- I should allow frameworks to hit
IQueryable
? Slow slope to hell? (it's really hard to isolate DevExpress framework, any successful experience?) - the high volatility of my domain model is normal?
Did you have similar difficulties? Any advice based on experience?
© Programmers or respective owner