1 / 20

UML CLASS DIAGRAMS

UML CLASS DIAGRAMS. Basics of UML Class Diagrams. What is a UML class diagram? Imagine you were given the task of drawing a family tree. The steps you would take would be: Identify the main members of the family Identify how they are related to each other

anne
Download Presentation

UML CLASS DIAGRAMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UML CLASS DIAGRAMS

  2. Basics of UML Class Diagrams • What is a UML class diagram? Imagine you were given the task of drawing a family tree. The steps you would take would be: • Identify the main members of the family • Identify how they are related to each other • Find the characteristics of each family member • Determine relations among family members • Decide the inheritance of personal traits and characters

  3. Basics of UML Class Diagrams • A UML class diagram is similar to a family tree. • A class diagram consists of a group of classes and interfaces reflecting important entities of the business domain of the system being modeled, and the relationships between these classes and interfaces. • The classes and interfaces in the diagram represent the members of a family tree and the relationships between the classes are analogous to relationships between members in a family tree. • Interestingly, classes in a class diagram are interconnected in a hierarchical fashion, like a set of parent classes (the grand patriarch or matriarch of the family, as the case may be) and related child classes under the parent classes.

  4. Basics of UML Class Diagrams • Similarly, a software application is comprised of classes and a diagram depicting the relationship between each of these classes would be the class diagram. • By definition, a class diagram is a diagram showing a collection of classes and interfaces, along with the collaborations and relationships among classes and interfaces • A class diagram is a pictorial representation of the detailed system design • Now you now know what a class diagram is. But, how does a class diagram relate to the use case diagrams that that we learned before?

  5. Basics of UML Class Diagrams • When you designed the use cases, you must have realized that the use cases talk about "what are the requirements" of a system. • The aim of designing classes is to convert this "what" to a "how" for each requirement • Each use case is further analyzed and broken up into atomic components that form the basis for the classes that need to be designed

  6. Elements of a Class Diagram • A class diagram is composed primarily of the following elements that represent the system's business entities: • Class: A class represents an entity of a given system that provides an encapsulated implementation of certain functionality of a given entity. These are exposed by the class to other classes as methods • Apart from business functionality, a class also has properties that reflect unique features of a class. The properties of a class are calledattributes. • As an example, take a class named Student. • The Student class encapsulates student information such as student id #, student name, and so forth. Student id, student name, and so on are the attributes of the Student class. The Student class also exposes functionality to other classes by usingmethods such as getStudentName(), getStudentId(),

  7. Elements of a Class Diagram…. • A class is represented by a rectangle. The following diagram shows a typical class in a class diagram:

  8. Elements of a Class Diagram…. • Interface: An interface is a variation of a class. As we saw from the previous point, • a class provides an encapsulated implementation of certain business functionality of a system. An interface on the other hand provides only a definition of business functionality of a system. A separate class implements the actual business functionality. • An interface shares the same features as a class; in other words, it contains attributes and methods. The only difference is that that the methods are only declared in the interface and will be implemented by the class implementing the interface.

  9. Elements of a Class Diagram…. • Package: provides the ability to group together classes and/or interfaces that are either similar in nature or related. • Groupingthese design elements in a package element provides for better readability of class diagrams, especially complex class diagrams. Figure —a package

  10. Relationship Between Classes • The following table shows the kinds of relationships between classes, their notation, and what they mean

  11. Relationship Between Classes….

  12. The UML Class Diagram in ActionCase study—Courseware Management System •  In the use case lecture, we identified the primary actors and use cases in the use case model of the case study. • Let us recap the analysis that was performed when the use case model was designed. • The following terms and entities specific to the system were identified from the problem statement: • Courses and Topics that make up a course • Tutors who teach courses • Course administrators who mange the assignment of the courses to tutors • Calendar or Course Schedule is generated as a result of the Students who refer to the Course schedule or Calendar to decide which courses for which they wish to sign up

  13. The UML Class Diagram in Action….Case study—Courseware Management System • The potential actors of the system were: • Tutors • Course administrators • Students • And the use cases of the system were: • View courses • Manage topics for a course • Manage course information • View course calendar • View tutors • Manage tutor information • Assign courses to tutors

  14. The UML Class Diagram in Action….Identifying classes of the Courseware Management System • Identify the "active" entities in the system • So, our first list of classes in the system appears to be:  • Course administrators • Tutors • Students • Identify business domain ("passive") entities in the system • These entities reflect the business domain and hence are potential classes for our system.  • Courses • Topics that make up a course • Course calendar generated

  15. The UML Class Diagram in Action….Identifying classes of the Courseware Management System •  So, the list the list of classes and interfaces that we have identified in the Courseware Management System. • Course Administrator • Tutor • Student • Course • Topic • Course Calendar

  16. The UML Class Diagram in Action….Identifying methods of the Courseware Management System • The classes that we have identified for the Courseware Management System also providebusiness functionality related to the application • Example the courseadministrator class have the following functionality (methods):

  17. The UML Class Diagram in Action….Identifying methods of the Courseware Management System • Other classes have methods as shown in the figure below?

  18. The UML Class Diagram in Action….Identifying relationship and drawing the class diagram

  19. Other examples of Class Diagrams • Seminar Management System

  20. QUESTIONS

More Related