[KLUG Programming] Proper OO Technique Question

Robert G. Brown programming@kalamazoolinux.org
Fri, 08 Aug 2003 10:50:16 -0400


On Fri, 08 Aug 2003 09:59:41 -0400, Adam Williams <awilliam@whitemice.org> wrote:

>I've designed a new little project for myself...
>Anywho... (it takes me awhile to get to the actual question)
I see! :)
.... a few details elided for brevity ...
>So I've got objects like oGoProject, oGoContact, oGoEnterprise, etc...
And they all inherit from a common ancestor?

>But one question I've always had is what is the proper OO way to enumerate 
>the available projects, contacts, etc...

>Do you create a oGoProjectList object?  Thats what I've always done in the 
>past, but it seems kind of lame.
This is one place where a lot of OO models start to err, IM (and some others)O.
This also touches on almost a religious point; some would require you to build
a really "grounded" system (like Smalltalk), but I suspect we don't care a lot
for this kind of thing here.

I beleive that classes define data types, and objects are instances of a 
state (or value) of that data type. As such, you're looking at well-defined,
single (or indivisible) values. It is useful to speak of ARRAYS of objects,
but mixing the notion of data type and various array properties (such as 
the length and shape of an array, among others) harms clarity.

>Is there a cannonical solution to where you "start" in an OO model?
I'm not familiar with the OO environment you're wroking in, so I don't know
how stroing concepts like polymorphism or genericity are developed. Can you
(or why not?) simply use arrays of 0Go... objects, perhaps declaring them
(if you have to) as some base class... this is a C++'ish/Smalltalk kind of
response; these are languages that in esssence force homogenous arrays...

Perhaps it would help to tell us more about the nature of this environment, 
as in how well-developed are some OO characteristics [??]

							Regards,
							---> RGB <---