2 Haziran 2013 Pazar

UML Class Diagrams

• Widely used to describe the types of objects in a system and their relationships
• Model class structure and contents using design elements such as classes, packages and objects
• Describe three different perspectives when designing a system; conceptual, specification, and implementation

• Classes  are composed of three components :



















Visibility

Use visibility markers to signify who can access the information contained within a class. Private visibility hides information from anything outside the class partition. Public visibility allows all other classes to view the marked information. Protected visibility allows child classes to access information they inherited from a parent



Multiplicity


Place multiplicity notations near the ends of an association. These symbols indicate the number of instances of one class linked to one instance of the other class.
 For example, one company will have one or more employees, but each employee works for one company only.



RelationShip (Dependency, Association, Aggregration and Composition)

















Generalization


A generalisation is a relationship between a more general element and a more specific element. Generalisation is a mechanism for structuring sets of classes with similar properties into general and specialised classes, as shown below in figure ;



Possible classification of Access Points according to logging and blocking functionality




Some of Class Diagram Examples 


Now the following diagram is an example of an Order System of an application. So it describes a particular aspect of the entire application.
  • First of all Order and Customer are identified as the two elements of the system and they have a one to many relationship because a customer can have multiple orders.
  • We would keep Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and NormalOrder.
  • The two inherited classes have all the properties as the Order class. In addition they have additional functions like dispatch () and receive ().
So the following class diagram has been drawn considering all the points mentioned above:




1 yorum: