Practical Object-Oriented Design: An Agile Primer Using Ruby

Practical Object-Oriented Design: An Agile Primer Using Ruby

  • Downloads:1911
  • Type:Epub+TxT+PDF+Mobi
  • Create Date:2021-06-14 09:53:44
  • Update Date:2025-09-06
  • Status:finish
  • Author:Sandi Metz
  • ISBN:0134456475
  • Environment:PC/Android/iPhone/iPad/Kindle

Summary

Ruby's widely admired simplicity has a downside: too many Ruby and Rails applications have been created without concern for their long-term maintenance or evolution。 The Web is awash in Ruby code that is now virtually impossible to change or extend。 This text helps you solve that problem by using powerful real-world object-oriented design techniques, thoroughly explained via simple and practical Ruby examples。 Sandi Metz has distilled a lifetime of conversations and presentations about object-oriented design into a proven set of Ruby-focused practices for crafting manageable, extensible, and pleasing code。 She demonstrates how to build new applications that can survive success, and repair existing applications that have become impossible to change。 Each technique is illustrated with extended examples, all downloadable from the companion Web site, poodr。info。 Fully updated for Ruby 2。X, this guide shows how to:
Decide what belongs in a single Ruby class Avoid entangling objects that should be kept separate Define flexible interfaces among objects Reduce programming overhead costs with duck typing Successfully apply inheritance Build objects via composition Design cost-effective tests Solve common problems associated with poorly designed Ruby code Whatever your previous Ruby experience, Practical Object-Oriented Design in Ruby, Second Edition will guide you to the superior outcomes you're looking for。

Download

Reviews

Sarch

Ya it was fine

Ana Medrano

I was good but the examples were often hard to follow and the writing could have been clearer。

Andrew Mason

It took me several attempts to get through it but when I finally was ready, the content was phenomenal。 If you primarily work in Rails, this can recenter you in Ruby。

Robert Požarickij

It's a relatively short book but it still manages to cover object-oriented programming in both depth and breadth, occasionally diving into topics that are relevant to programming in general (testing, managing dependencies between code)。 It's a relatively short book but it still manages to cover object-oriented programming in both depth and breadth, occasionally diving into topics that are relevant to programming in general (testing, managing dependencies between code)。 。。。more

Michael Dowse

I rarely read technical books but really enjoyed this one。 It helped to solidify and give names to a lot of patterns that were already floating around in my head。There's nothing too radical in here, but a good summary/explanation of some OO techniques/strategies。 Relevant for any language, not just Ruby。 Probably only relevant to software developers though! I rarely read technical books but really enjoyed this one。 It helped to solidify and give names to a lot of patterns that were already floating around in my head。There's nothing too radical in here, but a good summary/explanation of some OO techniques/strategies。 Relevant for any language, not just Ruby。 Probably only relevant to software developers though! 。。。more

Eric Li

Explains OOP jargon in human language。 I like the author's writing style。 A little bit repetitive towards the end but overall a very enjoyable read。 Explains OOP jargon in human language。 I like the author's writing style。 A little bit repetitive towards the end but overall a very enjoyable read。 。。。more

Otavio Valadares

The best OO book that I ever read

Lars Gentsch

Good book about OOD in Ruby。 Code examples regarding MiniTest outdated but nethertheless worth to read

Mabel

The first technical book I've read that meticulously pulls apart design decisions。 Sandi Metz goes through the motions of refactoring and gives a considered explanation for each and every detail。 I really enjoyed it as it answered a lot of questions I had very early on when I first learnt to code。Overall really well written and engaging。 The first technical book I've read that meticulously pulls apart design decisions。 Sandi Metz goes through the motions of refactoring and gives a considered explanation for each and every detail。 I really enjoyed it as it answered a lot of questions I had very early on when I first learnt to code。Overall really well written and engaging。 。。。more

Michael Caveney

An accessible, concise guide to OOP。 Sandi Metz is best known for her talks and writing about Ruby, but the principles here are applicable to any language, really。

Clemens Adolphs

