Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!news.netins.net!solaris.cc.vt.edu!news.mathworks.com!gatech!howland.reston.ans.net!ix.netcom.com!netcom.com!rfenney.slip.netcom.com!user
From: rfenney@netcom.com (Robert J. Fenney)
Subject: Re:  Objects from Records Pattern (Objects to RDBMS)
Message-ID: <rfenney-260795122206@rfenney.slip.netcom.com>
Followup-To: comp.lang.smalltalk
Sender: netnews@mork.netcom.com
Nntp-Posting-Host: rfenney.slip.netcom.com
Organization: FenTek
References: <3v5hdu$etn@canton.charm.net>
Date: Wed, 26 Jul 1995 19:52:16 GMT
Lines: 69

In article <3v5hdu$etn@canton.charm.net>, sgoodman@charm.net (Steve
Goodman) wrote:

> In PLoPD'94 Proceedings (ed. Schmidt & Coplien),  Chamond Liu and Kirk Wolf 
> cite a pattern called Objects from Records where data access responsibility is 
> transferred from the Domain (business) object to a Record Class. We're an 
> insurance company with a large amount of relational (DB2 and Sybase) data 
> we need to access and update. Does anyone have any thoughts, experience, 
> feedback on using this approach or examples?  Among the general questions 
> that come to mind are:
> 
> - How do you sync Object attributes to Record attributes to RDBMS column 
>    content?
> - Can your RDBMS structure be totally distinct from the Object model 
>   structure?
> -  Where should business logic be stored? (Domain Object, Record Object, 
>    RDBMS row?
> -  Should the wrapper or RDBMS methods be in Record Class(es) or separate?
> -  Is interclass messaging an issue?
> 
> Any help/comments greatly appreciated.
> Steve Goodman, sgoodman@charm.net,sgoodman@USFG.E-MAIL.COM 

My laytest project has been on a transaction processor for mortgage
lending. I started with a series of objects that had the responsibillity of
access in a 2 layer database which is ORACLE at the region and DB2 at
corporate. The problem came in when I started to reuse the objects in
accoss the multiple subsystems. They did not scale well. What I am in the
process of doing is to segment the objects into database access objects and
model objects. I use the model objects to build the business objects I then
have access object to read/write to the databases, EDI conversion for
access to external venders. This also is allowing the me to respond to the
changing environment. An example is that my client currently is using an
RS6000 base DRDA gateway between the regional databases and DB2. They are
looking at alternatives to speed up the access and get around some of the
limitations. By splitting up the access behavior into their own objects I
am able to retarget this layer with NO impact to the current
implementation. I am also able to reuse to objects in new application
instead of being tied to the current environment. An example is the
addition of laptops. I am now working on modeling a 1003 object based on a
3rd party application and then converting this into my clients 1003 object.
There are multiple levels of business rules that neeed to be understood and
they SHOULDN'T be in the 1003 objects because the requirements are
constantly changing. By modeling the access outside of the objects I am
able to address the issues in a fashion that is supportable.

To answer your questions:
     
The data is synced in realtime by multiple threads. I use a
subscriber/publisher patter.

The RDBMS struct(s) are all different as well as the application(s).

The business rules are stored in multiple places because there are
different types of business rules. The i/o rules are partitioned into the
access objects, the interface rules are partitioned into the gui objects,
and the business object rules are partitioned into the enterprise objects.

I use record objects which have a parsing encapsulating object. This seams
to work best currently.


So far I have had no problems with interclass communications withen the
same address space on the same computer, over a LAN, and over the WAN.


I hope this helps!

Robert
