Subsystem design

  • Thread starter Thread starter SonicChen
  • Start date Start date
S

SonicChen

i havn't dive deep into the entity framework(ef), but we encounter some
problem when we design subsystem in linq to sql which maybe be same as ef.

we need to create dependent business model classes in different
datacontext(subsystem), one subsystem dependent on another, such as the
relation between order management subsytem and product management subsystem,
so we need to use the model like this, order.items[0].product, but these
classes attached to different datacontext, and the transaction seems to be
the problem too.
I think it's caused by the datacontext acts as two roles: business object
container and data access gateway, they should be separated to different
components.

Appreciated for any response.
 
You can slap your entire database in a dbml file (or in the Entity Framework
model for that matter) and overcome the initial problem. But, you do end up
with a DAL and objects blended. There are ways to separate this out a bit,
but it is not very pretty, IMO. You can also group by functionality, but
then you end up with many subfolders to avoid nameclashes, ouch!

Of the two, I would opt for Entity Framework before LINQ to SQL, as a DAL,
at least. I still think it is a version or two from being an optimal
solution for many solutions.

There are plenty of OR Mapper products out there that can serve you. If you
do not require a leap across a service boundary, Subsonic is a nice open
source project by one of the Microsoft guys. Ultimately, this is a more
usable solution. Other possibilites include nHibernate, DeKlarit, LLPLGen
Pro or Genome (genom-e.com). nHibernate is the cheapest, but the other three
will scale better ... if that is an issue for you.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Back
Top