liveBook · Manning

Cookbook

As explained in Object-Oriented Software Design in C++

A book model representing a cookbook with attributes that include its culinary region.

A Cookbook represents a cookbook in a catalogue and carries a culinary region: CHINA, FRANCE, INDIA, ITALY, MEXICO, US, or UNSPECIFIED. Its attributes extend shared title and author fields through CookbookAttrs. section 2.3.3

Cookbook inherits from Book, while CookbookAttrs inherits from Attributes. The catalogue stores both kinds through Book pointers and provides separate insertion and search operations for cookbooks.

Adding a cookbook

catalogue.add(new CookbookAttrs("The Woks of Life", "Leung", "Bill", Region::CHINA));

How Object-Oriented Software Design in C++ covers it

How deep it goes
Defines the class hierarchy, region enumeration, construction, storage, and searching, then flags runtime type checks as a design warning.
Examples
Uses The Woks of Life with Leung, Bill, and Region::CHINA as a catalogue insertion example.
What it assumes
Assumes shared Book and Attributes classes while demonstrating inheritance and superclass construction.
What you can do after
Build it from scratch by defining cookbook attributes, constructing a Cookbook, and adding it to the catalogue.
How it connects
Connects cookbooks to inheritance, the Open-Closed Principle, runtime type checking, and type conversion.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Object-Oriented Software Design in C++. The section links point to the parts of the book it draws on.