Class Diagrams: Basic Concepts / Finding Classes
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
Maybe you're wondering how to go about finding the classes that you'll model in your class diagrams, that's what this movie is about, finding, defining classes. A good way to get started is to review existing specifications including use cases if you have them and talk to business experts to find the entity classes. By an entity class we mean a class that defines the objects that are tracked by the business. So when we're talking about entity classes, usually we're talking about data. Now as you review those specifications and as you talk to experts on the business side you want to listen in particular for the nouns that they use. The nouns will help you later on start to define your classes and as you're listening for those nouns there are a few different kinds in particular that you want to watch for. These include tangible things, things that you can see or touch, things like an order, an invoice, timecard, paycheck or inventory. You also want to watch for roles, if you've done use cases you'll have identified a number of roles in identifying the actors in your use cases and roles can include customer, manager, customer service representative, shipper, data entry clerk and so on. Watch for incidents things that happen such as place order, cancel order, receive payment, ship order, again if you've done use cases a lot of the incidents will be the same as you're use cases. Keep an eye out for interactions of various kinds, sales receives order from customer or in a hospital system doctor treats patient. Also watch for specifications, when you're thinking about specifications think standards or government standards, things like dimension and capacity. Specifications will help you later on identify attributes and also constraints. So as I said watch for nouns and the reason for that is that nouns will help you identify classes, attributes and objects. You also want to listen for verbs, things that the nouns do or things that are done to the nouns are done with the nouns, verbs indicate operations, methods and relationships. So they also offer you useful information. Now as you go over the list of nouns that you've collected you'll probably notice that some people will use more then one noun to talk about the same thing. For example people might say worker and employee interchangeably. Other nouns may not have any bearing on the classes that you want to identify or the system you're designing. So you want to look through your list of nouns and start sorting it into what information is useful, what you want to keep and here's a checklist that will help you do that. Keep classes that represent physical objects, those tangible things, we were talking about earlier. You want to keep classes that represent conceptual entities you also want to keep classes that represent categories of classes, these can become super classes that will be useful for things like generalization. And finally keep classes that represent known interfaces to the world outside of the system. Here's a quick example in talking to personnel about a hotel and how it works you can start to identify the different classes that make up the hotel system. One of your basic classes is the room and that has attributes such as floor, type of bed, king, queen or double. Smoking or non smoking, maximum number of guests allowed and operations such as reserve check out, clean maintain and so on. In the conversion another class is identified, a child class that inherits from the room class and that's the suite class, the suite class has all of the attributes and operations of the room class but it adds a couple of attributes. Number of rooms since suites have more then one room and some of the suites have jacuzzi's. Also there are a number roles that come into play in the hotel system, we have the guest and the guest has attributes like name, home address, credit card, whether or not the guest is a gold club member which shows us we need a gold club class, and operations such as get reservation. We also have a number of classes of hotel employees such as clerk, maintenance staff and housekeeping staff. Over here we have a reservation class that has attributes such as confirmation number and operations such as submit, confirm and cancel. Our cancellation class has a cancellation number attribute and so on. Now as you talk to business experts you'll probably also hear business rules, policies, things like that, that will help you identify constraints and we've listed one here, cancellations must be before 3 pm on the date of arrival or else the guest is charged for one night. So you can collect things like constraints and make notes as you start to identify your classes. Now this is just a first step, you can probably in looking at this, you can probably think of other classes off the top of your head. Also as you move ahead in the development life cycle you'll be identifying classes that they don't even know about on the business side that will be necessary to the system. But reviewing specifications and talking to business experts is a good first step in helping you to identify the classes that you need.
Tutorial Information
| Course: | UML |
| Author: | Nancy Conner |
| SKU: | 33815 |
| ISBN: | 1-934743-23-2 |
| Release Date: | 2007-10-26 |
| Duration: | 7 hrs / 95 lessons |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 