> I don't think the issue is whether objects can pass data or
> not... Surely
> they must otherwise there would be no communication between
> any of your
> objects. I think the issue is should they pass private data to another
> object via a getter method.

I've been following this thread with a certain amount of puzzlement, but
here you completely lost me...

The way I see it, the moment you define an accessor method in your object,
you automatically declare the property it accesses as public. That's the big
difference. You don't just grab any old property from an object, as you
would with direct access, instead you politely ask for a property that the
object "decided" that it's willing to give.
Also, you don't just get the property: By using a "getter" method you allow
the object to decide what information it wants to give you. It can either
give you the value of it's property "as-is", or make some pre-calculations
and return a value that isn't even stored as part of it's properties.

Same with setters: You can pass the object whatever info you want, and it's
then the object's decision what to do with it. I really can't see the
difference between that and writing any other kind of public method.

In my own work, I often have objects who's main function is to give out
information. For example, I have an object that stores a city-map grid. Most
of it's methods are getters: Whenever another object needs to have a "look"
at the map, it calls one of the getters and receives the information. Some
of the getters just return information, others calculate stuff first and
then send out the results. They don't _do_ anything with the information
themselves, their sole purpose is to give it out to other objects. I don't
see anything "evil" about that >:->

Just throwing my own two-bits into the fray :)

Karina






[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