Tuesday, August 30, 2005
Wednesday, August 24, 2005
But that can't take up all of my time, can it? No, but it took up a lot. Then my weekend got derailed by an unfortunate ATM incident (since resolved) that left me planning how to stretch $20 for I wasn't sure how long. So none of the fun stuff I planned to do and blog about took place: no visit to the Bonsai gardens (next trip) and no visit to Borders to get fresh reading material. I just sat in the hotel room and worked on various projects and watched lots of Bond films.
And now it's my last day in Atlanta, and what a day it was! Today, we had our first review meeting, which went better than I dared hope.
Then I drove to Borders, and was delighted to find my book on the shelves. (For all that I'm unimpressed by their discount program, I'm usually pleased to find that Borders carries my book in most outlets.)
And then a little advance scouting had told me that nearby was Fire of Brazil, a Brazilian churrascaria restaurant. That means that the cooks skewer various meats on swords and cook the meat over open flames; and then gauchos bring the meat-laden swords around to the tables. You get a little card, red on one side and green on the other. If you turn it to green, they stop at your table and offer to cut you off a slice of whatever they happen to be carrying. Today I had slices of tenderloin, top sirloin, pork loin, turkey, pork sausages, and so many other meats I can't remember them all. It's not for every day (well, unless you're an Atkins devotee), and it's pricey; but as a treat, it's not to be missed.
And tomorrow, I get to fly home, and get my computer back from the shop, and see my wife and dogs, and then head to Ann Arbor for the 8th annual Duelist. I'll try to post photos.
But that can't take up all of my time, can it? No, but it took up a lot. Then my weekend got derailed by an unfortunate ATM incident (since resolved) that left me planning how to stretch $20 for I wasn't sure how long. So none of the fun stuff I planned to do and blog about took place: no visit to the Bonsai gardens (next trip) and no visit to Borders to get fresh reading material. I just sat in the hotel room and worked on various projects and watched lots of Bond films.
And now it's my last day in Atlanta, and what a day it was! Today, we had our first review meeting, which went better than I dared hope.
Then I drove to Borders, and was delighted to find my book on the shelves. (For all that I'm unimpressed by their discount program, I'm usually pleased to find that Borders carries my book in most outlets.)
And then a little advance scouting had told me that nearby was Fire of Brazil, a Brazilian churrascaria restaurant. That means that the cooks skewer various meats on swords and cook the meat over open flames; and then gauchos bring the meat-laden swords around to the tables. You get a little card, red on one side and green on the other. If you turn it to green, they stop at your table and offer to cut you off a slice of whatever they happen to be carrying. Today I had slices of tenderloin, top sirloin, pork loin, turkey, pork sausages, and so many other meats I can't remember them all. It's not for every day (well, unless you're an Atkins devotee), and it's pricey; but as a treat, it's not to be missed.
And tomorrow, I get to fly home, and get my computer back from the shop, and see my wife and dogs, and then head to Ann Arbor for the 8th annual Duelist. I'll try to post photos.
Monday, August 8, 2005
Objects and Classes
In our last installment, we identified and organized actors, the people and systems with which Your Comic Source will interact. Then I promised that in this installment, we'd identify and organize examples of our second UML concept: domain objects, the information and things that are of interest to the actors and that are affected by the things they do.
Now when I said "objects" above, some of you ran screaming from the room, thinking, "Oh, no, that means object-oriented programming! That's hard!" Well, personally, I think that "objects are hard" is very much old-school thinking. Literally old-school: the object-oriented (OO) approach is a hard transition for programmers who have mastered and adjusted to functional or structured programming. But in my experience, it's actually easier to teach new programmers using OO, because it's a more natural match to how we think and speak about the world.
And when I said "objects" above, others of you shook your heads in disapproval, thinking, "Oh, no, that means object-oriented programming! That means design and code. It's too early for that." There is a tendency to think:
objects = classes = code (Wrong!)
As I argue in my book and in my classes, objects are not just a code construct. Objects are everywhere, becuase they're just things and concepts in the world around us (and thus in the problem domain). Really, the proper formulation is simply this:
objects = nouns (Right!)
Objects are things. The actors and customers and end users are concerned about and work with things. Therefore, actors and customers and end users are concerned about and work with objects. And therefore, objects are an essential part of analysis, not just design and code.
But above, I also mentioned classes. "Aha!" cry the nitpickers. "Now classes are code! And it's too early for code. We told ya so!"
And again, I have to disagree. "Class" is really just another name for "category" or "kind" or "type" (though "type" also has code connotations). It just means a grouping of very similar objects that can be described in similar traits and terms. "Dog" is a class; Betsy, Bluebell, Jake, Radar, and Frosty are particular objects of the class Dog. They differ by many characteristics — breed, sex, height, weight, coat, color, age, and name being the main ones — but they're all Dogs just the same. Meanwhile, Gomer — who has a breed, a sex, a height, a weight, a coat, colors, an age, and a name — is fundametally not a Dog. He's of class Cat. We recognize Dog and Cat as different categories, even though it might be convenient to lump them together in the code.
So while it's true that OO programming languages have a concept called classes, it's not true that classes = code. Classes are a useful part of our analysis model, too. (Insisting that objects = code or classes = code is an example of the That’s Design, Not Analysis antipattern, as I discuss in Requirements Patterns and Antipatterns.)
But categories can themselves be grouped into categories. Or to speak in OO terms, a class can have a base class (or sometimes called a superclass, or a general class, or a parent class, or a number of different synonyms based on the speaker's programming language and habits) that describes common characteristics shared with other classes. For example, Dog and Cat have a base class of Mammal; and it's in Mammal that we describe the characteristics of breed, sex, height, weight, coat, color, age, and name. Because those characteristics are part of Mammal, they are implicitly part of Dog and Cat.
And just as a class can have a base class, it can have multiple subclasses (or sometimes called a derived classes, or a general class, or a child class, or other synonyms) that add more specific characteristics and details. The relationship between base class and subclass is sometimes called "inheritance", because the subclass inherits characteristics from the base class. The relationship is also sometimes called "specialization", because the subclass is a more specialized form of the base class. And in "official" UML parlance, the relationship is called "generalization", because the base class is a more general form of the subclass. (I really must apologize for all these different synonyms. They arose through different branches of OO evolution, and we're just kinda stuck with them. I'll try to consistently use "base class", "subclass", and "inheritance"; but I may slip up from time to time.)
I find that it's usually easier to analyze requirements in terms of classes of objects, not specific objects themselves. So even though I say we're going to identify domain objects, we're really going to look at domain classes more than objects. (I apologize if my terminology is confusing, but it's a habit I find hard to break.)
But what defines a class? Well, UML defines four basic parts to a class:
- Name. This part is obvious: what do we call the class (as distinct from individual objects of the class)?
- Attributes. What are the characteristics that describe objects of the class, and that may help us to distinguish one object from another? In our Dog example above, breed, sex, height, weight, coat, color, age, and name are all attributes.
- Operations. What are the things that all objects of the class can do? In our Dog example, all Dog objects can hunt and play and bark.
- Relations. How do individual objects relate to each other? How does the entire class relate to other objects and classes? A Dog object can have one or more Owner objects (and vice versa, trust me). Inheritance is an example of a relationship between two classes.
Brainstorming About Domain Objects
So now that we're all on the same page regarding domain objects, we can start identifying them. As with actors, if I'm completely new to a problem domain, I won't try to identify a lot of domain objects up front. Instead, I'll go straight to identifying use cases (the subject of our next installment), and then see if any domain objects are discovered through the use cases (as we'll see, possibly in installment 3, possibly installment 4 — I don't have a firm outline yet). I use the use cases partly as an exploratory mechanism, helpng me to explore and learn an unfamiliar domain. (I explain this approach in UML Applied.)
But when you know something about the problem domain, it may be easier to start by brainstorming and listing candidate domain actors. And as I explained in the last installment, I know a fair amount about comic stores! So I'm pretty comfortable in identifying and describing a lot of domain objects. As with the candidate actors from installment 1, this list won't be perfect: I'll miss a lot of domain objects, and I'll list some that we'll end up never needing. But this list is just a starting point for discussion.
So with a little thought, I came up with the domain objects shown in Figure 9:

Figure 9: YCS Domain Objects
The standard UML symbol for an actor is a three-compartment rectangle. The top compartment lists the name, the middle compartment lists the attributes, and the bottom compartment lists the operations. In Figure 9, I also drew some relations between classes, which I'll add to as my domain knowledge evolves.
Note that the domain objects in Figure 9 don't appear in any particular order, as should be expected from brainstorming. These domain objects are described below:
- Action Figure. A plastic, metal, or plush figure, usually of a character from some Comic Book or other Book. Often partly or fully articulated. (Don't ever call them "dolls" if you want to get out of the store without a lecture!)
- Board Game. A Game in which the rules and actions involve moving pieces or counters around a board.
- Book. A single volume publication consisting primarily of text, usually paperback or hardbound.
- CCG. a.k.a. Collectible Card Game.
- Comic Book. A single volume publication consisting primarily of fully illustrated stories (with text as only a secondary element), usually bound in glossy paper or card stock. A single Comic Book may tell all or part of a story.
- Comic Series. A continuing, regularly published series of Comic Books (i.e., numbered "Issues") that involve a common theme, common characters, or common creators.
- Customer. A person who buys Comic Books, Books, Games, or other merchandise at the store. (See below for more discussion of Customer.)
- Customer Order. An Order placed by a Customer to purchase various merchandise.
- Distributor. In most cases, comic stores do not deal directly with individual vendors. Instead, they work Distributors who research and buy from vendors and then solicit orders from the stores.
- Distributor Order. A merchandise order that the store places with the Distributor.
- Employee. This object represents the information that is known about a particular Employee. (See below for more discussion of Employee.)
- Game. A product which allows one or more players to compete against each other or against a set of challenges, all according to a set of rules.
- Game Calendar. A calendar of upcoming Game Events.
- Game Event. A scheduled playing session at which one or more players will play one or more Games.
- Graphic Novel. A single volume publication consisting primarily of fully illustrated stories (with text as only a secondary element), usually bound in hard back or heavy card stock. A single Graphic Novel usually tells one complete story, and usually contains more pages on higher quality paper stock than a typical Comic Book.
- Magazine. A single volume publication consisting primarily of ads, illustrations, stories, articles, and editorials, all of which involve a common theme, common topics, or common creators. Most Magazines are periodicals (with a regular publication schedule), but some are special editions. A magazine is usually bound in and printed on glossy paper.
- Payable Account. An account of funds that the store owes (usually to a vendor, a Distributor, or an Employee).
- Receivable Account. An account of funds that the are owed to the store (usually by a Customer).
- Release Calendar. The schedule of when particular merchandise is expected to arrive in the store.
- RPG. a.k.a. Role Playing Game. A Game in which the rules and actions involve players telling an interactive story in a setting and plot devised by a gamemaster.
- Subscription. A request by a Customer to purchase in advance every issue of a Comic Series or a Magazine.
- Supplement. A Game that does not stand on its own, but rather adds additional rules and options to some other Game.
- Supplies. Merchandise such as counters, dice, comic bags, and other materials which may be used with a Game or Comic Book or other merchandise, but which would usually not be of interest to anyone who hadn't purchased said merchandise (i.e., most people have no use for comic bags unless they buy Comic Books to put in them).
- Time Sheet. A record of the hours an Employee worked.
- Trade Paperback. A single volume publication that collects a number of issues of a Comic Book, usually bound in hard back or heavy card stock. The material contained is not original, but a Trade Paperback is otherwise very much like a Graphic Novel. A single Trade Paperback usually tells one complete story, and usually contains more pages on higher quality paper stock than a typical Comic Book.
- Video Game. A game played by one or more players on a computer or a game console.
- Work Calendar. A schedule of hours to be worked by various Employees.
Note that two of these classes, Customer and Employee, have the same namea as actors from Installment 1. These objects represent the information we know about those actors, not the actors themselves. You may find it confusing that the actors and the classes have the same names. I do, too, honestly, so my usual practice would be to call these "records": Customer Record and Employee Record. But to some people, record = database = design, and they jump back to the That’s Design, Not Analysis antipattern. So when I think that might disturb them, I avoid the phrase "record". In retrospect, I'm feeling that the name confusion is every bit as bad as That’s Design, Not Analysis; so maybe a better choice would be Customer Info and Employee Info. "Info" is such a nice, vague word that no one can really mistake it for a design decision. So I'll switch to those terms as we move forward.
Relating and Organiing Domain Objects
To repeat: the domain objects in Figure 9 appear in a scattershot stream-of-consciousness order, with little thought about how particular domain objects might relate to each other. And just as with the actors in Installment 1, it will be useful to organize the domain objects into packages and also to expand upon the relations between them. So I'll start by subdividing the domain objects into the packages shown in Figure 10:

Figure 10: YCS Domain Object Packages
Accounting Objects
We'll look at each of these packages in more detail below, starting with the easiest: Accounting. This package's contents are shown in Figure 11:

Figure 11: YCS Accounting Objects
In this diagram, I added a new class, Account, to represent characteristics and behavior that are common to both Payable Accounts and Receivable Accounts. I also added two classes found in the Parties package but related to classes in this package: Employee Info and Party (discussed under the Parties package below). I drew these two classes in dark red to make them stand out, as a way to indicate that they're external to this package.
There are two kinds of relationship shown in Figure 11:
- Generalization. As above. Shown with a triangle-headed arrow.
- Association. Shown with a line or arrow, this relationship between two classes indicates that the classes collaborate in some way. You should prefer a line when the two classes interact freely. You should prefer an arrow when one class controls or "owns" the interactions. In Figure 11, for example, there are navigable association from Payables Account and Receivables Account to Party, indicating that the accounts are Paid To or Owed By particular Parties. There is also a simple association between Time Sheet and Employee Info.
(Other types of relations are possible, as we'll see in future installments of Everyday UML.)
Note also that I added specific attributes and operations to some of the classes: an Account has a Balance, and you can Deposit or Withdraw funds (in specific Amounts) or transfer them to another Account; and a Time Sheet indicates the Hours Worked. But I didn't add any attributes or operations to the other classes. In part, this represents that I simply haven't thought through those other classes yet. But it also reflects an important UML practice: not every detail you know appears in every diagram. I called this The Model Rule in UML Applied:
We saw The Model Rule in chapter 1; but it bears repeating. To use UML effectively, you should never be simply drawing pretty pictures; you should always be editing an underlying model, using the pretty pictures as your user interface. Thus, the model should contain more information than is displayed in any one diagram; and information in one diagram should not explicitly contradict information in another diagram. Information that is found in one diagram but not in another should not be considered a contradiction. Rather, this simply indicates that the former diagram displays more detail than the latter. Details may be omitted from a given diagram to make it more comprehensible.
But how do you keep these diagrams consistent with each other? How do you maintain the underlying model? This is where a good modeling tool proves its worth: a good modeling tool will maintain the model as you create and edit your diagrams. If you are not using some sort of modeling tool, this very mechanical burden will fall on you, rather than on the machine. That’s a poor division of labor: brains should do brain work and machines should do mechanical work. If you do the mechanical work, you will do it imprecisely and inefficiently, and you’ll have no time for brain work.
Note the plus sign (+) in front of the attributes and operations in Figure 11. This indicates visibility, a concept which has a lot of design and code implications, but can be summarized pretty simply: the visibility of an attribute or operation indicates where it can be seen and used. Public visibility (+) means an attribute can be read and changed by any part of the system, or an operation can be requested by any part of the system. Private visibility (-) means an attribute can only be read and changed by the class that defines it, or an operation can be requested by the class that defines it. And protected visibility (#) is like private, but the attribute or operation is also visible to all subclasses of the class that defines it. For analysis work, public visibility is the most common, and you shouldn't worry too much about visibility concerns.
Calendar Objects
The contents of the Calendars package are shown in Figure 12:

Figure 12: YCS Calendar Objects
As in Figure 11, Figure 12 indicates an external class (Game) in dark red. I also added attributes to the Game Event class, and I indicated that a Game Calendar contains zero to many (0..*, in UML notation) Game Events.
But the largest addition in Figure 12 is the two added base classes: Schedule and Chronology. These are based on the Chronologies pattern from Requirements Patterns and Antipatterns. Here's a brief excerpt:
Start with an Event class. It should have attributes that describe an event, and that distinguish one event from other similar events. Some of these attributes might include a name, a description, and start and end times for the event. You might also want to indicate whether the event is recurrent (and if so, on what interval) and also whether the event has been completed or not. And you may want your Events to be able to issue notices when they’re due. Event may also be a base class, from which you derive more specific event types. And Event objects may relate to other Event objects. For example, an appointment Event might involve one or more reminder events that remind the user that the appointment will soon occur.
Next, add a class, Chronology, that represents a list of events. It should include operations to add and remove Events. This general class contains Events both past and future. You may also want to add specific Schedule and History subclasses to represent future and past event lists. If you want to maintain both historical and planned events, then your Schedule class should include an operation to complete an Event and move it into a specific History.
Given that excerpt, it makes sense to add an Event base class, modifying Figure 12 to look like Figure 13:

Figure 13: YCS Calendar Objects (Revised)
The change from Figure 12 to Figure 13 is an example of applying a pattern. Again, from Requirements Patterns and Antipatterns:
So putting the two definitions [of "pattern"] together, we see that patterns are a little bit of art and a little bit of science. The science part comes in as three tasks:
- Discovery. Finding some best practice, and recognizing that it is common enough to be worthy of documenting as a pattern.
- Cataloguing. Documenting a number of patterns in detail, including how to recognize them, how to apply them, and even when not to apply them.
- Study. Learning to recognize the patterns, and understanding them well enough that they become part of your nomenclature.
Then the art part comes in when you apply the patterns. You have to learn how to speak in terms of the patterns, how to see where they fit, and how to apply them. It takes a good eye to see the opportunities that patterns create for you; but when you do, they will save you a lot of effort, because they will give you a lot of basic, common, starting ideas without you having to invent those ideas yourself. That will leave your brain free to focus on the aspects that are unique to your problem and your team.
I like to tell students that good patterns let them walk into a new project with some great ideas "in their back pockets", ready to pull out as soon as they see a need. You can apply a lot of established wisdom by building on patterns (where appropriate). We'll see more pattern usage ahead, in both this and future installments.
Party Objects
The contents of the Parties package are shown in Figure 14:

Figure 14: YCS Party Objects
In this package, we see more detail on the Party class that was introduced in Figure 11. This is based on the Party pattern from Martin Fowler, as described in Analysis Patterns : Reusable Object Models. This is a pattern that abstracts out the common characteristics or people and organizations into a base class, Party. A Person, then, is a subclass of Party that represents an individual; and an Organization is a subclass of Party that represents a group of Parties. Person and Organization then serve as base classes for our existing classes: Employee Info, Customer Info, and Distributor Info.
Besides the Party pattern, Figure 14 is also based on the Contact Info minipattern from Requirements Patterns and Antipatterns, in which a single Party can have multiple types of Contact Info, a base class with subclasses that represent different ways a Party might be contacted.
Order Objects
The contents of the Orders package are shown in Figure 15:

Figure 15: YCS Order Objects
I added the base class, Order, as well as a Line Item class to represent items in an order. The Order is placed by a particular Party. (The upper part of the diagram is a simplification of the Orders pattern from Requirements Patterns and Antipatterns.)
I also changed Subscription to be a subclass of Customer Order, one which references a particular Periodical to which the customer subscribes. (The Periodical class is described below.)
Merchandise Objects
The top-level of the Merchandise package are shown in Figure 16:

Figure 16: YCS Merchandise Objects
I added a base class, Merchandise, to represent things sold at YCS. I also added a subclass, Publication, to represent printed Merchandise.
Game Objects
The contents of the Games package are shown in Figure 17:

Figure 17: YCS Game Objects
Publication Objects
The contents of the Publications package are shown in Figure 18:

Figure 18: YCS Publication Objects
I added a Periodical class to represent a scheduled release of issues of some Publication. A Comic Series, then, is a subclass of Periodical; but after a little thought, I decided that a Magazine is also a subclass of Periodical, and it is individual Magazine Issues (a new class) that are published on the schedule.
Note also that I show a new UML relation in Figure 18: dependence, shown as a dashed arrow. While an association (either navigable or not) indicates some structural or functional connection between two classes, dependence indicates a simple "awareness" from one class to another. In Figure 18, we have an association from Periodical to Publication, indicating that a Periodical will consist of some number of Publications. So it would be redundant and even possibly confusing to also have an association from Comic Series to Comic Book, or from Magazine to Magazine Issue. Instead, I redrew those relations as dependence, indicating that a Comic Series "knows about" the Comic Books that make it up, and a Magazine "knows about" its individual issues. (We'll see more about dependence in future installments of Everyday UML.)
Other Merchandise Objects
Although this won't add much of interest, the contents of the Other Merchandise package are shown in Figure 19 for the sake of completeness:

Figure 19: YCS Other Merchandise Objects
What's Next?
In my next installment of Everyday UML, we'll finally get to some use cases. I can't give a schedule for that, so keep your eyes open!
Related Posts (on one page):
- Everyday UML, Installment 2: Identifying and Organizing Domain Objects
- Everyday UML, Installment 1: Identifying and Organizing Actors
Objects and Classes
In our last installment, we identified and organized actors, the people and systems with which Your Comic Source will interact. Then I promised that in this installment, we'd identify and organize examples of our second UML concept: domain objects, the information and things that are of interest to the actors and that are affected by the things they do.
Now when I said "objects" above, some of you ran screaming from the room, thinking, "Oh, no, that means object-oriented programming! That's hard!" Well, personally, I think that "objects are hard" is very much old-school thinking. Literally old-school: the object-oriented (OO) approach is a hard transition for programmers who have mastered and adjusted to functional or structured programming. But in my experience, it's actually easier to teach new programmers using OO, because it's a more natural match to how we think and speak about the world.
And when I said "objects" above, others of you shook your heads in disapproval, thinking, "Oh, no, that means object-oriented programming! That means design and code. It's too early for that." There is a tendency to think:
objects = classes = code (Wrong!)
As I argue in my book and in my classes, objects are not just a code construct. Objects are everywhere, becuase they're just things and concepts in the world around us (and thus in the problem domain). Really, the proper formulation is simply this:
objects = nouns (Right!)
Objects are things. The actors and customers and end users are concerned about and work with things. Therefore, actors and customers and end users are concerned about and work with objects. And therefore, objects are an essential part of analysis, not just design and code.
But above, I also mentioned classes. "Aha!" cry the nitpickers. "Now classes are code! And it's too early for code. We told ya so!"
And again, I have to disagree. "Class" is really just another name for "category" or "kind" or "type" (though "type" also has code connotations). It just means a grouping of very similar objects that can be described in similar traits and terms. "Dog" is a class; Betsy, Bluebell, Jake, Radar, and Frosty are particular objects of the class Dog. They differ by many characteristics — breed, sex, height, weight, coat, color, age, and name being the main ones — but they're all Dogs just the same. Meanwhile, Gomer — who has a breed, a sex, a height, a weight, a coat, colors, an age, and a name — is fundametally not a Dog. He's of class Cat. We recognize Dog and Cat as different categories, even though it might be convenient to lump them together in the code.
So while it's true that OO programming languages have a concept called classes, it's not true that classes = code. Classes are a useful part of our analysis model, too. (Insisting that objects = code or classes = code is an example of the That’s Design, Not Analysis antipattern, as I discuss in Requirements Patterns and Antipatterns.)
But categories can themselves be grouped into categories. Or to speak in OO terms, a class can have a base class (or sometimes called a superclass, or a general class, or a parent class, or a number of different synonyms based on the speaker's programming language and habits) that describes common characteristics shared with other classes. For example, Dog and Cat have a base class of Mammal; and it's in Mammal that we describe the characteristics of breed, sex, height, weight, coat, color, age, and name. Because those characteristics are part of Mammal, they are implicitly part of Dog and Cat.
And just as a class can have a base class, it can have multiple subclasses (or sometimes called a derived classes, or a general class, or a child class, or other synonyms) that add more specific characteristics and details. The relationship between base class and subclass is sometimes called "inheritance", because the subclass inherits characteristics from the base class. The relationship is also sometimes called "specialization", because the subclass is a more specialized form of the base class. And in "official" UML parlance, the relationship is called "generalization", because the base class is a more general form of the subclass. (I really must apologize for all these different synonyms. They arose through different branches of OO evolution, and we're just kinda stuck with them. I'll try to consistently use "base class", "subclass", and "inheritance"; but I may slip up from time to time.)
I find that it's usually easier to analyze requirements in terms of classes of objects, not specific objects themselves. So even though I say we're going to identify domain objects, we're really going to look at domain classes more than objects. (I apologize if my terminology is confusing, but it's a habit I find hard to break.)
But what defines a class? Well, UML defines four basic parts to a class:
- Name. This part is obvious: what do we call the class (as distinct from individual objects of the class)?
- Attributes. What are the characteristics that describe objects of the class, and that may help us to distinguish one object from another? In our Dog example above, breed, sex, height, weight, coat, color, age, and name are all attributes.
- Operations. What are the things that all objects of the class can do? In our Dog example, all Dog objects can hunt and play and bark.
- Relations. How do individual objects relate to each other? How does the entire class relate to other objects and classes? A Dog object can have one or more Owner objects (and vice versa, trust me). Inheritance is an example of a relationship between two classes.
Brainstorming About Domain Objects
So now that we're all on the same page regarding domain objects, we can start identifying them. As with actors, if I'm completely new to a problem domain, I won't try to identify a lot of domain objects up front. Instead, I'll go straight to identifying use cases (the subject of our next installment), and then see if any domain objects are discovered through the use cases (as we'll see, possibly in installment 3, possibly installment 4 — I don't have a firm outline yet). I use the use cases partly as an exploratory mechanism, helpng me to explore and learn an unfamiliar domain. (I explain this approach in UML Applied.)
But when you know something about the problem domain, it may be easier to start by brainstorming and listing candidate domain actors. And as I explained in the last installment, I know a fair amount about comic stores! So I'm pretty comfortable in identifying and describing a lot of domain objects. As with the candidate actors from installment 1, this list won't be perfect: I'll miss a lot of domain objects, and I'll list some that we'll end up never needing. But this list is just a starting point for discussion.
So with a little thought, I came up with the domain objects shown in Figure 9:

Figure 9: YCS Domain Objects
The standard UML symbol for an actor is a three-compartment rectangle. The top compartment lists the name, the middle compartment lists the attributes, and the bottom compartment lists the operations. In Figure 9, I also drew some relations between classes, which I'll add to as my domain knowledge evolves.
Note that the domain objects in Figure 9 don't appear in any particular order, as should be expected from brainstorming. These domain objects are described below:
- Action Figure. A plastic, metal, or plush figure, usually of a character from some Comic Book or other Book. Often partly or fully articulated. (Don't ever call them "dolls" if you want to get out of the store without a lecture!)
- Board Game. A Game in which the rules and actions involve moving pieces or counters around a board.
- Book. A single volume publication consisting primarily of text, usually paperback or hardbound.
- CCG. a.k.a. Collectible Card Game.
- Comic Book. A single volume publication consisting primarily of fully illustrated stories (with text as only a secondary element), usually bound in glossy paper or card stock. A single Comic Book may tell all or part of a story.
- Comic Series. A continuing, regularly published series of Comic Books (i.e., numbered "Issues") that involve a common theme, common characters, or common creators.
- Customer. A person who buys Comic Books, Books, Games, or other merchandise at the store. (See below for more discussion of Customer.)
- Customer Order. An Order placed by a Customer to purchase various merchandise.
- Distributor. In most cases, comic stores do not deal directly with individual vendors. Instead, they work Distributors who research and buy from vendors and then solicit orders from the stores.
- Distributor Order. A merchandise order that the store places with the Distributor.
- Employee. This object represents the information that is known about a particular Employee. (See below for more discussion of Employee.)
- Game. A product which allows one or more players to compete against each other or against a set of challenges, all according to a set of rules.
- Game Calendar. A calendar of upcoming Game Events.
- Game Event. A scheduled playing session at which one or more players will play one or more Games.
- Graphic Novel. A single volume publication consisting primarily of fully illustrated stories (with text as only a secondary element), usually bound in hard back or heavy card stock. A single Graphic Novel usually tells one complete story, and usually contains more pages on higher quality paper stock than a typical Comic Book.
- Magazine. A single volume publication consisting primarily of ads, illustrations, stories, articles, and editorials, all of which involve a common theme, common topics, or common creators. Most Magazines are periodicals (with a regular publication schedule), but some are special editions. A magazine is usually bound in and printed on glossy paper.
- Payable Account. An account of funds that the store owes (usually to a vendor, a Distributor, or an Employee).
- Receivable Account. An account of funds that the are owed to the store (usually by a Customer).
- Release Calendar. The schedule of when particular merchandise is expected to arrive in the store.
- RPG. a.k.a. Role Playing Game. A Game in which the rules and actions involve players telling an interactive story in a setting and plot devised by a gamemaster.
- Subscription. A request by a Customer to purchase in advance every issue of a Comic Series or a Magazine.
- Supplement. A Game that does not stand on its own, but rather adds additional rules and options to some other Game.
- Supplies. Merchandise such as counters, dice, comic bags, and other materials which may be used with a Game or Comic Book or other merchandise, but which would usually not be of interest to anyone who hadn't purchased said merchandise (i.e., most people have no use for comic bags unless they buy Comic Books to put in them).
- Time Sheet. A record of the hours an Employee worked.
- Trade Paperback. A single volume publication that collects a number of issues of a Comic Book, usually bound in hard back or heavy card stock. The material contained is not original, but a Trade Paperback is otherwise very much like a Graphic Novel. A single Trade Paperback usually tells one complete story, and usually contains more pages on higher quality paper stock than a typical Comic Book.
- Video Game. A game played by one or more players on a computer or a game console.
- Work Calendar. A schedule of hours to be worked by various Employees.
Note that two of these classes, Customer and Employee, have the same namea as actors from Installment 1. These objects represent the information we know about those actors, not the actors themselves. You may find it confusing that the actors and the classes have the same names. I do, too, honestly, so my usual practice would be to call these "records": Customer Record and Employee Record. But to some people, record = database = design, and they jump back to the That’s Design, Not Analysis antipattern. So when I think that might disturb them, I avoid the phrase "record". In retrospect, I'm feeling that the name confusion is every bit as bad as That’s Design, Not Analysis; so maybe a better choice would be Customer Info and Employee Info. "Info" is such a nice, vague word that no one can really mistake it for a design decision. So I'll switch to those terms as we move forward.
Relating and Organiing Domain Objects
To repeat: the domain objects in Figure 9 appear in a scattershot stream-of-consciousness order, with little thought about how particular domain objects might relate to each other. And just as with the actors in Installment 1, it will be useful to organize the domain objects into packages and also to expand upon the relations between them. So I'll start by subdividing the domain objects into the packages shown in Figure 10:

Figure 10: YCS Domain Object Packages
Accounting Objects
We'll look at each of these packages in more detail below, starting with the easiest: Accounting. This package's contents are shown in Figure 11:

Figure 11: YCS Accounting Objects
In this diagram, I added a new class, Account, to represent characteristics and behavior that are common to both Payable Accounts and Receivable Accounts. I also added two classes found in the Parties package but related to classes in this package: Employee Info and Party (discussed under the Parties package below). I drew these two classes in dark red to make them stand out, as a way to indicate that they're external to this package.
There are two kinds of relationship shown in Figure 11:
- Generalization. As above. Shown with a triangle-headed arrow.
- Association. Shown with a line or arrow, this relationship between two classes indicates that the classes collaborate in some way. You should prefer a line when the two classes interact freely. You should prefer an arrow when one class controls or "owns" the interactions. In Figure 11, for example, there are navigable association from Payables Account and Receivables Account to Party, indicating that the accounts are Paid To or Owed By particular Parties. There is also a simple association between Time Sheet and Employee Info.
(Other types of relations are possible, as we'll see in future installments of Everyday UML.)
Note also that I added specific attributes and operations to some of the classes: an Account has a Balance, and you can Deposit or Withdraw funds (in specific Amounts) or transfer them to another Account; and a Time Sheet indicates the Hours Worked. But I didn't add any attributes or operations to the other classes. In part, this represents that I simply haven't thought through those other classes yet. But it also reflects an important UML practice: not every detail you know appears in every diagram. I called this The Model Rule in UML Applied:
We saw The Model Rule in chapter 1; but it bears repeating. To use UML effectively, you should never be simply drawing pretty pictures; you should always be editing an underlying model, using the pretty pictures as your user interface. Thus, the model should contain more information than is displayed in any one diagram; and information in one diagram should not explicitly contradict information in another diagram. Information that is found in one diagram but not in another should not be considered a contradiction. Rather, this simply indicates that the former diagram displays more detail than the latter. Details may be omitted from a given diagram to make it more comprehensible.
But how do you keep these diagrams consistent with each other? How do you maintain the underlying model? This is where a good modeling tool proves its worth: a good modeling tool will maintain the model as you create and edit your diagrams. If you are not using some sort of modeling tool, this very mechanical burden will fall on you, rather than on the machine. That’s a poor division of labor: brains should do brain work and machines should do mechanical work. If you do the mechanical work, you will do it imprecisely and inefficiently, and you’ll have no time for brain work.
Note the plus sign (+) in front of the attributes and operations in Figure 11. This indicates visibility, a concept which has a lot of design and code implications, but can be summarized pretty simply: the visibility of an attribute or operation indicates where it can be seen and used. Public visibility (+) means an attribute can be read and changed by any part of the system, or an operation can be requested by any part of the system. Private visibility (-) means an attribute can only be read and changed by the class that defines it, or an operation can be requested by the class that defines it. And protected visibility (#) is like private, but the attribute or operation is also visible to all subclasses of the class that defines it. For analysis work, public visibility is the most common, and you shouldn't worry too much about visibility concerns.
Calendar Objects
The contents of the Calendars package are shown in Figure 12:

Figure 12: YCS Calendar Objects
As in Figure 11, Figure 12 indicates an external class (Game) in dark red. I also added attributes to the Game Event class, and I indicated that a Game Calendar contains zero to many (0..*, in UML notation) Game Events.
But the largest addition in Figure 12 is the two added base classes: Schedule and Chronology. These are based on the Chronologies pattern from Requirements Patterns and Antipatterns. Here's a brief excerpt:
Start with an Event class. It should have attributes that describe an event, and that distinguish one event from other similar events. Some of these attributes might include a name, a description, and start and end times for the event. You might also want to indicate whether the event is recurrent (and if so, on what interval) and also whether the event has been completed or not. And you may want your Events to be able to issue notices when they’re due. Event may also be a base class, from which you derive more specific event types. And Event objects may relate to other Event objects. For example, an appointment Event might involve one or more reminder events that remind the user that the appointment will soon occur.
Next, add a class, Chronology, that represents a list of events. It should include operations to add and remove Events. This general class contains Events both past and future. You may also want to add specific Schedule and History subclasses to represent future and past event lists. If you want to maintain both historical and planned events, then your Schedule class should include an operation to complete an Event and move it into a specific History.
Given that excerpt, it makes sense to add an Event base class, modifying Figure 12 to look like Figure 13:

Figure 13: YCS Calendar Objects (Revised)
The change from Figure 12 to Figure 13 is an example of applying a pattern. Again, from Requirements Patterns and Antipatterns:
So putting the two definitions [of "pattern"] together, we see that patterns are a little bit of art and a little bit of science. The science part comes in as three tasks:
- Discovery. Finding some best practice, and recognizing that it is common enough to be worthy of documenting as a pattern.
- Cataloguing. Documenting a number of patterns in detail, including how to recognize them, how to apply them, and even when not to apply them.
- Study. Learning to recognize the patterns, and understanding them well enough that they become part of your nomenclature.
Then the art part comes in when you apply the patterns. You have to learn how to speak in terms of the patterns, how to see where they fit, and how to apply them. It takes a good eye to see the opportunities that patterns create for you; but when you do, they will save you a lot of effort, because they will give you a lot of basic, common, starting ideas without you having to invent those ideas yourself. That will leave your brain free to focus on the aspects that are unique to your problem and your team.
I like to tell students that good patterns let them walk into a new project with some great ideas "in their back pockets", ready to pull out as soon as they see a need. You can apply a lot of established wisdom by building on patterns (where appropriate). We'll see more pattern usage ahead, in both this and future installments.
Party Objects
The contents of the Parties package are shown in Figure 14:

Figure 14: YCS Party Objects
In this package, we see more detail on the Party class that was introduced in Figure 11. This is based on the Party pattern from Martin Fowler, as described in Analysis Patterns : Reusable Object Models. This is a pattern that abstracts out the common characteristics or people and organizations into a base class, Party. A Person, then, is a subclass of Party that represents an individual; and an Organization is a subclass of Party that represents a group of Parties. Person and Organization then serve as base classes for our existing classes: Employee Info, Customer Info, and Distributor Info.
Besides the Party pattern, Figure 14 is also based on the Contact Info minipattern from Requirements Patterns and Antipatterns, in which a single Party can have multiple types of Contact Info, a base class with subclasses that represent different ways a Party might be contacted.
Order Objects
The contents of the Orders package are shown in Figure 15:

Figure 15: YCS Order Objects
I added the base class, Order, as well as a Line Item class to represent items in an order. The Order is placed by a particular Party. (The upper part of the diagram is a simplification of the Orders pattern from Requirements Patterns and Antipatterns.)
I also changed Subscription to be a subclass of Customer Order, one which references a particular Periodical to which the customer subscribes. (The Periodical class is described below.)
Merchandise Objects
The top-level of the Merchandise package are shown in Figure 16:

Figure 16: YCS Merchandise Objects
I added a base class, Merchandise, to represent things sold at YCS. I also added a subclass, Publication, to represent printed Merchandise.
Game Objects
The contents of the Games package are shown in Figure 17:

Figure 17: YCS Game Objects
Publication Objects
The contents of the Publications package are shown in Figure 18:

Figure 18: YCS Publication Objects
I added a Periodical class to represent a scheduled release of issues of some Publication. A Comic Series, then, is a subclass of Periodical; but after a little thought, I decided that a Magazine is also a subclass of Periodical, and it is individual Magazine Issues (a new class) that are published on the schedule.
Note also that I show a new UML relation in Figure 18: dependence, shown as a dashed arrow. While an association (either navigable or not) indicates some structural or functional connection between two classes, dependence indicates a simple "awareness" from one class to another. In Figure 18, we have an association from Periodical to Publication, indicating that a Periodical will consist of some number of Publications. So it would be redundant and even possibly confusing to also have an association from Comic Series to Comic Book, or from Magazine to Magazine Issue. Instead, I redrew those relations as dependence, indicating that a Comic Series "knows about" the Comic Books that make it up, and a Magazine "knows about" its individual issues. (We'll see more about dependence in future installments of Everyday UML.)
Other Merchandise Objects
Although this won't add much of interest, the contents of the Other Merchandise package are shown in Figure 19 for the sake of completeness:

Figure 19: YCS Other Merchandise Objects
What's Next?
In my next installment of Everyday UML, we'll finally get to some use cases. I can't give a schedule for that, so keep your eyes open!
Related Posts (on one page):
- Everyday UML, Installment 2: Identifying and Organizing Domain Objects
- Everyday UML, Installment 1: Identifying and Organizing Actors
Friday, August 5, 2005
An open letter to Borders Books:
First, let me make it absolutely clear that I love Borders. I've been shopping at your stores since 1981, back when you only had "store", not "stores". And I still maintain that your original store (now in a new location, of course) has the best selection of computer programming books in any brick-and-mortar store I've ever seen (and as a traveling UML and Tablet PC instructor, I see a lot of book stores — note how cleverly I met my shameless plug quota for this post). For Christmas one year, Mom and Dad gave me a $50 bill and a shove in the direction of Borders (and to show my age, that $50 netted me a grocery bag full of paperback books). I seldom visit Ann Arbor without a Borders visit. I'm a huge fan, despite your complete blindness to any Michigan market west of Ann Arbor (guys, open a Grand Rapids store already — and no, Waldenbooks stores don't count, since they don't have the same selection). And now you've added DVDs to their inventory, easily the best DVD selection I've seen anywhere. And you have TMobile Hotspots in many stores, and I'm a Hotspot member. And your staff has been knowledgeable and helpful, without fail. Heck, you even validate parking in downtown Ann Arbor, which is valuable in itself. I think it's safe to say that I'll always be a Borders customer, with or without a discount program.
Which is good news for you, since your discount program sucks.
To understand why, let's look at a discount program that doesn't suck: the Barnes & Noble Member Program. (And hey, Borders: B&N has six stores on my side of the state, three within 30 miles of my house. Guess who gets more of my money?) Here are the plan details: I pay them $25 per year, and I save 10% on nearly every item online at Barnes & Noble.com and in Barnes & Noble bookstores — including books, CDs, DVDs, bargain books, sale items, and everything in the store Café.
Now this very simple program has one down side: it's not free. But with my buying habits, it pays for itself multiple times over in a year. (OK, I'll be honest: sometimes it pays for itself in a single visit.)
Now here's the Borders program, Border's Rewards: I sign up (for free). Then, when I spend a combined total of $50 or more in one calendar month at Borders, Borders Express, or Waldenbooks, you'll reward me with a Personal Shopping Day. I can redeem that Personal Shopping Day within 30 days after it is issued. On that one day, I'll save 10% on almost everything in your stores, in as many visits and stores as I want. Every calendar quarter, I can earn another Personal Shopping Day. And you gave me one free when I signed up.
But wait, there's more! For each calendar month through October that I spend a combined total of $50 or more, 5% of my qualifying purchases accrue in my Holiday Savings Account. Once that reaches $10, I'll be awarded Holiday Savings in increments of $10 that I can use between November 15, 2005 and January 15, 2006. Also, I'll get exclusive email coupons and special offers. And I can manage my account online.
OK, let's start with the good parts: it's free; it's really easy for me to rack up $50 each month to qaulify for that Personal Shopping Day; and while I haven't tried it yet, the online account management sounds good in principle.
But after that, it's all down hill:
- I have to "qualify" for a discount. I don't just get it. Yes, it's easy for me to qualify, but it means I have to think about it when I'm shopping: "Hey, do I have a Personal Shopping Day or not?" With B&N, I know I'm saving money every time I walk in the door.
- Once I actually qualify for a Personal Shopping Day, I have to use it in 30 days, or it expires. Now that might be less of a problem if you had a store on my side of the state (and don't think I'm done complaining about that). But as it is, I'm pretty sure I've already lost one Personal Shopping Day, simply because I haven't been to Ann Arbor recently. Again, with B&N, my discount never expires, except for the annual renewal. And there, the B&N cashier helpfully reminds me that it has expired when I make my next purchase, offers to renew on the spot, and then immediately applies the discount to that purchase when I inevitably accept. Couldn't be simpler.
- It sounds great that your Personal Shopping Day applies to all visits to all stores on that day; but really, how many people will visit multiple Borders stores or make multiple visits to a single Borders store on a single day? All right, I'll admit it, I've done it. I've even made three visits (with purchases) to two stores in one day. But I've already proven that I'm an addict. The Borders Rewards program had no influence on my shopping that day. So will the casual shopper become a more committed customer due to this "benefit"? I doubt it.
- The Holiday Savings Account is, over all, a pretty good thing. But contrast it with the Suncoast Replay program. Replay isn't free; but they do issue you a reward certificate just for signing up, and those almost make up for the entry fee. And their reward certificates arrive all year long, not just during the holidays. On the whole, I appreciate theirs more, because the rewards show up in the mail more often. Think about it: their customers are pleasantly surprised and reminded of their store all year long; yours are pleasantly surprised only during the hectic holiday season.
- Exclusive email coupons and special offers? Please. You were sending me those (admittedly not as good) before I joined the program. And ya know what? I never, ever, ever remember to print those out and bring them with me. And why should I, honestly? This is the modern age of WiFi. A lot of your customers (me included) have our wireless devices with us; and you already have TMobile infrastructure in many of your stores. So why can't I use the coupons through my computer, somehow? I haven't figured out a good way, yet, but I can't solve all of your problems. Work on it!
- The Borders Rewards program doesn't apply to online purchases through Borders.com, which is actually a partnership with Amazon. Now it may well be that the Amazon pricing is better than the B&N discounted pricing; but it appears like you're taking something away.
- Your cashiers only seem to remind me about the program about 50% of the time. That's important, since I need to qualify for Personal Shopping Days. By contrast, B&N has never forgotten to ask about my card.
And finally, Borders Rewards is just too complicated. Even if by some calculation it's a better deal, people won't be able to follow it. My buddy Bill Heitzeg of Emerald Software, Inc. has done a lot of work with phone rating systems, and knows people who can find me a phone plan that, based on my unique personal calling habits, will give me the lowest possible bill; but the rules I'll have to follow and the hoops I'll have to jump through are more than I can keep straight, so I (and customers like me) go with simple plans from big names like AT&T or SBC. Similarly, the Barnes & Noble plan is just simpler to understand. When plans are complicated, people worry that they're not getting everything they could get, and they suspect the company is pulling a fast one on them. That's not a way to build customer loyalty, which is the whole point of a discount program.
Sorry, guys, but you'll have to go back to the drawing board on this one.
Your loyal customer despite this mistake,
Martin L. Shoemaker
P.S. When are you going to open a Grand Rapids store?
UPDATE: Borders has politely responded to my open letter.
Thank you for contacting Borders Customer Care with your comments.
Feedback from valued customers like you is essential to us as it allows us to keep in touch with areas where we can improve our services. Your suggestion will be included in our regular reporting to our various departments and in information presented to the executives at Borders. While I cannot guarantee that a change will be made, we appreciate your sending us your ideas.
Thanks again for taking the time to write to us. If you should have any other thoughts on how we can improve the shopping experience at Borders stores, please don’t hesitate to share these with us.
Sincerely,
*******
Borders Customer Care
http://www.bordersstores.com
That's fair enough. I don't expect them to change their policies in response to one guy on a blog. I do, however, expect them to listen when customers speak, and think about it. They always have in the past, and they continue to do so now.
Now about that Grand Rapids store...
Dotfuscator and James Avery's book get a mention on Slashdot.
Speaking of books, Bill Wagner reviews Keith Brown's .NET Developer's Guide to Windows Security. "As I said at the top of this review, “The .NET Developer’s Guide to Windows Security” should be required reading for every .NET developer."
And speaking of James Avery, he got asked about blogs and RSS in a job interview this week. Hey, James, I hope that doesn't mean you'll take a new job out of town before I show up next month!
Tablet PC Buzz links to this Channel Insider report on unexpectedly high demands for the new ThinkPads, including the new ThinkPad Tablet PCs. "The ThinkPad Tablet has sold so fast since its introduction that Lenovo quickly ran out of stock and is now working to catch up, he said. The product, intended for vertical markets such as health care, has caught on in the mainstream marketplace, he said."
Howard Lovy takes a hiatus from his blogging hiatus to post outtakes from his Wired story on nanomedicine and cancer. These are parts that were cut for space, but they add nice depth to the overall article. I hope Mr. Lovy finds full-time employment soon, so that he can spare more time for blogging on nanotechnology.
Julie Lerman points out The Regulator, a regular expression testing and learning tool. RegEx has always frustrated me, since it seems to be very powerful yet is incredibly poorly documented. And no one seems to be able to recommend a good book on it. Instead, I hear, "Read chapter such-and-such from that O'Reilly book on SED," or something like that. The Regulator looks like a great help. Thanks, Julie! And thanks, Roy Osherove, for writing it. (Julie also experienced a tornado recently. We have a family friend who was trapped when her house was collapsed by a tornado, and I've had tornado-phobia my whole life. A post like Julie's will give me nightmares tonight. Thanks, Julie...)
Chris from PowerBlogs (my blog service provider; and yes, I'm very pleased with the service) reports that reports are working again. That will be good, because I haven't actually seen reports since I signed up. Now lest you think that's a complaint, I entirely understand the reasons why: Chris was away on his honeymoon; and unlike some people I know, he actually stayed away from tech for the duration. (Actually, judging by the timing, Chris was setting up my account somewhere right in the middle of last-minute wedding stuff.) I look forward to checking out the reports.
Sam Gentile posts on the power of blogs. "So what's the message? An investment in reading quality bloggers every day will increase your knowledge and make you a better Developer/Architect/Marketer, and also your own blog could do wonders for your career and exposure."
me: under a microscope (found via Eric Maino) struggles to balance school and work and like. At that age, I thought it would get so much simpler when I could drop school out of the mix. Sorry to tell ya, bud, but it only got more complicated. Keep working on your balancing skills. They'll serve you well.
Mike Swanson posts on the new WinFX, as well as other new stuff. Mike also bucks the trend in ironic, imaginative, and generally silly blog names, with "Michael Swanson's Blog". I respect that.
hack-a-day links to a robotic drum set that would make Herbie Hancock proud. (And if you don't get the allusion, you must not have spent the early 80s letting MTV rot your brain.)
Thom Robbins points out some new Sharepoint application templates. Some day, I'll understand what that means...
Patrick at The Tablet PC in Teaching & Learning asks about a tool for using Ink in IE. A commenter links to IE Ink 2004, which lets you Ink on any Web page and then save a local copy. I'll have to try that out. Patrick also points out a new Tablet PC commercial from Microsoft, aimed at the education market. This ad almost makes me want to go back to college!
UPDATE AND SHAMELESS PLUG: And And since there's Tablet PC information in this post, Richard Hale Shaw would have my hide if I didn't recommend our new Tablet PC BootCamp.
Related Posts (on one page):
- Seen around the tech blogs this week
- Seen around the tech blogs this week...
Wednesday, August 3, 2005
Wow. Just — wow.
This book isn't for everyone. I would like to think it's something a casual reader could pick up and enjoy, but I just don't believe it. There are too many cameo appearances by minor characters, appearances that won't make much sense unless you've read a small mountain of DC comics, particularly comics from the Silver Age (roughly speaking, the 60s and 70s).
But if you're a Silver Age fan, and especially if you miss alternate timelines and multiple Earths — wow.
This book has a simple premise: a trio of supervillains from the 31st century (Legion fans can guess who) decide that their troubles could all be reversed if they simply went back into the past, abducted the infant Kal El and the orphaned Bruce Wayne, and raised them as super enforcers who would rule the 21st century Earth in the service of their adoptive "parents". But from that simple premise, a wild ride ensues.
With the influence of the Kents and Alfred replaced by a vicious trio that includes a telepath who confounded their brains, Earth's two greatest champions of law and order become tyrants of order over all. As one of the last surviving heroes of what would be the Justice League in a different timeline, Wonder Woman assembles Uncle Sam and the Freedom Fighters (if you don't get the reference, you're kinda proving my point about Silver Age references) to battle Superman and Batman and try to restore the timeline. An accident with a time sphere ensues, and Superman and Batman are blasted into more alternate timelines: the post-Great Disaster world of Kamandi (more stuff from the Silver Age); a Gotham City where Jonah Hex, Cinnamon, Tomahawk, and other western and frontier heroes are modern day law enforcers (yet more Silver Age stuff); an Earth where Darkseid rules, along with the Superman from Kingdom Come and The Kingdom (modern age books, but books that were also tributes to the Silver Age, and that paved the way for this book); and an Earth where Thomas and Martha Wayne were never murdered, and thus Batman was never created, and thus his greatest foe was unopposed in his quest to conquer the Earth.
The story reaches its denouement at one of the iconic symbols of the DC Silver Age, the original Legion clubhouse. And it concludes with a tribute to the book that arguably closed the Silver Age. And when I read that conclusion, my reaction was: wow. Just -- wow. Prior to this, Jeph Loeb was an author whose name I recognized, and I kinda knew he did good work. After this, he's an author I'll search out on the comic racks.
It's hard to describe who the audience for this book is. It's too full of continuity to really make sense to the casual reader; but it also plays too fast and loose with the continuity to please those Continuity Cops who insist on trying to piece every single story into "one seamless tapestry".
Well, actually, there is sort of a description of the audience for this book. It's a one-word description: me.


