Introduction to UML 1 Modeling n Describing a

Introduction to UML 1

Modeling n Describing a system at a high level of abstraction ¨A model of the system ¨ Used for requirements and specifications n Is it necessary to model software systems?

Object Oriented Modeling

What is UML? n UML stands for “Unified Modeling Language” n It is a industry-standard graphical language for specifying, visualizing, constructing, and documenting the artifacts of software systems n The UML uses mostly graphical notations to express the OO analysis and design of software projects. n Simplifies the complex process of software design

Why UML for Modeling n Use graphical notation to communicate more clearly than natural language (imprecise) and code(too detailed). n Help acquire an overall view of a system. n UML is not dependent on any one language or technology. n UML moves us from fragmentation to standardization.

UML History n OO languages appear mid 70’s to late 80’s (cf. Budd: communication and complexity) n Between ’ 89 and ’ 94, OO methods increased from 10 to 50. n Unification of ideas began in mid 90’s. n ¨ Rumbaugh joins Booch at Rational ’ 94 v 0. 8 draft Unified Method ’ 95 n Jacobson joins Rational ’ 95 ¨ UML v 0. 9 in June ’ 96 ¨ ¨ UML 1. 0 offered to OMG in January ’ 97 UML 1. 1 offered to OMG in July ’ 97 ¨ ¨ ¨ UML 1. 2 in June ’ 98 UML 1. 3 in fall ’ 99 UML 1. 5 http: //www. omg. org/technology/documents/formal/uml. htm ¨ UML 2. 0 underway http: //www. uml. org/ n Maintenance through OMG RTF pre-UML 1. x UML 2. 0 n IBM-Rational now has Three Amigos ¨ ¨ n Grady Booch - Fusion James Rumbaugh – Object Modeling Technique (OMT) Ivar Jacobson – Object-oriented Software Engineering: A Use Case Approach (Objectory) ( And David Harel - State. Chart) Rational Rose http: //www-306. ibm. com/software/rational/ 6

History of UML

Unified Modeling Language (UML) n An effort by IBM (Rational) – OMG to standardize OOA&D notation n Combine the best of the best from n n ¨ Data Modeling (Entity Relationship Diagrams); Business Modeling (work flow); Object Modeling ¨ Component Modeling (development and reuse - middleware, COTS/GOTS/OSS/…: ) Offers vocabulary and rules for communication Not a process but a language de facto industry standard 8

UML is for Visual Modeling A picture is worth a thousand words! - standard graphical notations: Semi-formal - for modeling enterprise info. systems, distributed Web-based applications, real time embedded systems, … Places Order Sales Representative Customer Fulfill Order Item Business Process via Ships the Item - Specifying & Documenting: models that are precise, unambiguous, complete ¨ UML symbols are based on well-defined syntax and semantics. ¨ analysis, architecture/design, implementation, testing decisions. - Construction: mapping between a UML model and OOPL. 9

Three (3) basic building blocks of UML (cf. Harry) Water have Rivers Oceans have Fish Fresh water have Salt water live in Crocodiles Penguins ¨ Things - important modeling concepts ¨ Relationships - tying individual things Just glance thru for now ¨ Diagrams - grouping interrelated collections of things and relationships 10

Types of UML Diagrams n Use Case Diagram n Class Diagram n Sequence Diagram n Collaboration Diagram n State Diagram This is only a subset of diagrams … but are most widely used

3 basic building blocks of UML - Things n UML 1. x ¨ Structural — nouns/static of UML models (irrespective of time). Main ¨ Behavioral — verbs/dynamic parts of UML models. ¨ Grouping — organizational parts of UML models. ¨ Annotational — explanatory parts of UML models. 12

Structural Things in UML- 7 Kinds (Classifiers) q Nouns. q Conceptual or physical elements. Active Class (processes/threads) Student std_id grade change. Level( ) set. Grade( ) get. Grade( ) Event Mgr thread time Start suspend( ) stop( ) Component (replaceable part, realizes interfaces) Interface (collection of externally Visible ops) Node (computational resource at run-time, processing power w. memory) Course. cpp IGrade <<interface>> IGrade Univ. Web. Server set. Grade() get. Grade() Register for Courses Manage Course Registration Use Case Collaboration (a system service -sequence of Interactions w. actor) (chain of responsibility shared by a web of interacting objects, structural and behavioral) 13

Behavioral Things in UML q Verbs. q Dynamic parts of UML models: “behavior over time” q Usually connected to structural things. q. Two primary kinds of behavioral things: q Interaction a set of objects exchanging messages, to accomplish a specific purpose. harry: Student ask-for-an-A name = “Harry Kid” katie: Professor name = “Katie Holmes” q State Machine specifies the sequence of states an object or an interaction goes through during its lifetime in response to events. in. Study received-an-A/ buy-beer sober/turn-on-PC in. Party 14

3 basic building blocks of UML - Diagrams A connected graph: Vertices are things; Arcs are relationships/behaviors. UML 1. x: 9 diagram types. UML 2. 0: 12 diagram types Structural Diagrams Represent the static aspects of a system. ¨ Class; Object ¨ Component ¨ Deployment ¨ ¨ ¨ Behavioral Diagrams Represent the dynamic aspects. ¨ Use case ¨ Sequence; Collaboration ¨ Statechart ¨ Activity Class; Object Component Deployment Composite Structure Package Behavioral Diagrams ¨ Interaction Diagrams Use case ¨ Sequence; Communication Statechart ¨ Activity ¨ Interaction Overvie 15 ¨ Timing ¨

Diagrams in UML – Interaction Diagrams A use case diagram presents an outside view of the system. Then, how about the inside view of the system? n Interaction diagrams describe how use cases are realized in terms of interacting objects. n Two types of interaction diagrams Sequence diagrams ¨ Collaboration (Communication) diagrams ¨ 16

UML Model Functional model: Use case diagram n Describe the functional behavior of the system as seen by the user Object model: Class diagram Describe the static structure of the system in terms of Objects, Attributes, Associations, and Operations. n 17

UML Model Class diagram used in different phases of the software life cycle 1. Requirement and analysis: analysis object model application concepts 2. System design: system design model descriptions of subsystem interfaces 3. Object design: object design model detailed descriptions of solution objects 18

UML Model Dynamic model: Interaction diagram, State machine diagram, Activity diagram Describe the internal behavior of the system n Interaction diagram : describe behavior as a sequence of messages exchanged among a set of objects n State machine diagram : describe behavior in terms of states of an individual object and the possible transitions between states n Activity diagram : describe behavior in terms of control and data flows 19
- Slides: 19