Appendix B. BurgerShop Code

 // Sandwich.h: interface for the Sandwich class. // /////////////////////////////////////////////////////////////////// #if !defined(AFX_SANDWICH_H__675D6587_481A_11D3_BA98_ 00500428B24D__INCLUDED_) #define AFX_SANDWICH_H__675D6587_481A_11D3_BA98_00500428B24D__ INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 typedef double Amount; #include <string> using std::string; class Sandwich { public: virtual ~Sandwich(); virtual Amount getPrice() = 0; virtual string getName() = 0; protected: Sandwich(); }; #endif // !defined(AFX_SANDWICH_H__675D6587_481A_11D3_BA98_00500428 B24D__INCLUDED_) // SandwichDecorator.h: interface for the SandwichDecorator class. // /////////////////////////////////////////////////////////////////// ...

Get Joy of Patterns: Using Patterns for Enterprise Development, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.