April 2014
Beginner to intermediate
634 pages
15h 22m
English
We can define a class for the suits of our cards. In blackjack, the suits don't matter, and a simple character string could work.
We use suit construction as an example of creating constant objects. In many cases, our application will have a small domain of objects that can be defined by a collection of constants. A small domain of static objects may be part of implementing a Strategy or State design pattern.
In some cases, we may have a pool of constant objects created in an initialization or configuration file, or we might create constant objects based on command-line parameters. We'll return to the details of initialization design and startup design in Chapter 16, Coping with the Command Line.
Python ...