Presentation is loading. Please wait.

Presentation is loading. Please wait.

UML and its Use-Case Modeling Professor Chen School of Business Gonzaga University Spokane, WA 99258

Similar presentations


Presentation on theme: "UML and its Use-Case Modeling Professor Chen School of Business Gonzaga University Spokane, WA 99258"— Presentation transcript:

1 UML and its Use-Case Modeling Professor Chen School of Business Gonzaga University Spokane, WA 99258 chen@gonzaga.edu

2 UML (Use-Case Modeling), Dr. Chen TM -2 Methods vs. Modeling Languages n A model has its purpose of structuring our thoughts n A method –is an explicit way of structuring one’s thinking and actions –tells us: What to do How to do it When to do it Why it’s done

3 UML (Use-Case Modeling), Dr. Chen TM -3 Method, Modeling Language and Process METHOD = + Modeling Language PROCESS

4 UML (Use-Case Modeling), Dr. Chen TM -4 Process vs. Method n A process is a group of activities that, if done correctly, will achieve an explicit goal. n A method, in contrast, is normally also considered as a set of related activities, but without explicit goals, resources, and rules.

5 UML (Use-Case Modeling), Dr. Chen TM -5 What is a Process? Process Resources Documentation, Products, Models etc. Humans, computers tools, Information What to do, How to do it, When to do it, Why it should be done Rules > [VALUE]

6 UML (Use-Case Modeling), Dr. Chen TM -6 What is a Process? Process Resources Documentation, Products, Models etc. Humans, computers tools, Information What to do, How to do it, When to do it, Why it should be done Rules > [VALUE] Software Development: Process CONTEXT, USER, STEPS A process is a group of activities that, if done correctly, will achieve an explicit goal.

7 UML (Use-Case Modeling), Dr. Chen TM -7 What is the UML? n The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive systems. n UML is only a modeling language without a process –it is a lot easier to comprehend than a natural language

8 UML (Use-Case Modeling), Dr. Chen TM -8 What does UML give you? n The UML gives you a standard way to write a system’s blueprints covering conceptual things, such as business processes and system functions, as well as concrete thins, such as classes written in a specific programming language, database schemas, and reusable software components.

9 UML (Use-Case Modeling), Dr. Chen TM -9 How Applicable of UML? n The UML is applicable to anyone involved in the production, deployment, and maintenance of software.

10 UML (Use-Case Modeling), Dr. Chen TM -10 What is Visual Modeling? n VISUAL MODELING is a way of thinking about problems using (graphical) models organized around real-world idea. n UML is a product of VISUAL MODELING language.

11 UML (Use-Case Modeling), Dr. Chen TM -11 Models are useful for.. n understanding problems, n communicating with everyone involved with project (customer, domain experts, analysts, designers, etc.) n modeling enterprise, n preparing documentation, and n designing programs and databases

12 UML (Use-Case Modeling), Dr. Chen TM -12 Objectives of the Modeling Modeling promotes: n better understanding of requirements, n cleaner designs, and n more maintainable systems.

13 UML (Use-Case Modeling), Dr. Chen TM -13 What is a Good Model? A model is good when: Ê it is a relevant model Ë it is possible to communicate Ì it fits its purpose Í it captures the essentials

14 UML (Use-Case Modeling), Dr. Chen TM -14 System Boundary Use Case ACTOR (Role) Customer Statistics Sales Statistics Signing an insurance policy Figure: A Use-Cases Example

15 UML (Use-Case Modeling), Dr. Chen TM -15 Purposes of the Use-Case Modeling n What a new system should do n What an existing system already does

16 UML (Use-Case Modeling), Dr. Chen TM -16 What is an Actor? n An actor is a class not an instance. n It represents a role, not an individual user of the system. n primary vs. secondary actors –customer/user, developer, test teams vs. manager or board members n active vs. passive