I greatly enjoyed the author's treatment of the concepts of object oriented design。 Free of dogmatism and full of good best practices, focusing on the values behind the principles rather than exact prescriptions of what to do。The book examples are written in Ruby and some of the topics apply more narrowly to that particular language, but as someone who doesn't know any Ruby and is more at home in Python I found that the vast majority of concepts apply just as well。 The important point here is th I greatly enjoyed the author's treatment of the concepts of object oriented design。 Free of dogmatism and full of good best practices, focusing on the values behind the principles rather than exact prescriptions of what to do。The book examples are written in Ruby and some of the topics apply more narrowly to that particular language, but as someone who doesn't know any Ruby and is more at home in Python I found that the vast majority of concepts apply just as well。 The important point here is that they both are dynamically typed languages but where Ruby has "modules", Python has multiple inheritance / mixins。I'd recommend this book to anyone who has experience programming but has occasionally experienced the problem of code that just became too unwieldy and entangled to maintain。 Important concepts about reducing the coupling between objects are introduced, and the authors encourages us to make that important, fundamental to OOD, shift away from objects and toward the messages they exchange。The code examples do a good job explaining the concepts without obscuring them behind any inherent complexity。 That means that, taken at face value, some of the examples might appear over-engineered for the problem at hand。 It just takes a bit of imagination to say "Okay, but if the inner workings of that class were actually as complicated as they'd bound to be in a real-world production application, then this particular technique of encapsulating that complexity would make total sense。" 。。。more

Sean

This is the second edition of Metz's classic, POODR。 It's an awesome review of sound object-oriented design principles, with a heavy influence from the SOLID principles。 There are excellent chapters on having a single responsibility, managing dependencies, building interfaces correctly, and when to use inheritance or modules。 For a developer, it's probably good to read this book every couple of years as a refresher。 This is the second edition of Metz's classic, POODR。 It's an awesome review of sound object-oriented design principles, with a heavy influence from the SOLID principles。 There are excellent chapters on having a single responsibility, managing dependencies, building interfaces correctly, and when to use inheritance or modules。 For a developer, it's probably good to read this book every couple of years as a refresher。 。。。more

Miguel Palhas

I somehow didn't read this book when I first got started。Instead, I ended up learning most of these concepts through experience, and collaborating with people who did read it。It's one of our main recommendations to beginners though, and I couldn't in good consciousness recommend it myself without having read it。 So now I did Ok I skimmed it, mostly。Not much news to me, but it definitely has a lot of useful advice for beginners, and people not familiar with OOP。However, I do take some issue with I somehow didn't read this book when I first got started。Instead, I ended up learning most of these concepts through experience, and collaborating with people who did read it。It's one of our main recommendations to beginners though, and I couldn't in good consciousness recommend it myself without having read it。 So now I did Ok I skimmed it, mostly。Not much news to me, but it definitely has a lot of useful advice for beginners, and people not familiar with OOP。However, I do take some issue with the short section that dealt with static vs dynamic typing。 It felt heavily biased towards dynamic typing, and did not provide the proper arguments I would expect to read about。e。g。 the author claims that, because most statically typed languages allow us to cast freely to other types, then the safety provided by the type system is only an illusion。 But the exact same thing is said about private/public/protected methods in Ruby in an earlier chapter, where the conclusion is "yes, this can be bypassed, but at least they express intent, and if you're reasonable, they're still very useful" 。。。more

Victor Hom

very insightful。easy to follow examples and distills composition and delegation well。good entire last section on testing。

Ramses Miramontes

Good job to learn a good way to use inheritance and composition。

Sananab

