Presentation is loading. Please wait.

Presentation is loading. Please wait.

2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor.

Similar presentations


Presentation on theme: "2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor."— Presentation transcript:

1 2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor Department of Computer Science and Information Engineering Da-Yeh University

2 22008/03/25Unified Modeling Lanauage Importance of modeling What is a model? A simplification of reality A simplification of reality Why do we model? Better understand the system we are developing Better understand the system we are developing

3 32008/03/25Unified Modeling Lanauage Four aims Models Help us to visualize a system as it is or as we want it to be Help us to visualize a system as it is or as we want it to be Permit us to specify the structure or behavior of a system Permit us to specify the structure or behavior of a system Give us a template that guides us in constructing a system Give us a template that guides us in constructing a system Document the decisions we have made Document the decisions we have made

4 42008/03/25Unified Modeling Lanauage Unified Modeling Language (UML) A standard language for Visualizing Visualizing Specifying Specifying Constructing Constructing Documenting Documenting the artifacts of a software-intensive system Official web site http://www.uml.org/ http://www.uml.org/ http://www.uml.org/ Current version: 2.1 Current version: 2.1

5 52008/03/25Unified Modeling Lanauage Diagrams in the UML A diagram Graphical presentation of a set of elements Graphical presentation of a set of elements Rendered as a connected graph of vertices (things) and arcs (relationships) A projection into a system A projection into a system Visualize a system from different perspectives

6 62008/03/25Unified Modeling Lanauage Diagrams in the UML UML 2.0 defines 13 diagrams, divided into two general sets: Structural modeling diagrams Structural modeling diagrams Define the static architecture of a model Classes, objects, interfaces and physical components Classes, objects, interfaces and physical components Model the relationships and dependencies between elements Behavioral modeling diagrams Behavioral modeling diagrams Capture the varieties of interaction and instantaneous state within a model as it 'executes' over time.

7 72008/03/25Unified Modeling Lanauage Structural diagrams (1/2) Package diagrams Divide the model into logical containers or 'packages' and describe the interactions between them at a high level Divide the model into logical containers or 'packages' and describe the interactions between them at a high level Class or Structural diagrams Define the basic building blocks of a model: the types, classes and general materials that are used to construct a full model Define the basic building blocks of a model: the types, classes and general materials that are used to construct a full model Object diagrams Show how instances of structural elements are related and used at run-time. Show how instances of structural elements are related and used at run-time.

8 82008/03/25Unified Modeling Lanauage Structural diagrams (2/2) Composite structure diagrams Provide a means of layering an element's structure and focusing on inner detail, construction and relationships Provide a means of layering an element's structure and focusing on inner detail, construction and relationships Component diagrams Model higher level or more complex structures, usually built up from one or more classes, and providing a well defined interface Model higher level or more complex structures, usually built up from one or more classes, and providing a well defined interface Deployment diagrams Show the physical disposition of significant artifacts within a real-world setting Show the physical disposition of significant artifacts within a real-world setting

9 92008/03/25Unified Modeling Lanauage Behavioral diagrams (1/2) Use case diagrams Model user/system interactions. Model user/system interactions. Define behavior, requirements and constraints in the form of scripts or scenarios Define behavior, requirements and constraints in the form of scripts or scenarios Activity diagrams Define basic program flow Define basic program flow Capture the decision points and actions within any generalized process Capture the decision points and actions within any generalized process State machine diagrams Understanding the instant condition or "run state" of a model when it executes Understanding the instant condition or "run state" of a model when it executes

10 102008/03/25Unified Modeling Lanauage Behavioral diagrams (2/2) Communication diagrams Show the network and sequence of messages or communications between objects at run-time during a collaboration instance Show the network and sequence of messages or communications between objects at run-time during a collaboration instance Sequence diagrams Show the sequence of messages passed between objects using a vertical timeline Show the sequence of messages passed between objects using a vertical timeline Timing diagrams Fuse Sequence and State diagrams to provide a view of an object's state over time and messages which modify that state Fuse Sequence and State diagrams to provide a view of an object's state over time and messages which modify that state Interaction overview diagrams Fuse Activity and Sequence diagrams to provide allow interaction fragments to be easily combined with decision points and flows Fuse Activity and Sequence diagrams to provide allow interaction fragments to be easily combined with decision points and flows

