Tech Off Thread

13 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Which OOP books would you recommend to read, to better understand the concept?

Back to Forum: Tech Off
  • User profile image
    erik_

    Hi,

    The current problem that I have is that I kinda understand the basics of OOP only I feel am not yet there to correctly implement it.

    It feels like I now know some magic card tricks, but the rest is not there yet (distracting the public, etc.). I know some of the 'tricks', but to go from a real life senario to an object diagram is something I have problems with.

    Does anyone know any good books about this, which go deeper on this that only a howto do it in language X?

    Thanks in advance.

  • User profile image
    gabe19

    In terms of learning implementation once you have all the terms and ideas swimming around in your head, I really appreciated Ivor Horton's book on beginning C++. I can't really recall if he tackles the issue directly, or if it just keeps coming up in the examples. In any case, it's a good book if you don't know C++ (and care to).

    For myself, and others I have talked with there is usually an epiphany concerning OOP after you have been struggling with the concepts for a while. Just keep trying to apply the ideas. All of the basic patterns in the GOF patterns book are object oriented. Try working through those.

  • User profile image
    eddwo

    I really liked Head First Design Patterns
    but I'm still struggling with this aspect myself.

    Its all very well teaching people the basics with silly examples like
     
    abstract class  Animal
    {
        MakeNoise();
     }

    class Dog : Animal
    {
         MakeNoise()
        { 
            bark();
         }
    }

    but that doesn't help when trying to decide things like how much responsibility each class should be given, how to create useful abstractions and reusable object models etc.

    Where do you go to learn the "real" stuff?

  • User profile image
    cokert

    Code Complete (here) has a good chapter on OO design.  The book has a lot more info than just classes, too.

  • User profile image
    NeZz_DK

    I would recommend Craig Larman: Applying UML and Patterns. He goes thrugh all faces of Iterative develeopment at first, in the last part of the book he explains implementation and use of the GoF patterns and the basics of OOP, its an really great book, and easy to read.

    but dont know if thats what you are looking for?

  • User profile image
    eddwo

    I think I already have the 2nd Edition of that book, it's mostly the same, but is based around RUP.

  • User profile image
    Dr Herbie

    Hi,
       I haven't found a single book that clearly covers all the language-agnostic parts of OOP (hey! maybe there's a gap in the market Smiley ), but I have found several book influential in an indirect sense:

    Martin Fowler's Refactoring
    Kerievsky's Refactoring to Patterns
    A second Fowler book that I found interesting was Analysis Patterns
    I also found the Microsoft book Framework Design Guidelines to be useful if you're ever writing code that other people might use (either in a framework, or just because they're on the same programming team as you).

    Another goody is to read as much as you can about design patterns and try to figure out why people use these designs; why are they considered good?


    One book I didn't like too much was Object-Oriented Design Heuristics -- I disagreed with some of the recommendations made in this book.  It sounded too much like a lecture from a classroom; based on theory rather than actual practice.

    I should also give a second vote for Code Complete, which is one book I think every programmer should have on their desk. I haven't finished catching up on the second edition, but I believe it's extended the first edition in the object oriented area.

    Just my 2p worth.


    Herbie

  • User profile image
    erik_

    Thanks for the fast responses.

    First gonna order and read code complete first, because that was already on my books to read list Smiley (They also pointed to this book from the MCTS 70-536 training kit book.)

    Gonna look for Ivor Horton's book on beginning C++ at my schools libary when the summer vacation is over, because they don't sell it on dutch bookstores anymore.

    I've seen the Head First Design Patterns book, well the cover. Didn't had a good feeling about it, it gave me this DHTML for dummies feeling, because the image on the front. Gonna check it out in a bookstore.

    Placed Craig Larman: Applying UML and Patterns, Martin Fowler's Refactoring, Kerievsky's Refactoring to Patterns, Analysis Patterns on my books to read list.

    Got enough books to get true the vacation period Cool

  • User profile image
    mawcc

    A very good book and true classic is Grady Booch's Object-Oriented Analysis and Design with Applications. It gives you a solid theoretical background on the idea of object orientation and also has a couple of walkthroughs for real world applications. Less relevant today is the material about the notation (clouds, anyone?).

  • User profile image
    Andy_S

    Second vote for Code Complete here.
     
    Finished the second edition not long ago and it is excellant read which has been expanded in the 2nd Edition to include some mention of .net Wink. Still a lot of coverage of C++ but still it's good to be aware of it's pitfalls. If you have done a lot of developement work in the past some sections of the book will seem slow, but they can be skim read.

  • User profile image
    JuNK64

    www.blueportal.org

  • User profile image
    ScanIAm

    eddwo wrote:
    I really liked Head First Design Patterns
    but I'm still struggling with this aspect myself.

    Its all very well teaching people the basics with silly examples like
     
    abstract class  Animal
    {
        MakeNoise();
     }

    class Dog : Animal
    {
         MakeNoise()
        { 
            bark();
         }
    }

    but that doesn't help when trying to decide things like how much responsibility each class should be given, how to create useful abstractions and reusable object models etc.

    Where do you go to learn the "real" stuff?

    Get a job, write some code, make mistakes, and learn from them.

    There isn't any cookie cutter approach that will give you that kind of knowledge.  That's why we are computer scientists, not computer operators.  We should be experimenting with the stuff that isn't obvious.  Smiley

    I've seen people OOP a concept to death in that they will write an object that manages a collection of other objects which do nothing more than return data.  Is this OOP?  Technically, yeah, but it is sure is a lot of code to go through.

    Also, don't let OOP run your world.  Your job is to write software that does stuff.  It may be neat to completely encapsulate every object in such a way that Dog inherits from Animal, but if, right now, you only need a Dog, don't waste time working on Animal. 

    Chances are, you'll know when you need to use inheritance because you'll find yourself writing similar code on similar objects.

  • User profile image
    Dr Herbie

    ScanIAm wrote:
    

    Also, don't let OOP run your world.  Your job is to write software that does stuff.  It may be neat to completely encapsulate every object in such a way that Dog inherits from Animal, but if, right now, you only need a Dog, don't waste time working on Animal. 

    Chances are, you'll know when you need to use inheritance because you'll find yourself writing similar code on similar objects.


    Spot on.

    I found that after learning about Design Patterns I suffered about 6 months of pattern-itus where everything I wrote had be use design patterns.

    That's why I recommended the Refactoring to Patterns book specifically -- it's about getting working code first and then patternising it when it's needed (same with Fowlers Refactoring too, but Refactoring to Patterns is more explicit about this).

    The main programming philosophy I follow is:
    1. Get the code working
    2. Make it faster, smaller, and easier to maintain, if that is what is needed.

    This is also why I like Test Driven Development -- it makes the refactoring easier with regression testing.


    Hebrie

    With all these book referrals, maybe I should set up one of those Amazon pass-through sites to make comission Smiley



Conversation locked

This conversation has been locked by the site admins. No new comments can be made.