26.6 The COMPOSITE Pattern
Consider the invoice program (chptr 13)
Lists an item, quantity, and unit price
We'd like to add
bundles
of items
Sol'n: inherit
Bundle
from
Item
class Bundle : public Item { . . . private: vector<Item*> items; };
prev
|
top
|
next