[177] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: Encapsulation

daemon@ATHENA.MIT.EDU (Fri Mar 25 21:11:29 1994 )

From: rayn@q.crossaccess.com (Ray Nawara jr.)
To: zachary@io.com (Zachary)
Date: Fri, 25 Mar 1994 17:05:57 -0800 (PST)
Cc: coldstuff@MIT.EDU
In-Reply-To: <199403260028.SAA24596@illuminati.io.com> from "Zachary" at Mar 25, 94 06:28:32 pm

> >> Umm, whats the difference between adding something to the containers contents, 
> >> and asking the container to add someting to its contents? and why is adding 
> >> someting to the cointaier's contents not setting the containers contents variable?
> The difference is the conceptual level aat which you and the code operate
> on.  Directly adding something to a containers contents by manipulating
> its internal variables is the wrong kind of thinking... There may be some
> other kinds of things that need to be done when a container adds
> something to its contents - some checking for this or that or whatever -
> that won't be done if you think of the way to put things into a container
> is to get it to manipulate its variables in a certain way.  You need to
> think, instead, of getting the object to ask the container to put be put
> in its contents... this way both objects have ways to 'hook into' the
> process of being moved into the container.  I know this all sounds sort
> of confusing, but basically it says to try to think at a higher level of
> abstraction than code and objects - think of actions instead of code...
> especially when conceptualizing.  Then translate each little action that
> makes upt he overall action into code... 
>  --Zachary
Actually, my suggestion was to ask the object to add the value to its containers
var, not to directly set it. My whole core modification is to make it so you
only ever directly assign a variable in one place - the variable accessor on the
object. It seems that after a certain point the language becomes insufficient
to discuss this kinda stuff, since it seems my phrasing was totally confusing :)I was actually trying to understand if there's a difference between asking 
the contents parameter on object a to add item x, and adding item x to the
contents of container a, which seems like an abstraction, while im trying to
understand how to write the code...
Ik thats sounding confusing now too. I'm gonna read some OO books tonight and
see what i can find out.