At 11:40 +0100 2000_12_15, Clars wrote:
>on getProperty me, prop
>   return value(prop)
>end

You can declare which propNames are "public" and allowed access to 
through the universal accessor method, like so:

case prop of
   #kjfkd, #jsfif, #fsf:
     return me[prop]
end case
return "error: blah"

That will be a quick way to determine which propnames you have 
granted access to, so that when you go about changing propNames you 
know where to look for problems.
You can still change a public propname, just write a specific 
translation in accessor method, like so

   #oldName:
     return me[newName]

Also you can do any required processing. like so:

   #someProp:
     me.mDoSomeCalcs()
     return pThis + pThat

Personally I just write each required method, but if you loathe that, 
I still think that using a universal accessor method is infinitely 
better than accessing props directly from the outside. Aside the 
reasons mentioned, you have much easier debugging when you know where 
to trap calls that modifies your properties. It is still proper OOP 
because it is the objects own methods that delivers and modifies its 
properties, giving you the designer the same powers to control things 
as you'd have with specific methods. Stylistically it's not as pure 
as separate methods, IMO.

Jakob


[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