[170] 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 19:32:22 1994 )

From: zachary@io.com (Zachary )
To: rayn@q.crossaccess.com (Ray Nawara jr.)
Cc: ghudson@MIT.EDU (Greg Hudson), coldstuff@MIT.EDU, zachary@io.com
In-Reply-To: Your message of Fri, 25 Mar 94 15:32:21.
Date: Fri, 25 Mar 94 18:28:32 CST

>> Well, i was actually suggesting a core modification, as opposed to a server
>> modification, sorry if you dont want to talk about core issues here...

Greg: *is* there a place for folks to talk about MI core issues?
Designing an MI core poses some interesteing problems, and I was
wondering if there's any place to discuss some of them... 

>> > Second, it encourages programmers to think of other objects in terms
>> > of their state variables rather than their operations.  There's no
>> > pragmatic difference between "setting a variable on an object" and
>> > "asking an object to change its variable"; both of these are what
>> > encapsulation is trying to avoid.  Usually, you should think about
>> > abstractions in higher terms.  You are not setting the contents
>> > variable of a container to a list containing an extra item; you are
>> > adding something to a container's contents.
>> 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...