lasses are only the first step to understanding UML. In my last article
I discussed classes in UML and how they are coded using C#. In this article I will tie-up a few loose ends by describing how classes are arrived at and then march into how they relate to each other in UML using associations.
Setting the Stage with a Story
In software development methodology, stories are often used as a software metaphor; they are a narrative that is used to represent a conversation between the developer(s) and the customer. Stories owe their popularity to Extreme Programming and can be used as the basis for building UML classes and explaining how they relate. When using a story as the basis of your system, the first step is to convert the nouns in the story into UML classes. This will give scope to the system. As the story expands to include other stories, the new stories will map into different namespaces, each with its own scope.
In the last article I gave the example of RichMen Inc. It entailed a simple story about a brokerage firm that wanted a system to track what securities brokers bought and sold for their clients. Even with a story this simple I required three classesBroker, Client, and Securityto represent the nouns in the story. The classes were encapsulated in the package Brokerage, which represented the brokerage firm, and I added some CRUD. (CRUD stands for Create, Read, Update, and Delete; it represents the typical data operations.)
In almost every system, whenever there is data there is a database. In the system I'm developing for this article I will add a database to store the data from my three classes.