17 UML (Use-Case Modeling), Dr. Chen TM -17 Return books Interlibrary loan Borrow books Library Member Figure: An Library Use-Cases Example Do research Read books, newspaper Purchase supplies Circulation Clerk Supplier

18 UML (Use-Case Modeling), Dr. Chen TM -18 Summary n Use-case modeling is a technique used to describe the functional requirements of a system n A use case is a set of sequence of actions performed in the system. n A scenario is an illustration or an example (instance) of a use case or collaboration. n An actor represents a role that an external entity (user, hardware) plays in interacting with the system.

19 UML (Use-Case Modeling), Dr. Chen TM -19 Insurance company Insurance contract Customer 10..* 1..* Figure 4.1: A simple mode of an insurance business. One insurance company has many (zero-to-many) insurance contracts. An insurance customer has many (zero-to-many) insurance contracts. An insurance contract is related to one insurance company. The insurance contract is related to many (one-to-many) insurance customers. The entities shown in the model are classes. Figure 4.1: A simple mode of an insurance business. One insurance company has many (zero-to-many) insurance contracts. An insurance customer has many (zero-to-many) insurance contracts. An insurance contract is related to one insurance company. The insurance contract is related to many (one-to-many) insurance customers. The entities shown in the model are classes.

20 UML (Use-Case Modeling), Dr. Chen TM -20 Figure 4.2 A Class in UML Attributes Operations Name

21 UML (Use-Case Modeling), Dr. Chen TM -21 Car registration number data speed direction Figure 4.3 A class car with the attributes registration number, data, speed, and direction. Attribute names typically begin with a lowercase letter

22 UML (Use-Case Modeling), Dr. Chen TM -22 Car registration number: String data: CarData speed: integer direction: Direction Figure 4.4 The car with typed attributes Invoice +amount : Real + date: Date + customer: String +specification: String -administrator: String Figure 4.5: A class with public and private attributes

23 UML (Use-Case Modeling), Dr. Chen TM -23 Invoice +amount : Real + date: Date=Current date + customer: String +specification: String -administrator: String=“Unspecified” Figure 4.6 A class with attributes and their default values

