Object-Oriented Computation in C++ and Java: A Practical Guide to
Design Patterns for Object-Oriented Computing by Conrad Weisert
Refactoring: Ruby Edition (Hardcover) by Jay Fields
The book "Design Patterns Explained: A New Perspective on Object-
Oriented Design" gives a good overview of what design patterns are,
explains in detail some common design patterns, talks about UML class
and interaction diagrams, etc. The code examples are in Java but they
translate to C++ easily. It's a good read for someone just getting
familiar with design patterns.
Look here. Many book reviews.
Socks
> I have been through study by reading How to Program C++ by Deitel 6th
> Edition. I believe that it has very little information to explain
> design patterns.
> I want to expand more knowledge of better understanding how Design
> Patterns is used with Object-Oriented Programming. I don’t find any
> good books.
> ATM example teaches how to use UML 2.0 and write several base
> classes, one inheritance and polymorphism. ATM is the base class.
> Screen, Keypads, Cash Withdrawal, and Deposit Slot are base classes
> and they have compositions to be placed in ATM’s base class.
>
> Think of creating more subclasses. The screen’s base class is good
> example. I might want to build more subclasses and add more member
> functions and data members to all subclasses.
why are you adding more member functions/data to the screen base
class?
> They are private
> subclasses inside screen’s base class.
that sounds odd. Why would am embedded class be a derived class?
> We discussed gigantic class post earlier. Screen’s base class might
> become gigantic class.
only if you let it. How many different things can a screen in an ATM
do? If it adds something really weird like 3D or smell I'd say it was
time to reorganise your design.