[ORM]: All about Links, Joins, Relations and mapping

Thorsten Hohage thohage at objectmanufactur.com
Thu Oct 11 03:10:54 CDT 2007


Hi Ruslan,


On 2007-10-11, at 08:22, Ruslan Zasukhin wrote:

> So still sounds like LINK to related table.
I know you're a database guy, so the database answer should probably  
be: yes it's nothing more than linking tables. Or better "joining"  
tables.


So IMHO we should define so words before going on further discussing  
the technical aspects behind.

1a) There is the database way on how "link" tables, in good old plain  
sql a "join" using (sometimes) FKs

1b) In extension to this there are the Valentina features e.g.  
"ObjectLink" (so a "linked" table is a table join with Valentina  
"functionality")


2) Using an ORM we map or "link" classes and tables.


3) On the OO-class-level there are parent-child-"relations" between  
some classes. In some casses this is not only done with e.g. a simple  
"Array", but with a class in between, so

	ParentClass <> JoinClass <> ChildClass

each class could now be mapped to a table (ParentTable, JoinTable,  
ChildTable) and these tables could (in classical sql-db) joined with  
foreign keys. Or ParentClass and ChildClass are represented by tables  
and the JoinClass represent a "join" and no specific tables, ... or  
everything done using Valentina feature, of course.


So my given samples define a relation between to Classes and map  
these join to database "technics" or map the join to a cross-join- 
table. In my (and other ORMs, too) ORM there is no need to "join"  
tables in the DB to relate classes.

BUT of course on the class level there happen many more things, then  
only modelling the relation between the classes. Because this  
"relation" will also define and "offer" a set of methods and  
properties, which have nothing to do with database at all.


> Simple example of MM link between 2 objects of real world.
>
>     Person  Has  Phone
>         M          M
>
> How this will looks in your framework?

DefineMeAsInfoItem("Person", "phone","","contact","") but I think I  
should write a wiki doc about it ;-)



> May be just make a WIKI page as part of your docs? :-)
I know, but currently I try to keep up with replying to mails and do  
my daily work ... but I'll start writing wiki as fast as possible


regards

Thorsten Hohage
--
objectmanufactur.com - Hamburg,Germany




More information about the Valentina mailing list