|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
Anyone know of any good resources regarding OOP in Ruby? Aidy |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 aidy wrote: | Hi, | | Anyone know of any good resources regarding OOP in Ruby? Err, about everything, I guess. ;P ~From personal experience: The PickAxe (Programming Ruby), and The Ruby Way by Hal Fulton cover this nicely. And I suspect the O'Reilly book The Ruby Programming Language (co-written by Matz) covers that in-depth, too. - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Blog: http://justarubyist.blogspot.com ~ Is it a right to remain ignorant? -- Calvin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkg1n3IACgkQbtAgaoJTgL/XggCfb2X2OGk9CN8rUCQQoLwWZLpP IzcAoJCGS3oPjIjZ+C3l7+mDJKUQ6Hcn =x33R -----END PGP SIGNATURE----- |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
[Note: parts of this message were removed to make it a legal post.]
Can you be more specific? On Thu, May 22, 2008 at 5:20 PM, aidy <aidy.lewis@googlemail.com> wrote: > Hi, > > Anyone know of any good resources regarding OOP in Ruby? > > Aidy > > |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On May 22, 2008, at 9:29 AM, Phillip Gawlowski wrote:
> 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? About the only thing I've seen is a review by someone who didn't finish it. It seems like an O'Reilly book by Matz would be required reading for us all. And Flanagan is a good writer, though he and I have clashed technically. I still have some of Pickaxe left, then I'm going to dive into RPL. ///ark |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Thu, May 22, 2008 at 11:48 AM, Mark Wilden <mark@mwilden.com> wrote:
> I'm surprised that RPL (does it even have an abbreviation?) hasn't made a > bigger splash. Or have I just missed it? 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. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
aidy wrote:
> Hi, > > Anyone know of any good resources regarding OOP in Ruby? You might do well to first look for good OOP references, then see how they ideas are applied 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.) -- James Britt http://www.rubyaz.org - Hacking in the Desert http://www.jamesbritt.com - Playing with Better Toys |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
Ruby is so object oriented that's it's almost impossible *not* to learn
about OOP by using it. Books: Pickaxe is good; I'm halfway through reading it from cover to cover (while also using it for reference). Another book I have is Ruby Cookbook, by Carlson and Richardson, pub. by O'Reilly, which is next in the queue for my bedtime reading. I didn't know about the Matz book; that sounds well worth looking into. Perhaps the OP is after a book on OOP illustrated by Ruby examples, rather than the other way around? -- Posted via http://www.ruby-forum.com/. |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
Lyle Johnson wrote:
> On Thu, May 22, 2008 at 11:48 AM, Mark Wilden <mark@mwilden.com> wrote: > >> I'm surprised that RPL (does it even have an abbreviation?) hasn't made a >> bigger splash. Or have I just missed it? > > 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. I also own a copy. I don't have it with me right now so I can't cite any specific examples, but I've found it oddly incomplete. Sometimes I'll look up something and not find it, and have to go to the Pickaxe instead. So, overall I think it's a good companion to the Pickaxe. -- Posted via http://www.ruby-forum.com/. |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
On May 22, 2008, at 12:41 PM, Dana Merrick wrote: > 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. Actually, not wanting to toot my own horn too much, but... The new PickAxe beta is more up-to-date: Ruby 1.9 has changed significantly since December, and it continues to change. Hundreds of methods have been added to the built-in set. Complex and Rational are now built in. Existing methods have tweaks to their behavior. And changes are still being made. If you want a paper book now with 1.9 stuff in it, then RPL's the only game in town. I deliberately haven't looked at it because I don't want to taint what I'm writing for the PickAxe, but I hear good things. If you're OK with a PDF that is getting updated as 1.9 evolves, then you might want the PickAxe. Dave |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
On May 22, 2008, at 10:00 AM, Lyle Johnson wrote:
> On Thu, May 22, 2008 at 11:48 AM, Mark Wilden <mark@mwilden.com> > wrote: > >> I'm surprised that RPL (does it even have an abbreviation?) hasn't >> made a >> bigger splash. Or have I just missed it? > > 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. I wonder if most people are like you and me: bought it as soon as it came out, but haven't read it yet. ![]() ///ark |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
> I wonder if most people are like you and me: bought it as soon as it
> came out, but haven't read it yet. ![]() Cant speak for anyone else but normally when i buy something i will read it. But if it is too boring, I will never finish. That is a general rule by the way. ![]() The worst thing were some perl books years ago. I have never finished reading them, gave most of them away already (only one is kept because I will work through it, note what is important in my local knowledge base, and then give this book away as well) -- Posted via http://www.ruby-forum.com/. |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
On Thu, May 22, 2008 at 1:42 PM, Mark Wilden <mark@mwilden.com> wrote:
> I wonder if most people are like you and me: bought it as soon as it came > out, but haven't read it yet. ![]() 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. |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
On Thu, May 22, 2008 at 1:03 PM, James Britt <james.britt@gmail.com> wrote:
> aidy wrote: > Anyone know of any good resources regarding OOP in Ruby? > > Designing Object-Oriented Software by Rebecca Wirfs-Brock is quite good. A classic indeed! > 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.) Which is why Rebecca's book (actually Rebecca, Brian (Wilkerson), and Lauren's (Wiener) book, is appropriate for Ruby. 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. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
On Thu, May 22, 2008 at 4:04 PM, Lyle Johnson <lyle@lylejohnson.name> wrote:
> On Thu, May 22, 2008 at 1:42 PM, Mark Wilden <mark@mwilden.com> wrote: > >> I wonder if most people are like you and me: bought it as soon as it came >> out, but haven't read it yet. ![]() > > 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. I too am reading it slowly. Most of the time it sits ready for a quick session in the Master "Library" at home. I think that RPL and the Pickaxe are complementary, RPL covers the language step by step in depth and really doesn't cover the core and extension class librarys nearly as well, if at all as the pickaxe. The Pickaxe is more tutorial. Ultimately the serious Rubyist will want both. I'm think that in someway they are to Ruby what the K&R, and Harbison and Steele pair of books are/were to C, although that's not an exact analogy. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ |
|
|
|
#15 |
|
Messages: n/a
Hébergeur: |
On 22.05.2008 22:36, Rick DeNatale wrote:
> 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. 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. Kind regards robert |
|
|
|
#16 |
|
Messages: n/a
Hébergeur: |
Robert Klemme wrote:
> On 22.05.2008 22:36, Rick DeNatale wrote: >> 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. > > 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. -- James Britt http://www.rubyaz.org - Hacking in the Desert http://www.jamesbritt.com - Playing with Better Toys |
|
|
|
#17 |
|
Messages: n/a
Hébergeur: |
On 23.05.2008 00:15, James Britt wrote:
> Robert Klemme wrote: >> 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. I believe there is usage for both approaches - even within the same project: usually I create classes from the outside, i.e. I decide about their responsibilities, their interface and then I decide how they should be implemented. In other cases, e.g. when implementing a particular algorithm I probably will first think about the internals and then decide which input or interface a class needs. In both cases though clarifying responsibilities of a class (-> CRC cards) is the first and most important step IMHO. > 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. I am not sure I get your point here. Looking at e.g. interfaces in java.util what else is this than a separation of behavior (e.g. map lookup) from the implementation (HashMap, TreeMap)? > In some ways it is similar to the difference in behavior-driven > development and test-driven development. > > Point of view matters. At least as a means for reasoning about how one does software development and which alternative approaches are around. Thank you for your input! Kind regards robert |
|
|
|
#18 |
|
Messages: n/a
Hébergeur: |
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-Th...ay-3-The-World best wishes Huw Collingbourne SapphireSteel Software Ruby and Rails In Visual Studio http://www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/. |
|
|
|
#19 |
|
Messages: n/a
Hébergeur: |
On May 25, 2008, at 9:57 AM, Huw Collingbourne wrote:
> 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-Th...ay-3-The-World Using the late, lamented Dolphin Smalltalk. RIP. ![]() ///ark |
|
|
|
#20 |
|
Messages: n/a
Hébergeur: |
Mark Wilden wrote:
> Using the late, lamented Dolphin Smalltalk. RIP. ![]() > It's not quite as dead as it seemed. At any rate, in August they announced the end of development. Then in January, they announcded a new beta: http://www.object-arts.com/content/news/x61beta1.html I think Object Arts found it a struggle to make a living from Dolphin Smalltalk which is why the developers were forced to take on other work. But many existing Dolphin users were reluctant to let it go. Hence, its 'second life' (albeit, I suspect at a more laid-back rate of development). It would be a great shame if Dolphin Smalltalk just faded away. It's a lovely product. best wishes Huw SapphireSteel Software Ruby and Rails In Visual Studio http://www.sapphiresteel.com -- Posted via http://www.ruby-forum.com/. |
|
|
|
#21 |
|
Messages: n/a
Hébergeur: |
On 22 May, 09:29, Phillip Gawlowski <cmdjackr...@googlemail.com>
wrote: > > | Hi, > | > | Anyone know of any good resources regarding OOP in Ruby? > > Err, about everything, I guess. ;P > > ~From personal experience: The PickAxe (Programming Ruby), and The Ruby > Way by Hal Fulton cover this nicely. And I suspect the O'Reilly book The > Ruby Programming Language (co-written by Matz) covers that in-depth, too. Pickaxe informs us about Ruby, but not OOA\D\P. Like Python and Java, with Ruby you can still implement procedurally. Aidy |
|
|
|
#22 |
|
Messages: n/a
Hébergeur: |
On 22 May, 10:03, Dave Bass <daveb...@musician.org> wrote:
> Ruby is so object oriented that's it's almost impossible *not* to learn > about OOP by using it. > I feel that you could learn about OO Ruby, but the language does not necessitate OO development. I could write everything in modules. I could use classes as a container but not in an OO way (inheritance, polymorphism and encapsulation). Aidy |
|
|
|
#23 |
|
Messages: n/a
Hébergeur: |
In Ruby, everything is an object.
First you must learn OOP (Object Orienter Programming), if you know oop then Ruby's OOP. Blog: Ruby Programming Language - http://ruby.unlimitedandfree.com -- Posted via http://www.ruby-forum.com/. |
|
|
|
#24 |
|
Messages: n/a
Hébergeur: |
On May 25, 2008, at 1:14 PM, Huw Collingbourne wrote:
> Mark Wilden wrote: > >> Using the late, lamented Dolphin Smalltalk. RIP. ![]() >> > > It's not quite as dead as it seemed. At any rate, in August they > announced the end of development. Then in January, they announcded a > new > beta: http://www.object-arts.com/content/news/x61beta1.html That news made my day. I don't use Smalltalk or even Windows anymore, but the six months or so I spent working on a Smalltalk project with Dolphin was the most enjoyable of my whole career. Dolphin is the best IDE I've ever used. Next comes Visual Studio. ![]() ///ark |
|
|
|
#25 |
|
Messages: n/a
Hébergeur: |
On May 26, 3:59 pm, luka luka <dezer...@posta.ge> wrote:
> In Ruby, everything is an object. The 'if' expression is not an object. Aidy |
|
![]() |
| Outils de la discussion | |
|
|