1 / 23

Outline: Some Points What Is UML (& Object-Oriented Methodology)?

Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP. 1. Outline: Some Points What Is UML (& Object-Oriented Methodology)? Why & How Is UML (& OO) Related to This Course? Brief Review of OO Brief Review of UML. 2.

micol
Download Presentation

Outline: Some Points What Is UML (& Object-Oriented Methodology)?

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. Fall 2010CS4310 Requirements EngineeringA Brief Review of UML & OODr. Guoqiang HuDepartment of Computer ScienceUTEP 1

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

  3. 1 Some Points 1.1 You got much much muchmore than you paid for 1.2Things in SE are much much much easier said than done 1.3 Makefriends and/or makealiving(adegreein your case)? 3

  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 4

  5. 5

  6. 6

  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. 7

  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 8

  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 9

  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. 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 14

  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 15

  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 Class Name Attributes Operations 16

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

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

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

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

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

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

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

More Related