In our last episode, The Reader and The UML Guy refactored the simple Pizza Order Class into a more complex but more robust Class Diagram that supports a full range of pizza order options.
(Click picture for a larger image.)
No new references in this strip. Too much material to cover. But we see the return of some old friends.
Inheritance in UML is called “Generalization”: Menu Item is a general Class, and Pizza, Item, Drink, and Side are more specific Classes. But in most common languages, it’s just called “Inheritance”. When I say “Generalization” in my UML classes, people look at me funny. Don’t blame me, I didn’t make up the names.
For a discussion of why type codes are for losers, I recommend (again) Fowler’s Refactoring.
For an introduction to Patterns, I recommend Design Patterns: Elements of Reusable Object-Oriented Software…
…and also Head First Design Patterns.
Fowler’s Party Pattern and a host of other really powerful Patterns are found in one of the most indispensable books on my shelf.
With Design Patterns — as powerful as they are — there’s a trick: you kinda have to know you need a particular Pattern to know whether you need that particular Pattern. They’re low-level design concepts. Analysis Patterns are higher level, and you can usually recognize when you need them simply by looking at the customer’s business problems.