Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.

Similar presentations


Presentation on theme: "Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1."— Presentation transcript:

1 Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1

2 Outline: 1.Some Points 2.What Is UML (& Object-Oriented Methodology)? 3.Why & How Is UML (& OO) Related to This Course? 4.Brief Review of OO 5.Brief Review of UML 2

3 3 1 Some Points 1.1 You got much much much more than you paid for 1.2 Things in SE are much much much easier said than done 1.3 Make friends and/or make a living (a degree in your case)?

4 4 2 What Is UML (& Object-Oriented Methodology)? UML: Unified Modeling Language UML is a standardized general-purpose modeling language. The standard is managed, and was created by, the Object Management Group (OMG). UML includes a set of graphic notations to create visual models of systems. Object-Oriented Methodology

5 5

6 6

7 7 3 Why & How Is UML (& OO) Related to This Course? 3.1 A new prototyping tool? 3.2 Big differences There is big differences between the traditional functional decomposition approach (or the SASD (Structured Analysis and Structured Design)) and the OO approach right from the beginning.

8 8 4 Brief Review of OO 4.1 OO key concepts Class Object instance of a class Message Identity every object is a different object Abstraction elimination of the irrelevant ==> essential

9 9 4.1 OO key concepts (cont’d) Classification Encapsulation information hiding and access control Inheritance to inherit means to reuse. multi or single Polymorphism different reactions by different levels of objects Persistence object outlives the process that created it

10 4.2 Advantages of OO approach Mimic the world Reuse Consistence/Traceability Seamless development process Progressively refine work rather than converting from one representation to another Incremental/Iterative development Flexibility: Easy to change, expand 10

11 5 Brief Review of UML 5.1 OO modeling objective To develop precise, concise, understandable, and correct models of the problem (modeling concepts, NOT implementation). Static (or Structural) view of a system model emphasizes the static structure of the system using objects, attributes, operations, and relationships. Dynamic (or Behavioral) view of a system model emphasizes the dynamic behavior of the system by showing collaborations among objects and changes to the internal states of objects. It is important to distinguish between the UML model and the diagrams of a system: A diagram is a partial graphic representation of a system's model. The model also contains documentation that drive the model elements and diagrams (such as written use cases). 11

12 5.2 Several OO modeling diagrams Several structure diagrams Class diagram: describes the structure of a system by showing the system's classes, their attributes, and the relationships among the classes. Composite structure diagram: describes the internal structure of a class and the collaborations that this structure makes possible. Object diagram: shows a complete or partial view of the structure of a modeled system at a specific time. Component diagram: describes how a software system is split up into components and shows the dependencies among these components. Package diagram: describes how a system is split up into logical groupings by showing the dependencies among these groupings. Deployment diagram: describes the hardware used in system implementations and the execution environments and artifacts deployed on the hardware. 12

13 5.2 Several OO modeling diagrams (cont’d) Several behavioral diagrams (cont’d) Activity diagram: describes the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control. State machine diagram: describes the states and state transitions of the system. Use case diagram: describes the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases. Interaction diagrams (a subset of behavioral diagrams): emphasize the flow of control and data in the system being modeled. Communication diagram: shows the interactions between objects or parts in terms of sequenced messages. They represent a combination of information taken from Class, Sequence, and Use Case Diagrams describing both the static structure and dynamic behavior of a system. 13

14 5.2 Several OO modeling diagrams (cont’d) Several behavioral diagrams (cont’d) Interaction diagrams (cont’d) Sequence diagram: shows how objects communicate with each other in terms of a sequence of messages. Also indicates the lifespans of objects relative to those messages. Timing diagram: a specific type of interaction diagram, where the focus is on timing constraints. 14 5.3 Class diagram (the only one briefed) Steps: Identify objects and classes Identify attributes of objects and associations Organize and simplify object classes using inheritance Verify that paths exist for likely operations

15 15 5.3 Class diagram (cont’d) Object: Physical entities: companies, people, I/O devices Concepts: flight, transaction, purchase, business process Attribute: a single characteristic (property, quality (adjective)) Operation: a behavior (function, transformation (verb)) Class: a set of objects with common properties (attributes) common behavior (operations) common relationships to other objects common semantics

16 16 5.3 Class diagram (cont’d) In-class exercise: Create a class list with attributes and operations for the following scenario: A student may take up to five courses in a semester. Each course may have as many as 30 students in each section. Each course has one section per semester. A class room can hold at most one course at a time. UML class diagram: Class Name Attributes Operations

17 17 5.3 Class diagram (cont’d) Class diagram example 1: Car speed direction Level of detail varies with level of abstraction: start with high abstraction

18 17 5.3 Class diagram (cont’d) Class diagram example 1: Car speed direction Refine with Types speed: Integer direction: Tuple Car

19 17 5.3 Class diagram (cont’d) Class diagram example 1: Car speed direction speed: Integer direction: Tuple Car +speed: Integer = 0; +direction: Tuple {readOnly} Refine with Visibility Defaults Properties Car

20 18 5.3 Class diagram (cont’d) Class diagram example 2: Employee Name: ID: SetName (string): void (Employee) Joe an instance of the Employee object.

21 19 5.3 Class diagram (cont’d) Class relationships: Aggregation (Comprises) Association A connection between two classes Generalization (Inheritance) An association that suggests that one class contains another. Destroying the "whole" does not destroy the parts Composition (Has) An association that suggests that one class contains another. The parts are destroyed with the "whole”.

22 20 5.3 Class diagram (cont’d) Class relationships example 1: Company Division 1 * Employee * 1

23 21 5.3 Class diagram (cont’d) Class relationships example 2: Customer Corporate Customer Private Customer The 2 subclasses inherit everything from the superclass Customer


Download ppt "Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1."

Similar presentations


Ads by Google