A
aidy
Hi,
Anyone know of any good resources regarding OOP in Ruby?
Aidy
Anyone know of any good resources regarding OOP in Ruby?
Aidy
I suspect the O'Reilly book The
Ruby Programming Language (co-written by Matz) covers [OOP] in-
depth, too.
I'm surprised that RPL (does it even have an abbreviation?) hasn't made a
bigger splash. Or have I just missed it?
aidy said:Hi,
Anyone know of any good resources regarding OOP in Ruby?
Lyle said:I can't cite any specific references, but I've heard a lot of good
things about it (and I own a copy as well). I get the impression it's
selling fairly well. To be fair, it's still a fairly new book and so
it's not quite as well-established as the PickAxe.
To the best of my knowledge, RPL is your best source for ruby 1.9
information right now, which I'm sure will give it a leg up.
I can't cite any specific references, but I've heard a lot of good
things about it (and I own a copy as well). I get the impression it's
selling fairly well. To be fair, it's still a fairly new book and so
it's not quite as well-established as the PickAxe.
came out, but haven't read it yet.
I wonder if most people are like you and me: bought it as soon as it came
out, but haven't read it yet.
aidy wrote:
Anyone know of any good resources regarding OOP in Ruby?
Designing Object-Oriented Software by Rebecca Wirfs-Brock is quite good.
Be mindful that not everyone has the same idea of what it means to be OO;
Ruby is largely message-oriented (unlike, say, Java's form of OO). (And not
everyone who writes about OO in Ruby sees it that way. Caveat lector.)
Well, I've read parts of it, but given that it's more of a reference
book, I wasn't really planning to read it straight through anyways. I
did of course go through it to look at all of _why's drawings, first
thing.
This was one of the early books approaching OO design in the context
of Smalltalk, which introduced the computation by messages between
objects. It advocates a role-based approach rather than the
abstract-data type approach, corresponding to the C++ (and to a large
extent Java) view of OO.
Robert said:Without wanting to start an indepth discussion about OO, but aren't
these just two sides of the same medal? The message metaphor seems to
lean a bit more on the client side while the ADT view is a bit more
about how messages transform internal state (although ADT is mainly
about observable state through sequences of method invocations). In the
end, in both cases an instance holds state which is changed via method
invocation / method sending and the implementation determines how the
state may be manipulated.
Here's the key difference to me: Taking a message-orient POV, you do
not assume that messages == methods. You think in terms of how an
object does things internally, and then how it will handle messages.
In Java the assumption is that any message you send has to map to a
particular method. It does not encourage the same degree of
encapsulation and emphasis on behavior being distinct from implementation.
In some ways it is similar to the difference in behavior-driven
development and test-driven development.
Point of view matters.
I wrote a series of articles in which Smalltalk and Ruby OOP are
compared which, perhaps, you may find of some interest. Here are the
links:
http://www.sapphiresteel.com/Ruby-The-Smalltalk-Way
http://www.sapphiresteel.com/Ruby-The-Smalltalk-Way-1
http://www.sapphiresteel.com/Ruby-The-Smalltalk-Way-2-A
http://www.sapphiresteel.com/Ruby-The-Smalltalk-Way-3-The-World
Mark said:Using the late, lamented Dolphin Smalltalk. RIP.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.