Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!zombie.ncsc.mil!nntp.coast.net!swidir.switch.ch!swsbe6.switch.ch!surfnet.nl!sun4nl!news
From: mzomer@inter.nl.net (mzomer)
Subject: Re: Re2: Persistency FrameWork
X-Nntp-Posting-Host: ztm99-4.zoetermeer.nl.net
Message-ID: <Do0EqF.Dw@solair1.inter.NL.net>
Sender: news@solair1.inter.NL.net (News at news)
Reply-To: mzomer@asd.bso.nl
Organization: ORIGIN
X-Newsreader: WinVN 0.93.9
References: <9602088263.AA826302504@ksc.ksccary.com>
Mime-Version: 1.0
Date: Sun, 10 Mar 1996 01:45:57 GMT
Lines: 85

In article <9602088263.AA826302504@ksc.ksccary.com>, kbrown@KSCCARY.COM says...
>
>mzomer@asd.bso.nl writes:
>
>
>        >1. The product genrates code which is added to the business
>           >objects. If you want to switch to an OODBMS
>           >you have a major problem.
>
>
>           I don't believe you really understand how
>           TopLink works.  The only code added to the
>           business objects is ONE method that
>           describes the meta-structure of the mapping
>           between that object and the database tables
>           that represent it.
>
I do know now, and realy it is not a meta-structure at all. It only
is a hard-wired mapping from the object world to a RDBMS.


>        >2. The product also enforces business object to have a KEY,
>           >sorry, but that not Object Oriented at all.
>           >In a RDBMS you need a key to find related objects (rows).
>           >In a Object Oriented language you have references
>           >(pointers) to releated objects. The way you navigate
>           >through the business object model is via references and in
>           >a RDBMS via associations.

>           Again, I don't think you understand the problem.  The reason
>           business objects must have a key is to map the objects to
>           the corresponding rows in the mapped tables.  This mapping
>           MUST be present somewhere in the image to preserve
>           consistancy between the database and the image.  The key is
>           not supposed to be used or referenced in the Smalltalk code
>           that represents your domain logic at all.
>
I do understand the problem very well. The point is, that adding a KEY
to your business object is completely wrong. This piece of information
has to be stored somewhere else! Do you also add the window handle to
the business object because it is being displayed there? No you don't!

>           The only other possible way of doing this is to use a
>           dictionary that maps these keys to the objects they
>           represent.  This is MUCH, MUCH more inefficient in terms of
>           time (hash collisions, etc) than storing the key in the
>           object.
I do not agree with the performance loss, a look-up in a hash table
is very efficient and can not be compared with time you need to
retreive the actual data from the database.

>
>
>>A way to solve the mapping from a businnes object model to a
>>RDBMS is using a Meta Model which describes your business object
>>model including relations. Smalltalk itself does not has
>>explicit support for relations. Using the Meta Model and a
>>description in Smalltalk of the database structure (this is also
>>a Meta Model) your able to map object ID to keys.
>
>As I stated above, this is really what TopLink does.
>
TOPLink does not sepperate external interfaces from the business
object model and that is what is realy wrong about the product.

>>The code you need to store or retreive objects can be generic,
>>so you do not need to generate code.
>>Generating code is for those programmers who are not able
>>to write generic solurions. If you have the knowlege to
>>write a code generator you also have all the knowledge
>>to write a genric solution.
>
>But TopLink IS a generic solution.  I think you really need to take a look at
>the product documentation rather than going off half-cocked.
>
Again I disagree, TOPLink is NOT a persistency Framework, it can store
object into a RDBMS and that's it!

BTW, next time you reply read my comment more carefully.

CU


--martin