24 UML (Use-Case Modeling), Dr. Chen TM -24 Invoice +amount : Real +date: Date=Current date +customer: String -number_of_invoices: integer = 0 Figure 4.9 An Invoice class Public class Invoice { public double amount; public Date date = new Date(); public String customer; static private int number_of_invoices = 0; //Constructor, called every time an objects is created public Invoice () { // Other Initialization number_of_invoices++; //Increment the class attributes } // Other methods go here };

25 UML (Use-Case Modeling), Dr. Chen TM -25 Car + registration number: String + data: CarData + speed: integer + direction: Direction + drive (speed: integer, direction: Direction) + getData() : CarData Figure 4.10 The car has attributes and operations. The operation drive has two parameters, speed and direction. The operation getData has a return type, CarData.

26 UML (Use-Case Modeling), Dr. Chen TM -26 AuthorComputer Figure 4.15 An author uses a computer The author class has an association to the Computer class. Figure 4.15 An author uses a computer The author class has an association to the Computer class. Uses  Associations: Normal Association

27 UML (Use-Case Modeling), Dr. Chen TM -27 PersonCar 0..* Figure 4.16 A person owns many (zero-to-many) cars, A car can be owned by many (one-to-many) persons. Figure 4.16 A person owns many (zero-to-many) cars, A car can be owned by many (one-to-many) persons. 1..* Owns   Owned by

28 UML (Use-Case Modeling), Dr. Chen TM -28 PersonCar 0..* Figure 4.17 A navigable association says that a person can own many cars, but it does not say anything about how many people can own a car. Figure 4.17 A navigable association says that a person can own many cars, but it does not say anything about how many people can own a car. Owns

29 UML (Use-Case Modeling), Dr. Chen TM -29 Insurance company Insurance contract 10..* Customer 1..* Insurance policy Web Insurance policy 0..1  is expressed in an Expressed an  has   refer to has  refer to  Figure 4.18 A class diagram describing an insurance business Figure 4.18 A class diagram describing an insurance business

30 UML (Use-Case Modeling), Dr. Chen TM -30 Author name : String age: Integer 0..*1..* Computer name : String money: Integer Bob:Author name : String age: Integer 0..*1..* Bob’s PC COMPUTER name : String money: Integer Figure4.19 A class diagram and an object diagram and an example of the class diagram being instantiated

31 UML (Use-Case Modeling), Dr. Chen TM -31 Node Connects Recursive Association Figure 4.20 A network consists of many nodes connected to each other. Figure 4.20 A network consists of many nodes connected to each other. Person  married to

32 UML (Use-Case Modeling), Dr. Chen TM -32 Insurance contract Insurance company 10..*  refer to contracts  Figure 4.22 Insurance company has associations to Insurance contract Figure 4.22 Insurance company has associations to Insurance contract

33 UML (Use-Case Modeling), Dr. Chen TM -33 CarPerson Figure 4.24 What roles do Person and Car play in this association? Figure 4.24 What roles do Person and Car play in this association? Another example of Roles in Association  drives * * drivercompany car

34 UML (Use-Case Modeling), Dr. Chen TM -34 Person  married to wife husband Figure 4.25 A husband is married to a wife. Both husband and wife are people. If a person is not married, then he or she cannot play the role of husband or wife, which means that the married to association is no applicable. Figure 4.25 A husband is married to a wife. Both husband and wife are people. If a person is not married, then he or she cannot play the role of husband or wife, which means that the married to association is no applicable. Roles in Association

35 UML (Use-Case Modeling), Dr. Chen TM -35 Ready for the Next Run?

36 UML (Use-Case Modeling), Dr. Chen TM -36 Insurance contract 0..* Insurance policy 0..1  is expressed in an Expressed an  Insurance company 1has   refer to 1..*  has refer to  insurer Person policyholder husband  married to wife Figure 4.26 A class can play different roles in different associations. The model from Figures 4.18 and 4.25 are combined. In this model, a person can play the role of husband, wife, or policyholder. The insurance company plays the insurer role. Figure 4.26 A class can play different roles in different associations. The model from Figures 4.18 and 4.25 are combined. In this model, a person can play the role of husband, wife, or policyholder. The insurance company plays the insurer role. Roles in an Association

37 UML (Use-Case Modeling), Dr. Chen TM -37 File Directory file name * An example for Qualified Association File Directory * *

38 UML (Use-Case Modeling), Dr. Chen TM -38 Insurance contract 0..* Insurance company 10..* 1..* PersonCompany 1..* 0..* Figure 4.28 An insurance contract cannot have associations to both company and person at the same time Figure 4.28 An insurance contract cannot have associations to both company and person at the same time Or-Association

39 UML (Use-Case Modeling), Dr. Chen TM -39 Insurance contract 0..* Insurance company 10..* 1..* PersonCompany 1..* 0..* Figure 4.29 An or-association shows that only one of the associations is valid at a time Figure 4.29 An or-association shows that only one of the associations is valid at a time Or-Association or

40 UML (Use-Case Modeling), Dr. Chen TM -40 0..* 1..* Insurance contract Insurance company 1 0..* has   refer to insurer Results of Figures 4.26, 28, and 29: An insurance contract cannot have associations to both company and person at the same time Results of Figures 4.26, 28, and 29: An insurance contract cannot have associations to both company and person at the same time Company 0..* 1..* 0..*  has refer to  Person policyholder husband  married to wife 1..* Or-Association or

41 UML (Use-Case Modeling), Dr. Chen TM -41 Insurance contract 0..* Insurance company 1 1..* Person Figure 4.32 A ternary association connects three classes. Insurance policy 0..1 policyholder insurer

42 UML (Use-Case Modeling), Dr. Chen TM -42 TeamsPerson * Members Figure 4.34 A team is composed of team Members. One person could be a member of many teams. The model shows an example of a shared aggregation, where the people are the shared parts. Figure 4.34 A team is composed of team Members. One person could be a member of many teams. The model shows an example of a shared aggregation, where the people are the shared parts. *

43 UML (Use-Case Modeling), Dr. Chen TM -43 Window Text * Listbox * Button * Menu * Figure 4.36 The diamond shows the composition aggregate; the window contains ( is aggregated of) many menus, buttons, listboxes, and texts. All types of aggregation can have a name.

44 UML (Use-Case Modeling), Dr. Chen TM -44 Window Text * Listbox * Button * Menu * Figure 4.37 If there is more than one part in the same aggregate (wholeside into a single end.This is allowed for all types of aggregates. An aggregate has only one role name, and that is at the partside. Contains

45 UML (Use-Case Modeling), Dr. Chen TM -45 Vehicle CARBoatTruck Figure 4.41 Vehicle is a general class (superclass) derived to specific classes (subclasses) via inheritance (generalization-specialization).

46 UML (Use-Case Modeling), Dr. Chen TM -46 Vehicle CARBoatTruck Figure 4.42 The same model as in Figure 4.41, but the inheritance takes the form of a tree (with only one hollow triangle).

47 UML (Use-Case Modeling), Dr. Chen TM -47 Vehicle CAR BoatTruck Vehicle CAR BoatTruck Vehicle Figure 4.43 A class hierarchy for vehicles. The Car class is subclass to Vehicle, but superclass to Sports car, Passenger car, and Truck.

48 UML (Use-Case Modeling), Dr. Chen TM -48 Vehicle {abstract} Drive() {abstract} Car drive() Boat drive() drive() starts the wheels drive() starts thepropeller Figure 4.44 The Car inherits the attribute color and the operation drive. The operation drive is redefined in the class Car and Boat. The class Vehicle is abstract, which also is marked. The notes below the classes are used to comment on a class diagram Figure 4.44 The Car inherits the attribute color and the operation drive. The operation drive is redefined in the class Car and Boat. The class Vehicle is abstract, which also is marked. The notes below the classes are used to comment on a class diagram

49 UML (Use-Case Modeling), Dr. Chen TM -49 drives Vehicle {abstract} color drive() {abstract} Car drive() Boat drive() * Person Figure 4.45 A person drives vehicles.When the drive operation is called, the implementation used depended on whether the object used is a car or a boat. Vehicle is an abstract class showing the commonalties between cars and boats, including the association relationship to the Person class Figure 4.45 A person drives vehicles.When the drive operation is called, the implementation used depended on whether the object used is a car or a boat. Vehicle is an abstract class showing the commonalties between cars and boats, including the association relationship to the Person class

50 UML (Use-Case Modeling), Dr. Chen TM -50 Vehicle {abstract} drive() {abstract} Car drive() Boat drive() Propulsion Figure 4.47 Generalization-specialization with a discriminator that specifies that it is with respect to the propulsion that the subclass differ.

51 UML (Use-Case Modeling), Dr. Chen TM -51 Object vs. Function-Oriented Analysis and Design (Structured Analysis and Design) The Library Information system Object-oriented A/D Decomposed by objects or concepts Structured A/D Decomposed by functions or processes LibrarianCatalogue LibraryBook System Record Loans Add Resource Report Fines

52 UML (Use-Case Modeling), Dr. Chen TM -52 Figure: Conventional vs. Object - Oriented ConventionalObject-Oriented Decomposed by Functions/processObjects/concepts Types Data type (e.g.) int num_of_employees Class type class employee  … } employee full-time, part-time; Content One variable contains one value. e.g. number_of _employees =20 One class contains many objects One object has many attributes, operations


Download ppt "UML and its Use-Case Modeling Professor Chen School of Business Gonzaga University Spokane, WA 99258"

Similar presentations


Ads by Google