Design issue with O/R mapping

F

Flare

Hi.

Im have asked for recommendation regarding the best production ready O/R
mapping tools for .net. I got that.

Since im an old, ok maybe not old (only 27), Java programmer patterns and
developement with tiers is of great importance for me.

I have a problem with the famours anti-pattern Tier leakage. In the Java
world I used POJO´s (simple java classes) as value objects. These value
objects was used for cayrring data between the tiers. So if i changed the
persistence tier the rest of the code still relyed in the same POJO´s.

Now with the .net O/R they all genereate eg. EmployeeEntity wich inherit
from EntityBase2 (LLBL PRO). If I pass the object from my persistence layer
to the business layer and down to the view I have just made a seriuos
"maintaince bug" the "tier leakage". If i wanna use eg. the EntityBroker im
so to say ****ed. I have to refactor ALL and EVERY class witch depend on the
EmployeEntity.

Have anyone thougt about this and come up with an solution? Is the
persistence tools wich can map PURE c# classes to realtionel classes as the
Java Hibernate? And why have so few chosen this way of doing it?

Is it hard to map eg.

Customer c = new Customer();
// fill object

adapter.SaveEntity(c);

And go find what this Customer really maps to int the Database?

Anders Jacobsen
 
N

Nick Malik

Hi Anders,

You are not the only one. If I'm going to move data from the DAL, through
the BL, to the UI layer, I usually use a simple data object. I may map
between multiple objects (depending on the complexity of what I'm doing). I
agree that one excellent way to reduce dependencies is to sever the coupling
that comes when you pass objects in the way you suggest.

I haven't looked at Object - Relational mapping tools for that very reason.
Personally, I haven't seen enough reason to bother with them, because they
usually don't add message passing to their structure (e.g. passing simple,
serializable, classes from one layer to another to represent a message). If
you ever see any of my posts or articles, you would see that I am a
proponent of message-based architectures, and I admit that his bias creeps
into my designs within a component as well.

While I cannot help you choose between the commercial tools available,
perhaps it will help to know that you are not alone in your concerns about
their utility.

--- Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top