O/R Mapping tool like Apple has.....for .NET?!?!

G

Guest

Hi!

I post this text 1 year ago. But no one really could give
me an answer. This is the text that I posted long time ago:


I have a fundamental question about
The way .NET handles the object orientated way of
Persistence. I am coming from JAVA and WebObjects (Apple)
World and I am looking for a convenient way of working
with objects without seeing any SQL statements only
objects. I have used that approach for years on the
WebObjects Platform (Enterprise Object Framework) and in
Java recently (Container Managed Persistence). I am
looking for something like that in the Microsoft world.

As far as I understand Microsoft does not distinguish
between the Object Model and the Relational Model. The
main difference is that the Object model allows n : m
relationships and the Relational does not allow them. Here
a small example to visualize the problem:

Example:
There is a Patient object with following Attributes

String patientGUID;
String name;
Int age;
Hashtable diseases; (or some other Container like
Collection or Array)


And there is a Disease Object

String diseaseGUID;
String name;


In the object Model there is relation between Patient and
Disease where the patient has his diseases but on the
other site one disease can belong to 1..* patients. (n :
m)

That n : m relationship can not exist within a relational
database without a link table that contains the
connections between the tables: Patient and Disease.

Now, I would like to connect the object Model containing
TWO Entities (Patient, Disease) with the relational
database (containing THREE tables). Then I want to work
with my objects; e.g. create new diseases connect them to
existing patients by putting the diseases into the array
or create new Patients and connect them with already
existing diseases or just change a Patients name. When I
am finished I just want to say SAVECHANGES and the
database is updated accordingly including all link table
entries.

So all I have to care about are my objects and the
relations between them, some invisible layer does all the
dirty work like building SQL, converting the data types
and caching. So if I fetch a Patient with a specified GUID
I do not have to care about fetching his diseases. They
are fetched automatically. If there are too many Diseases
I do not care some kind of algorithm handles that problem
in such a way that if I have to search all of them for
something they are simply there. They are loaded on demand
(lazy evaluation)

Supposing that the disease has a further connection with
some DiseaseType Object/Table and that table has an
attribute/column "Description" I can access it by typing
the following code:

TextField1.Text = currentDisease.type().description()

Please note that to retrieve the description value I did
only fetch the Patient. The diseases and its types were
fetched automatically.

Is something like that possible or am I excepting too much
of the .NET?

-------------------------------------------------------------------




This tool should be a mixture between Microsoft Visio (I mean ORM modelling)
and a good object-to-relational mapping tool.



Is something like that NOW available????


thx!


gicio
 
R

Ross Grayum[MSFT]

ObjectSpaces data access technology enables relational data to be accessed
as CLR objects. We are currently planning to ship it in the next version of
the .NET framework (code name "Whidbey"). We are planning to release some
early bits at the PDC.
 
A

Aaron Robson

There are a few different products out there to generate this sort of
persistance layer for you. One of the better ones I have seen is :
http://www.llblgen.com/defaultgeneric.aspx
(I tried the last version, I believe the new version adds a lot more
functionality).

I must admit, I was once looking for the lovely system you describe, but
having gone round the loop writing my own system to do it, I have ended up
using simpler objects which only wrap the database tables, and do not
provide cascading updates / deletes etc. The caching / synchronization
implications in a web application scenario just didn't provide a good enough
level of performance / scalability.

Aaron Robson.
 

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