Creating Classes
Creating Classes is the very important step in creating UML diagrams. This is because it exponentially reduces the time you would require to model your diagrams. Study your problem statement and analyze it thoroughly. Identify the Classes . . .
There are 4 ways of identifying classes:
1. Noun Phrase Method
In this method you have to identify each and every noun in the problem statement and checklist it. Then try to eliminate them on the basis that they cannot become fully fledged classes; they are better as attributes of classes or that they are not required at all.
2. CRC - Class Responsibility Collaboration
In this method you draw a CRC as shown below. This would help you to determine the functions of the Classes and other Classes that are connected to this Class.
The left Column consist of the Class’ member functions and attributes and the right column consists of its relationships with other columns.
3. Use Case Driven
In this method you are expected to identify classes from use case scenarios. But in this case you will need to identify the scenarios first, which we will learn when we will see how to prepare a Use-Case Diagram.
4.Common Class Pattern Approach
This approach asks you to define Classes with fixed and universal functionalities. E.g. an ATM system Class in Banking Application. Various other patterns that may be defined are: Organization Class, People and Person, Devices, Places, etc.
The best and relatively simpler approach to identifying classes, we would suggest, is the ‘Noun Phrase Approach’.
Assuming that you have identified your Classes for your Problem Statement we should now see how to create a Class in Rational Rose, how to define its attributes, operations and functions, arguments and parameters, return type and relations with other Classes.