Al Hospers wrote:
> 3 - make it accessible via an accessor method
> thus we are left with item #3 which alllows the object to control the
> format of the data being accessed and while not perfect, is certainly
> the lesser of 3 "evils."
> what do you think?
I'm jumping into this discussion a bit late but I've been following along,
like Karina, with some puzzlement, and hopefully enlightenment too.
I think Al and Karina's assessment of the need for accessor methods is
right on the money.
The analogy that has always worked for me structuring my object
programming is the "company or office analogy".
Each one of my objects is an employee in a company. They all are good at
given tasks but need to communicate to each other in order for the company
to run effectively. The CEO (chief executive object) while knowing how to
present the financial status to share holders and make decisions based on
that data does not do all the accounting itself. It has accountant objects
(AO) which specialize in maintaining data. Then when the CEO needs
information from the AO it politely asks for it, even though it has the
authority to go down to the AO's office and start sifting through the AO's
files. The CEO doesn't...because it may not need the raw data but rather
an assessment of that data which is the AO's job. This analogy has always
worked for me and has made explaining OOP much easier to others.
I also like it because it makes more sense, when it comes to ancestory in
lingo, then the analogy of "you have green eyes because your mother has
green eyes". In my OOP office the AO may be asked by some object what they
think the earnings for the next quarter will be. The AO not having all the
information required to make such an assessment, would either have to tell
the inquirer to go talk to the CEO or the AO could find out directly
because of "ancestory". The AO could say "I don't know how to do this but
my boss does and my boss will give me the answer". When I explain this to
people they seem to understand it much more readily then the eye colour
system. They can see how if the AO gets a new CEO their response to the
earnings question may be different because the new CEO may have a new way
of analyzing things. Whereas if your mother dies and your Dad remarries
and your new Mom has blue eyes it doesn't me your green eyes will become
blue :-)
So that's my two cents. Its a great discussion, now I just need to find
some time to go read those articles and books that have been mentioned.
later,
Rob
[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!]