Possible Duplicate:
What books or resources would you recommend to learn practical OO design and development concepts?
I have been mostly a C programmer so far in my career with knowledge of C++. I rely on C++ mostly for the convenience STL provides and I hardly ever focus on good design practices. As I have started to look for a new job position, this bad habit of mine has come back to haunt me. During the interviews, I have been asked to design a problem (like chess, or some other scenario) using OOP and I doing really badly at that (I came to know this through feedback from one interview).
I tried to google stuff and came up with so many opinions and related books that I don't know where to begin. I need a good through introduction to OOP design with which I can learn practical design, not just theory.
Can you point me to any book which meets my requirements? I prefer C++, but any other language is fine as long as I can pick-up good practices.
Also, I know that books can only go so far. I would also appreciate any good practice project ideas that helped you learn and improve your OOP concepts.
ChessPiece
that has a position on the board, and is capable of moving, and specific pieces likeKnight
orRook
that inherit fromChessPiece
to restrict what kinds of movements they can act upon.CheckProhibitedMove
or some such, which would check to see if a potential move matches one that the given algorithm says is prohibited. So movement rules would be a member ofChessPiece
, likely a collection assuming multiple rules can apply to a piece, and each would be checked before a movement is carried out. I think what they're looking for here is an understanding of both inheritance (which you seem to have down) and composition (which you might be a bit shaky on).