Law of Demeter?

And, OK.... I'll just pass references, it was a passing idle thought.
But thanks : )

What kind of languages espouse real OOP? Smalltalk gets mentioned a lot. Ruby?

Regards,

Liam Clarke

On Mon, 17 Jan 2005 07:48:28 -0000, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > Well, one thing learning Java is good for is for thoroughly
> > demystifying OOP.
> 
> <HOTBUTTON>
> I'd have to disagree here because Java's version of OOP has
> very little to do with real OOP. Java just uss classes as
> a kind of modularisation mechanism and does not make much
> use of tthe real OO features. In fact it doesn't even
> support several of the things that enable real OO
> programming.
> 
> And its class library, a strong feature because it is a
> standard, is dreadful from an OOP p[erspective. In fact
> I usually refer to Java as a Class Oriented Programming
> rather than Object Oriented.
> 
> It is possible to use Java in an OOP way (read Brice Eckel's
> "Thinking in Java" to see how) but the language itself
> encourages a style of programming that is much more like
> Pythons modules than true OOP.
> 
> > It's not some magical acronym of programming
> > goodness, it's just an 'organic' way to organise code.
> 
> Certainly in Java thats true, and indeed even at the
> higher level OOP is a way of organizing code - by
> finding high level abstractions and building tree
> structures based on common intefaces. But Java doesn't
> encourage that structuring as much as Python does!
> </HOTBUTTON>
> 
> > If I understand correctly, once an object is created, as long as
> > references to it exist, it isn't garbage collected.
> 
> Yes.
> 
> > Does that make sense? So, foo is floating around in the namespace,
> and
> > bar just wants to grab a field of foo. Can it?
> 
> It shouldn't - it should be sending a message. One of
> the bad things about Java is it encourages the use
> of getXXX and setXXX style methods which are a total
> anathema to real OOP. They break the Law of Demeter.
> 
> Alan G.
> 
> 


-- 
'There is only one basic human right, and that is to do as you damn well please.
And with it comes the only basic human duty, to take the consequences.
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to