11 112008/03/25Unified Modeling Lanauage Use case diagram A use case A description of a set of sequences of actions A description of a set of sequences of actions Rendered as an ellipse Rendered as an ellipseNames A simple name A simple name A path name A path name Prefixed by the name of the package Place order Validate user Sensors:: Calibrate location

12 122008/03/25Unified Modeling Lanauage Use case diagram An actor A coherent set of roles that users of use cases play when interacting with these use cases A coherent set of roles that users of use cases play when interacting with these use cases Represents a role Represents a role A human A hardware device Another system customer

13 132008/03/25Unified Modeling Lanauage Use case diagram Contents Use cases Use cases Actors Actors Dependency, generalization, and association relationship Dependency, generalization, and association relationship Common Uses To model the context of a system To model the context of a system All things on the outside that interact with the system constitute the system’s context To model the requirements of a system To model the requirements of a system

14 142008/03/25Unified Modeling Lanauage Credit Card Validation System Model the context of a system Process customer bill Perform card transaction Reconcile transactions Retail institution Manage customer account Sponsoring financial institution Customer Individual Customer Corporate Customer

15 152008/03/25Unified Modeling Lanauage Credit Card Validation System Model the requirements of a system Process customer bill Perform card transaction Reconcile transactions Retail institution Manage customer account Sponsoring financial institution Customer Report on account status Detect card fraud Manage network outage

16 162008/03/25Unified Modeling Lanauage Relationships A relationship A connection among things A connection among things The three most important relationships Dependencies Dependencies Generalizations Generalizations Associations Associations

17 172008/03/25Unified Modeling Lanauage Dependency A change in specification of one thing may affect another thing that uses it, but not necessarily the reverse Be rendered as a dashed directed line Directed to the thing being depended on Directed to the thing being depended on

18 182008/03/25Unified Modeling Lanauage Dependency To decompose use cases into reusable parts Two stereotypes Extend Extend Specify that the target use case extends the behavior of the source Include Include Specify that the source use case explicitly incorporates the behavior of another use case at a location specified by the source

19 192008/03/25Unified Modeling Lanauage Generalization A relationship between A general thing (called the superclass or parent) A general thing (called the superclass or parent) A more specific kind of that thing (called the subclass or child) A more specific kind of that thing (called the subclass or child) Also called an “is-a-kind-of” relationship Rendered as a solid directed line with a large open arrowhead, pointing to the parent.

20 202008/03/25Unified Modeling Lanauage Generalization, Include, and Extend Validate user Check password Retinal scan Place rush order Place order Track order >

21 212008/03/25Unified Modeling Lanauage Association A structural relationship Specify that objects of one thing are connected to objects of another Specify that objects of one thing are connected to objects of another Rendered as a solid line connecting the same or different classes Four adornments Name Name Role Role Multiplicity Multiplicity Aggregation Aggregation

22 222008/03/25Unified Modeling Lanauage Association Name Use the name to describe the nature of the relationship Use the name to describe the nature of the relationship Can provide a direction triangle that points in the direction you intend to read the name Can provide a direction triangle that points in the direction you intend to read the name PersonCompany Works for

23 232008/03/25Unified Modeling Lanauage Association Role A specific role that it plays in that relationship A specific role that it plays in that relationship PersonCompany employee employer

24 242008/03/25Unified Modeling Lanauage Association Multiplicity How many objects may be connected across an instance of an association How many objects may be connected across an instance of an association Exactly one (1) Exactly one (1) Zero or one (0..1) Zero or one (0..1) Many (0..*) Many (0..*) One or more (1..*) One or more (1..*) PersonCompany employee employer 1..* *

25 252008/03/25Unified Modeling Lanauage Association Aggregation A “whole/part” relationship A “whole/part” relationship The whole : a larger thing The parts : smaller things A special kind of association A special kind of association With an open diamond at the whole end CompanyDepartment 1 *


Download ppt "2008/03/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang Assistant Professor."

Similar presentations


Ads by Google