> We could try to follow a convention without "getters", and set up
the
> structure so that the objects "sends" data to each other.
> I still think the "aggregate" model, with the video as a "main"
> meta-object potentially possessing a slider subObject, is a robust
> model.
> The video "tells" the slider where it is, and the slider tells the
> video where it is being dragged, or otherwise manipulated.

OK, it is somewhat semantics. when the user interacts with the slider
the slider would send a message to the QTObject which says "this is
the % I am at this moment of user interaction" and the QTObject would
send a message to the slider at a regular interval saying "this is the
% of distance in the movie I am." thus a slider would not need to know
about QT, AVT, an animation location, or whatever. it owuld be purely
general.

> >Some people argue that this is perfectly acceptable because
> you have not
> >tried to access the private data directly (i.e.:
> objectA.pPrivateData) but
> >instead used a getter method to access it. But what's the
difference?
>
> The difference is that one is public and the other is private, and
> the difference is that using a method rather than prodding directly
> into the objects property, respects its implementation hiding.
> The object has the "capability" to provide some information, that is
> relevant, and this capability is expressed as the presence of a
> method in the public interface. Accessing a property directly looses
> focus of the "capability", and assumes, that the information is
> available as a property, which is updated at any given time.

agreed

> >  You
> >are simply making private data public.
>
> No. You are providing "some" data when requested through a public
> method; different.

again agreed

> >  The question then becomes "Why does
> >object "A" need this data?".
>
> <and the answer may be>
>
> >You have not done complete object
> >encapsulation. Instead keep your object's private data
> private and move the
> >task needed into object "A" or redesign your objects so that
> this does not
> >happen.

as with the slider example where in fact it does not need the
movieTime at all.

Al Hospers
CamberSoft, Inc.
al<at>cambersoft<dot>com
http://www.cambersoft.com

Shockwave and Director development, Lingo programming, CGI scripting.

A famous linguist once said:
"There is no language wherein a double
positive can form a negative."

YEAH, RIGHT



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to