1) I love this book。 There are parts I could nitpick (like a lot of reviewers, I strongly disagree with author on static typing; dynamic typing is definitely my least favourite part about Ruby) but I've gained so much from this book that I can overlook the small bits I didn't like。 2) A lot of books of this type tend spread the content pretty thin and have a lot of hype and used car salesman tricks and negging。 This book has a brief introductory section, and then she is 100% content right until 1) I love this book。 There are parts I could nitpick (like a lot of reviewers, I strongly disagree with author on static typing; dynamic typing is definitely my least favourite part about Ruby) but I've gained so much from this book that I can overlook the small bits I didn't like。 2) A lot of books of this type tend spread the content pretty thin and have a lot of hype and used car salesman tricks and negging。 This book has a brief introductory section, and then she is 100% content right until the end。3) This book improves my code at lot every time I read it。 I spent the last month or so paging through it and doing hours of joyful refactoring。 Nothing in the book is exactly revolutionary, but she puts together a lot of little good observations and gives her reasoning in a convincing manner。 I wish all books could have such a positive effect on my actions and my attitude。 。。。more

Rodrigo

This review has been hidden because it contains spoilers。 To view it, click here。 I like the approach of this book。 You use the same example along the book and it has a lot of "what if" scenarios where you can learn from。others mistakes。 I like the approach of this book。 You use the same example along the book and it has a lot of "what if" scenarios where you can learn from。others mistakes。 。。。more

David

Clear explanation of what's good design and when it is important to apply it。 Clear explanation of what's good design and when it is important to apply it。 。。。more

Bahriddin

Book teaches best principles and tips to achieve easy to read, easy to maintain and change software with great examples。 My thinking about designing OOP projects changed to the better side after reading it。

Dardan Bekteshi

Sandi has a great writing style。 Though I am not a Ruby programmer, I learned a lot from this book。

Dawid

The book clearly excels in terms of accessibility and clarity when compared to other technical publications。 I learned a lot and thoroughly enjoyed the journey。 There were bits and pieces that I found more difficult to digest but I was encouraged to devote more time and attention to them。It's a book I see myself returning to again and again to go deeper into specific sections。 I'm really glad to have read it! ❤️ The book clearly excels in terms of accessibility and clarity when compared to other technical publications。 I learned a lot and thoroughly enjoyed the journey。 There were bits and pieces that I found more difficult to digest but I was encouraged to devote more time and attention to them。It's a book I see myself returning to again and again to go deeper into specific sections。 I'm really glad to have read it! ❤️ 。。。more

Tomas Smagurauskas

If you wan't to learn basic of object oriented design and don't have much experience in the field - then the book is right for you。 It present's good basic ideas to follow to improve your OO design and provides simple examples that are understandable to everyone。If you want information beyond the basic topics, then this book about that。 Ideas presented in the book are good, but the examples are not so much。 Examples are very well chosen to fit the narrative of the book and are far from reality。 If you wan't to learn basic of object oriented design and don't have much experience in the field - then the book is right for you。 It present's good basic ideas to follow to improve your OO design and provides simple examples that are understandable to everyone。If you want information beyond the basic topics, then this book about that。 Ideas presented in the book are good, but the examples are not so much。 Examples are very well chosen to fit the narrative of the book and are far from reality。 I。e。 example in chapter 8 works very well to present composition why composition is better alternative in that situation, but in reality, if sub-types were not mere data-bags, the whole example wouldn't have worked。 Discussion about application layer how to structure it, which is IMO the most interesting part about OO design, is not provided。 。。。more

Sardar

The best part of the book: Chapter 9 Designing cost-effective tests。 It is of pure gold quality。 It is very practical and it will massively improve the health of your project。Other chapters sound more like a personal opinion of the author on certain aspects of programming (composition, modules, inheriting behaviour etc) and design principles (coupling, dependency control etc)。 They are discussed in the context of ruby code and as such are more practical than Clean architecture by Robert C。 Marti The best part of the book: Chapter 9 Designing cost-effective tests。 It is of pure gold quality。 It is very practical and it will massively improve the health of your project。Other chapters sound more like a personal opinion of the author on certain aspects of programming (composition, modules, inheriting behaviour etc) and design principles (coupling, dependency control etc)。 They are discussed in the context of ruby code and as such are more practical than Clean architecture by Robert C。 Martin。 。。。more

Piyush

Don’t be fooled by the last part of the title。 This is an excellent OOD book, whether you are a rubyist or not。

Robert Hernandez

