Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!hudson.lm.com!news.pop.psu.edu!psuvax1!uwm.edu!spool.mu.edu!sgiblab!nbn!news
From: joeb@calon.com
Subject: Re: Smalltalk Object with SQL datatype mapping
Message-ID: <D0p1Cx.DJs@nbn.com>
Sender: news@nbn.com
Reply-To: joeb@calon.com
Organization: North Bay Network's news posting service - not responsible for content
X-Newsreader: IBM NewsReader/2 v1.03
References: <3c5fta$1n7@scipio.cyberstore.ca>
Date: Mon, 12 Dec 1994 10:34:07 GMT
Lines: 18

In <3c5fta$1n7@scipio.cyberstore.ca>, howardh@bcaa.bc.ca (Howard Hui) writes:
>If I have an object which map to a row in a SQL table, what should I
>use to initialize the instant variables to?  Should I initialize all
>the instant variables to nil or should I initized them to NULL string
>("") for string type or numeric zero (0) for numeric variable?  What is
>the pros and cons in either ways?

We find it better to create a class for representing SQL NULL values, and
then using an instance of that class to represent the NULLs in the Smalltalk
object.  It gives explicit control to the behavior of the NULL object, without
having to add a bunch of methods to UndefinedObject.

--------_/_/_/-----_/_/_/---- Joe Barnhart
-------_/----_/-----_/------ Sr. Software Engineer
------_/_/_/-------_/------ Roos Instruments Co.
-----_/----_/-----_/------ CIS: 76174,1573
----_/----_/---_/_/_/---- joeb@calon.com

