Presentation is loading. Please wait.

Presentation is loading. Please wait.

12/24/2015B.Ramamurthy1 Analysis and Design with UML: Discovering Classes Bina Ramamurthy.

Similar presentations


Presentation on theme: "12/24/2015B.Ramamurthy1 Analysis and Design with UML: Discovering Classes Bina Ramamurthy."— Presentation transcript:

1 12/24/2015B.Ramamurthy1 Analysis and Design with UML: Discovering Classes Bina Ramamurthy

2 12/24/2015B.Ramamurthy2 Introduction Purpose of this part is to transform the requirement analysis represented by the use- case diagram(s) to design diagrams using static analysis. The result of this phase is UML class diagrams consisting of classes and relationship among them. We will study techniques to discover classes and the UML notations for representing class diagrams.

3 12/24/2015B.Ramamurthy3 Topics for Discussion Classes, Responsibility, Collaboration (CRC) method for discovering classes and assigning responsibility. Class-based Analysis and Design: UML notations, class diagrams. Case Studies.

4 12/24/2015B.Ramamurthy4 CRC Card Method Although proponents of the object paradigm often say that identifying objects is a simple and intuitive process, a number of noted experts admit that this is not always true! … The solution is to use the CRC process to determine the classes necessary to the system as part of the design process for the application. CRC (classes, responsibility, and collaboration) cards can be used to visualize and test different class- based models during the design phase. It is a proven technique used and advocated by leading methodologists.

5 12/24/2015B.Ramamurthy5 CRC Card Class Name Responsibilities Collaborations

6 12/24/2015B.Ramamurthy6 CRC Card Example Weather Station 1.Select 24hr/Current 2.Set Date Time 3.Display Current 1.Temp(T) 2.Wind (W) 3.Pressure (P) 4.Humidity (H) 4.Display 24hours 1.Hi/Lo for (TWPH) 5.Display Trends in TWPH 6.Calibrate Responsibilities Collaborations User Interface(UI) Date Time Temp Wind Pressure Humidity Calibrator

7 12/24/2015B.Ramamurthy7 CRC Card: UserInterface UserInterface 1.Input date 2.Input time 3.Input selection 4.Display data Responsibilities Collaborators Keypad Display Temp Wind Pressure Humidity

8 12/24/2015B.Ramamurthy8 CRC Card: Keypad Keypad Responsibilities 1.Store date 2.Store time 3.Store selection Collaborators Date Time Selection

9 12/24/2015B.Ramamurthy9 CRC Card: Temperature Temperature Responsibilities 1.Measure and Record temperature 2.Determine and record Hi/Lo 3.Determine trend Collaborations T.Device StatDataBase Date Time

10 12/24/2015B.Ramamurthy10 Class Discovery The entries in the collaborations column are possible classes or non-software entities. In this case these are: UserInterface, Display, Tempertaure, Wind, Pressure, Humidity, StatDataBase, Selection, Date, Time, Keypad, Callibrator. The responsibility of designing one or more of these classes can be assigned to the members of the group who participated in this discovery process. On to relations among classes and class diagrams.

11 12/24/2015B.Ramamurthy11 Classes OO paradigm supports the view that a system is made up of objects interacting by message passing. Classes represent collection of objects of the same type. An object is an instance of a class. A class is defined by its properties and its behaviors. A class diagram describes the static view of a system in terms of classes and relationships among the classes.

12 12/24/2015B.Ramamurthy12 Discovering Classes (Alternative) Underline the nouns in a problem statement. Using the problem context and general knowledge about the problem domain decide on the important nouns. Design and implement classes to represent the nouns. Underline the verbs. Verbs related to a class may represent the behavior of the class.

13 12/24/2015B.Ramamurthy13 Examples Drawing package: Design a user interface for drawing various shapes: circle, square, rectangle. Football scores: Keep track of football score. General purpose counter: To keep of track of count for various applications. Library: Books, different categories of books, details of student borrower, library personnel.

14 12/24/2015B.Ramamurthy14 Summary We looked at Class Diagrams which is very important part of UML Model, perhaps the only model used in many design representation. We also looked at two methods for class discovery(/analysis): CRC Card Method and Nouns-Verbs. Class diagrams directly represent the implementation (code) classes and the relationship among them.


Download ppt "12/24/2015B.Ramamurthy1 Analysis and Design with UML: Discovering Classes Bina Ramamurthy."

Similar presentations


Ads by Google