Amazing。 There are many books that claim to teach you concept without teaching you the language, and this does just that through the power of ruby。 Even for those who might not understand ruby but understand the concepts of OOP, this book teaches you how to further elevate your thinking to write OOP that is decoupled in nature, but powerful to put together。 It covers composition which is usually overlooked by its “favored” cousin inheritance, which is great to see the power of each and weaknesse Amazing。 There are many books that claim to teach you concept without teaching you the language, and this does just that through the power of ruby。 Even for those who might not understand ruby but understand the concepts of OOP, this book teaches you how to further elevate your thinking to write OOP that is decoupled in nature, but powerful to put together。 It covers composition which is usually overlooked by its “favored” cousin inheritance, which is great to see the power of each and weaknesses。 I love that this book also cover testing, which is something I seek to learn to become better at。 If I had one gripe, its that there isn’t any further books since this has been published! I learn via example, and the example in the books def start the conversation, but there are many exceptions to the rules when we involve legacy or production ready code, and I wish with further volumes to this book, some of those could appear。 I feel I would pay for a subscription to continuously learn this methodology so that I can keep reinforce this mindset, but for now I will re-read, share the love(as I enjoyed both 99bottles and her seminar), and hope to find how to hone these skill by applying to my own code。 。。。more

Cayla Green

I wish I had read this book earlier in my career。 It combines both my love of bikes and my profession of writing ruby。 This book seems to be geared toward a more intermediate-level programmer, but it could be read at any stage in one's career and shed light on important design concepts。 I don't doubt that I will read this book cover-to-cover again in the future, and use it as a reference for design and architecture questions in the future。 I wish I had read this book earlier in my career。 It combines both my love of bikes and my profession of writing ruby。 This book seems to be geared toward a more intermediate-level programmer, but it could be read at any stage in one's career and shed light on important design concepts。 I don't doubt that I will read this book cover-to-cover again in the future, and use it as a reference for design and architecture questions in the future。 。。。more

Olivia

Loved it! Super valuable explanations and examples。

Arttu Malek

This review has been hidden because it contains spoilers。 To view it, click here。 A great introduction to object-oriented thinking in the Ruby way。 It uncovers some special patterns of writing the code and common contracts innate to the language and rubyists that lets the structure of programs be elegant yet clear。 Along with the practical examples that are made up into the series of gradual improvements that uncover the essence of each lesson it sums up to a wholesome experience adapted both for the new rubyists and those with more experience that desire to make their code m A great introduction to object-oriented thinking in the Ruby way。 It uncovers some special patterns of writing the code and common contracts innate to the language and rubyists that lets the structure of programs be elegant yet clear。 Along with the practical examples that are made up into the series of gradual improvements that uncover the essence of each lesson it sums up to a wholesome experience adapted both for the new rubyists and those with more experience that desire to make their code more elegant, idiomatic and true to the concepts of object-oriented programming with Ruby flavor。 。。。more

Daniel

Granted that this is the very first book about software development I've ever finished, this is the best I've ever read。 It was clear and understandable to me as a beginner (with some exceptions) but also comprehensive and fairly complex。 The writing was excellent and persuasive about the appeal of writing well-organized code。 The first few chapters were slightly more clear and persuasive than the later chapters, which veer away from general principles into the weeds of specific techniques, but Granted that this is the very first book about software development I've ever finished, this is the best I've ever read。 It was clear and understandable to me as a beginner (with some exceptions) but also comprehensive and fairly complex。 The writing was excellent and persuasive about the appeal of writing well-organized code。 The first few chapters were slightly more clear and persuasive than the later chapters, which veer away from general principles into the weeds of specific techniques, but the frequent specific examples and step-by-step explanations of them kept it all concrete and understandable。 If you're looking for a book on Object-Oriented Programming (OOP) and intend to program in Ruby, I'd recommend it; but I can't speak to how it compares to other books that use other languages or frameworks for its examples。 。。。more

Nikolay Danailov

A great book even if you aren't programming in Ruby。 Changed the way I look at OOP。 A great book even if you aren't programming in Ruby。 Changed the way I look at OOP。 。。。more