tags:

views:

113

answers:

3

My understanding of object-oriented design is very limited. My main CS teacher was an old-school C programmer with little/no C++ knowledge, so I only know the basics (polymorphism, inheritance, operator overloading, etc).

Since I've been working with a peer, I've come to discover there are some useful rules to learn, and most of the rules seem to be things Robert Martin talks about.

The difficulty is, which book is the best I-don't-know-anything-coming-in introduction to Object Oriented Design that he has written, with an eye toward C++?

I've found three books that seem to fit the bill.

NB: I already own books on refactoring, design patterns. I'm looking mainly for sources on design from the ground-up.

EDIT: To clarify, I'd appreciate a book. Or something with a high(er) level of organization than simply reading all of his articles on the Object Mentor site. All of the articles on that site seem to assume you've read all the others... it's a way to learn, but the learning curve is ridiculous for someone who hasn't been introduced to the topics previously.

+4  A: 

Don't bother with the books. Just go to objectmentor.com and read the articles. The books just repeat the same things.

Noah Roberts
I've been doing precisely this (esp with the Craftsman articles), but that's part of the problem - the articles are disorganized, more of a dump-you-in-and-you-figure-it-out approach to the topic of design. I'm tired of doing that. I'd appreciate something systematic that fills in my gaps. A bit like Jon Skeet's C# book.
sheepsimulator
OK. Well I read the second book in your list. Except for one chapter you can pretty much read the articles on the website and get exactly the same content. The extra chapter was an example of supposedly applying agile development but they end up just hacking out a single class program. I suppose their (ObjectMentor) point of only going as far as you need to is well shown, but it isn't very helpful for learning to work on anything more complex. So really, just find a TOC of that book and read the articles by the same names.
Noah Roberts
Good idea! Many thanks.
sheepsimulator
+2  A: 

Object-Oriented Design should transcend language, of course. I realize that each language has its own idiom when you implement, but design is language independent.

I'd start with Bob Martin's SOLID principles on-line.

Design in general is a difficult topic. I'd recommend Eric Evan's "Domain Driven Design", especially "DDD Quickly".

duffymo
+2  A: 

I think you'd do yourself a favor by keeping things separate: Robert Martin is many things, but he is not a C++ guru, so don't try to learn C++ from him. Most people who claim to teach you OOP in C++ are wrong, because they invariably fail to realize that C++ is not a OOP language, and treating it as such is a recipe for pain.

Learn what you can about OOP from language-agnostic sources, and then see how much of it you can meaningfully apply to C++.

Robert Martin pretty much equates "good design" with "OOP". In modern C++, that's not really the way to go. You'll occasionally use a few bits and pieces from OOP, sure, and some of the ideas underpinning OOP are still good to keep in mind, but "good C++ code" and "pure OOP" are mutually exclusive.

jalf
oh dear - did our paradigms just shift AGAIN?
Martin Beckett
The principles that RCM describes are equally applicable to "Generic Programming" or any other form of modular design. If you're doing design AT ALL, then RCM's papers are very worth while. Just because something is targeted to OOP doesn't mean you shouldn't be learning it as a C++ developer.
Noah Roberts
@Martin: not "again". But C++ supports several other useful paradigms, and its support for OOP is a bit lacking, so someone blindly trying to write OOP and nothing else in C++ are crippling themselves a bit. @Noah: I'm certainly not saying you shouldn't read his stuff, or that you shouldn't learn OOP as a C++ programmer. Just that you're better off treating it as language-agnostic learning, rather than asking what RCM had to say about OOP in C++ specifically.
jalf
@jalf - Your answers are always enlightening and helpful. I've always been under the impression that C++ is, or can be, OOP, and that was what made it better than C and we ought to leverage that. Your answer leads me to believe what I really need to find is a good intro to Object Oriented Design in general. NB: I only did a minor/emphasis on CS in school, so I don't have a full CS degree under me. I suspect that if I did, I wouldn't be asking these questions.
sheepsimulator