Chapter 2,Modeling with UML.ppt
《Chapter 2,Modeling with UML.ppt》由会员分享,可在线阅读,更多相关《Chapter 2,Modeling with UML.ppt(66页珍藏版)》请在麦多课文档分享上搜索。
1、Chapter 2, Modeling with UML,Overview: modeling with UML,What is modeling? What is UML? Use case diagrams Class diagramsNext lecture Sequence diagrams Activity diagrams,What is modeling?,Modeling consists of building an abstraction of reality. Abstractions are simplifications because: They ignore ir
2、relevant details and They only represent the relevant details. What is relevant or irrelevant depends on the purpose of the model.,Example: street map,Why model software?,Why model software?Software is getting increasingly more complex Windows XP 40 mio lines of code A single programmer cannot manag
3、e this amount of code in its entirety. Code is not easily understandable by developers who did not write it We need simpler representations for complex systems Modeling is a mean for dealing with complexity,Systems, Models and Views,A model is an abstraction describing a subset of a system A view de
4、picts selected aspects of a model A notation is a set of graphical or textual rules for depicting views Views and models of a single system may overlap each otherExamples: System: Aircraft Models: Flight simulator, scale model Views: All blueprints, electrical wiring, fuel system,Systems, Models and
5、 Views,Aircraft,Flightsimulator,Scale Model,Blueprints,Electrical Wiring,Models, Views and Systems (UML),System,Model,View,*,*,Depicted by,Described by,Airplane: System,Blueprints: View,Fuel System: View,Electrical Wiring: View,Scale Model: Model,Flight Simulator: Model,Concepts and Phenomena,Phenom
6、enon An object in the world of a domain as you perceive it Example: The lecture you are attending Example: My black watch Concept Describes the properties of phenomena that are common. Example: Lectures on software engineering Example: Black watches Concept is a 3-tuple: Name (To distinguish it from
7、 other concepts) Purpose (Properties that determine if a phenomenon is a member of a concept) Members (The set of phenomena which are part of the concept),Abstraction Classification of phenomena into concepts Modeling Development of abstractions to answer specific questions about a set of phenomena
8、while ignoring irrelevant details.,Concepts and phenomena,Concepts in software: Type and Instance,Type:An abstraction in the context of programming languages Name: int, Purpose: integral number, Members: 0, -1, 1, 2, -2, . . . Instance: Member of a specific type The type of a variable represents all
9、 possible instances the variable can takeThe following relationships are similar: “type” “instance” “concept” “phenomenon”,Abstract Data Types & Classes,Abstract data type Special type whose implementation is hidden from the rest of the system. Class: An abstraction in the context of object-oriented
10、 languages Like an abstract data type, a class encapsulates both state (variables) and behavior (methods) Class Vector Unlike abstract data types, classes can be defined in terms of other classes using inheritance,Application and Solution Domain,Application Domain (Requirements Analysis): The enviro
11、nment in which the system is operatingSolution Domain (System Design, Object Design): The available technologies to build the system,Object-oriented modeling,Application Domain,Solution Domain,Application Domain Model,System Model,Aircraft,TrafficController,FlightPlan,Airport,MapDisplay,FlightPlanDa
12、tabase,SummaryDisplay,TrafficControl,TrafficControl,UML Package,What is UML?,UML (Unified Modeling Language) An emerging standard for modeling object-oriented software. Resulted from the convergence of notations from three leading object-oriented methods: OMT (James Rumbaugh) OOSE (Ivar Jacobson) Bo
13、och (Grady Booch) Reference: “The Unified Modeling Language User Guide”, Addison Wesley, 1999. Supported by several CASE tools Rational ROSE TogetherJ,UML: First Pass,You can model 80% of most problems by using about 20 % UML We teach you those 20%,UML First Pass,Use case Diagrams Describe the funct
14、ional behavior of the system as seen by the user. Class diagrams Describe the static structure of the system: Objects, Attributes, Associations Sequence diagrams Describe the dynamic behavior between actors and the system and between objects of the system Statechart diagrams Describe the dynamic beh
15、avior of an individual object (essentially a finite state automaton) Activity Diagrams Model the dynamic behavior of a system, in particular the workflow (essentially a flowchart),UML first pass: Use case diagrams,Actor,Use case,Package,Use case diagrams represent the functionality of the system fro
16、m users point of view,UML first pass: Class diagrams,1,2,push() release(),Watch,Class,Association,Multiplicity,Attribute,Operations,Class diagrams represent the structure of the system,state,PushButton,UML first pass: Sequence diagram,Object,Message,Activation,Sequence diagrams represent the behavio
17、r as interactions,Actor,Lifeline,UML first pass: Statechart diagrams for objects with interesting dynamic behavior,State,Initial state,Final state,Transition,Event,Represent behavior as states and transitions,Other UML Notations,UML provide other notations that we will be introduced in subsequent le
18、ctures, as needed.Implementation diagrams Component diagrams Deployment diagrams Introduced in lecture on System Design Object constraint language Introduced in lecture on Object Design,UML Core Conventions,Rectangles are classes or instances Ovals are functions or use cases Instances are denoted wi
19、th an underlined names myWatch:SimpleWatch Joe:Firefighter Types are denoted with non underlined names SimpleWatch Firefighter Diagrams are graphs Nodes are entities Arcs are relationships between entities,Use Case Diagrams,Used during requirements elicitation to represent external behaviorActors re
20、present roles, that is, a type of user of the system Use cases represent a sequence of interaction for a type of functionality The use case model is the set of all use cases. It is a complete description of the functionality of the system and its environment,Actors,An actor models an external entity
21、 which communicates with the system: User External system Physical environment An actor has a unique name and an optional description. Examples: Passenger: A person in the train GPS satellite: Provides the system with GPS coordinates,Use Case,A use case represents a class of functionality provided b
22、y the system as an event flow.A use case consists of: Unique name Participating actors Entry conditions Flow of events Exit conditions Special requirements,Use Case Diagram: Example,Name: Purchase ticketParticipating actor: PassengerEntry condition: Passenger standing in front of ticket distributor.
23、 Passenger has sufficient money to purchase ticket.Exit condition: Passenger has ticket.,Event flow: 1. Passenger selects the number of zones to be traveled. 2. Distributor displays the amount due. 3. Passenger inserts money, of at least the amount due. 4. Distributor returns change. 5. Distributor
24、issues ticket.,Anything missing?,Exceptional cases!,The Relationship, relationships represent exceptional or seldom invoked cases. The exceptional event flows are factored out of the main event flow for clarity. Use cases representing exceptional flows can extend more than one use case. The directio
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CHAPTER2 MODELINGWITHUMLPPT
