(Unified Modeling Language) 1. Introduction to UML 2. Basic Structural Modeling 3. Advanced Structural Modeling 4. Class & Object Diagrams 5. Basic Behavioral Modeling - I 6. Basic Behavioral Modeling - II 7. Advanced Behavioral Modeling 8. Architectural Modeling History of UML Importance of Modeling Principles of Modeling Object Oriented Modeling Conceptual Model of UML Architecture Software Development Life Cycle Classes Relationships Common Mechanisms Diagrams Advanced Structural Modeling: Advanced Classes Advanced Relationships Interfaces Types and Roles Packages Class & Object Diagrams: Terms Concepts Modeling Techniques for Class & Object Diagrams Basic Behavioral Modeling – I: Interactions Interaction Diagrams Behavioral Modeling – II: Use Cases Use Case Diagrams Activity Diagrams Advanced Behavioral Modeling: Events and Signals State Machines Process and Threads Time and Space State Chart Diagrams Architectural Modeling: Component Deployment Component Diagrams and Deployment Diagrams The UML enables system builders to create “blueprints” that capture their visions in a standard , easy-to-understand way and communicate them to others. UML stands for Unified Modeling Language is a standard language for writing software blueprints used to specify, visualize, construct & document the artifacts of an object-oriented s/w intensive system under development. History of UML:- Grady Booch, James Rumbaugh and Ivar Jacobson are the “Three Amigos” who developed this UML in the ending of 1996. These gentlemen worked in separate organizations through the ‘80s and early ‘90s each devising his own methodology for Object-Oriented analysis and design. In 1994, Rumbaugh joined Rational Software Corporation, where Booch was already working. Jacobson enlisted at Rational a year later. UML is a merged technique which is merged from the concepts of Booch Methods, Object Modeling Techniques & Object-Oriented Software Engineering(OOSE). UML combines the best practices from Data Modeling concepts such as Entity Relationship diagrams, Data Flow, Work Flow diagrams, Object Modeling & Component Modeling. The UML consists a number of graphical elements that combine to form diagrams. The purpose of the diagrams is to present multiple views of a system, and this set of multiple views is called a “Model”. In 1997, the UML consortium produced version 1.0 of the UML and submitted it to the Object Management Group(OMG) for a standard modeling language. UML 1.0 in 1996 UML 1.1 in 1997 UML 1.2 in 1999 UML 1.3 in 2000 UML 1.4 in 2001 UML 1.5 in 2003 UML 2.0 in 2005 UML 2.1.1 in 2007 UML 2.1.2 in 2007 Importance of Modeling:• Modeling is a proven and well-accepted engineering technique. • A Model is a simplification of reality. • A Model provides the blue prints of a system. • We build Models so that we can better understand the system we are developing. • Models helps us to visualize a system as it is or as we want it to be. • Models permits us to specify the structure or behavior of a system. • Models document the decisions we have made. • Models gives us a template that guides us in constructing a system. • We build Models of complex systems because we cannot comprehend such a system in its entirety. • Finally, we build Model to control the system. I. The choice of what models to create has a profound influence on how a problem is and how a solution is shaped. II. Every model may be expressed at different levels of precision. III. The best models are connected to reality. IV. No Single model is sufficient, Every nontrivial system is best approached through a small set of nearly independent models. In Object-Oriented Modeling approach, the main building block of all software system is the “ Object “ or “ Class “. Simply put, an Object is a “ Thing “. A Class is description of a set of common objects. Every object has identity, state, and behavior. Visualizing, specifying, constructing, and documenting object-oriented systems is exactly the purpose of the Unified Modeling Language. UML as a Language: A Language provides a vocabulary & the rules for communication that focus on physical & conceptual representation of a system, UML tells you how to create & read well-formed models, but they don’t tell you what models you should create and when to create. UML for Specification: UML address the specification of all the important analysis, design & implementation decisions that must be made in developing and deploying a software intensive system. UML for Visualizing: UML is such a graphical language that some “ Things “ can be modeled textually and some are best modeled graphically. UML for Construction: UML is not only a visual programming language but its models can be directly connected to a variety of programming languages. UML for Documentation: UML addresses the documentation of a system architecture and its details, requirements, activities of project planning & release management. To understand UML, learners need to know about the Conceptual Model of this language and this requires learning three major elements. They are, 1) Basic Building Blocks 2) Rules 3) Common Mechanisms The Vocabulary of UML encompasses three kinds of building blocks. They are, 1. Things 2. Relationships 3. Diagrams • “ Things “ form the vocabulary(Nouns) of a system and they are the abstractions of a particular model, “ Relationships “ tie the things together, “ Diagrams “ group related things together. Things in UML:There are four kinds of “ Things “ in UML. They are, 1) Structural Things:- Structural things are the “ Nouns “ and are the static parts of an UML model. 2) Behavioral Things:- Behavioral things are the “ Verbs ” and are the dynamic parts of an UML model. 3) Grouping Things:- Grouping things are the Organizational parts of an UML model. 4) Annotational Things:- Annotational things are the Explanatory parts of an UML model. Structural things are classified into 7 types. Behavioral things are classified into 2 types. Grouping things are classified into 1 type. Annotatational things are classified into 1 type. Structural Things are of 7 types, they are, 1. Class:- A Class is a description of a set of objects that share the same attributes, operations, relationships & semantics, class may implement one or more interfaces. Graphically, a class is rendered as a “ Rectangle ” with three compartments for Name of the class, Attributes, Operations as shown below. Name of the Class Attributes Operations 2. Interface:- An Interface is a collection of operations that specify “ what to do “. Graphically, an interface is rendered as a “ Circle ” with it’s name as shown below. Interface name 3. Collaboration:- A Collaboration defines an interaction & it is a set of roles and responsibilities. Generally, a collaboration is realized by a “ Use Case ”. Graphically, a collaboration is rendered as an “ Ellipse with Dashed Lines “ as shown below. Roles 4. Use Case:- A Use Case is a description of a set of sequence of actions that a system performs with a particular actor. A use case is graphically rendered as an “ Ellipse with Solid Line ” as shown below. Action Name 5. Active Class:- An Active Class is a class where objects own one or more processes or threads to initiate a control activity. Graphically, an active class is rendered like a “ Class but with Thick Lines “ as shown below. 6. Component:- A Component is a physical and replaceable part of a system which provides the realization of Interfaces. Graphically, a component is rendered as a “ Rectangle with Tabs “ as shown below. Name.java 7. Node:- A Node is a physical element that exists at runtime & represents a computational resource like memory. Graphically, a node is rendered as a “Cube“ including the name. Server Behavioral Things are of 2 types, they are, 1) Interaction:- An Interaction is a behavior that comprises a set of messages exchanged among a set of objects. Graphically, an interaction message is rendered as a “ Directed Arrow Line ” including the name of the operation as shown below. Operation Name 2) State Machine:- A State Machine is a behavior that specifies the sequences of states. Graphically, a state is rendered as a “ Rounded Rectangle “ with it’s name and also it’s state as shown below. State Name Grouping Things are of 1 type, it is, i. Package:- A Package is a general purpose mechanism for organizing elements into groups. Graphically, a package is rendered as a “ Tabbed Folder ” as shown below. Package Name Annotational Things are of 1 type, it is, I. Note:- A Note is a special kind of graphical symbol used to specify comments or constraints. Graphically, a note is rendered as a “ Rectangle with a dog-eared corner “ as shown below. Comments Relationships in UML:There are four types of “ Relationships “ in UML. They are, i. Dependency:- A Dependency is a Semantic relationship between two things in which a change to one thing may affect the semantics of the other thing. Graphically, a dependency is rendered as a “ Dashed Arrow “ as shown below. ii. Association:- A Association is a Structural relationship that describes a set of links that connected among Objects. Aggregation is a special kind of association representing a structural relationship b/w a whole and its parts. Graphically, an association is rendered as a “ Solid Line “ as shown below. iii. Generalization:- A Generalization is a Specialization / Generalization relationship in which Objects of the specialized elements are substitutable for objects of the generalized element. Graphically, a generalization relationship is rendered as a “ Solid Line with a Hallow Triangle Arrow Head ” as shown below iv. Realization:- A Realization is graphically rendered as a ” Dashed Line with a Hallow Triangle Arrow Head “ as shown below. Diagrams in UML:There are two kinds of “ Diagrams “ in UML. They are, I. Static (or) Structural Diagrams II. Dynamic (or) Behavioral Diagrams In UML, a total of 9 diagrams are available that are classified either into Static or Dynamic. They are, 1. Class Diagram:- Class shows the entities in a system or a domain and how these entities relate to one another. 2. Object Diagram:- Object shows instances of the classes and their interrelationships. 3. Use Case Diagram:- Use Case shows system usage, this appears with an actor or stick figure. 4. Sequence Diagram:- Sequences visualizes how the Objects in a system interact with one another over time. 5. Collaboration Diagram:-Collaboration is another way of visualizing how Objects work together overtime. 6. State Chart Diagram:- State Captures the state of an Object during a specific time period. 7. Activity Diagram:- Activity shows the steps and decision points that occur within the behavior of an Object, or within a business process. 8. Component Diagram:- Component models the software components of a system. 9. Deployment Diagram:- Deployment represents the physical architecture of a computer-based system. The UML has various semantic rules for, i. Names ii. Scope iii. Visibility iv. Integrity v. Execution There are four types of mechanisms available in UML. They are, 1. Specifications Mechanism:- UML is a language which is not only meant for visualizing the system but also used for specifying the various artifacts of an intensive system. 2. Adornments Mechanism:- In UML , some of the vocabulary of the system are elided(hided) because of the rules . In order to expose some of the facts, UML has a mechanism often known as “ Adornments ” which may be in the form of graphical or textual. 3. Common Divisions Mechanism:-The Common divisions are, Class & Object Interface & Implementation 4. Extensibility Mechanism:- UML provides a mechanism to extend the various naunces(issues) such as vocabulary, properties, & semantics using three extensibility mechanisms known as Stereotypes, Tagged values & Constraints. Architecture of UML:- In UML, the architecture of a s/w intensive system can be best described by the following 4+1 architecture view. Design View Implementation View Use Case View Process View Deployment View An Architecture is a set of significant decisions about, 1. The Organization of the system. 2. The selection of structure elements and their interfaces. 3. Their behavior and collaborations among other elements. 4. The composition of structural and behavioral elements. 5. The architecture style that guides the organization. I. Use Case View:- A Use Case View of a system encompasses the use cases that describe the behavior of the system. In UML, “ Static “ aspects of this view are captured in Use Case diagrams, the “ Dynamic “ aspects of this view are captured in Interaction, State Chart and Activity diagrams. II. Design View:- The Design View of a system encompasses the classes, interfaces and collaboration that form the vocabulary of the system. In UML, the “ Static ” aspects are captured using Class diagrams and Object diagrams, the “ Dynamic “ aspects are captured using Interaction, State Chart & Activity diagrams. III. Process View:- The Process View of a system encompasses threads and processes that form the system. The same type of diagrams used for Design View are used for this view but Classes are replaced with Active Class . IV. Implementation View:- The Implementation View of a system encompasses the components and files are used to assemble and release the physical system. The “ Static “ aspects of this view are captured using Component diagrams, the “ Dynamic “ aspects of this view are captured using Interaction, State Chart and Activity diagrams. V. Deployment View:- The Deployment View of a system encompasses the nodes that from the systems hard-ware topology. The “ Static “ aspects of this view are captured using Deployment diagrams whereas the “ Dynamic “ aspects of this view using Interactive, State Chart and Activity diagrams. UML is lastly based on the topic “ process independent “. However, to get the most benefits from UML we should consider a process which is, i. Use-Case driven ii. Architecture-Centric iii. Interactive iv. Incremental Use Case driven means that use cases are used as a primary artifact for establishing the desired behavior of the system, for verifying and validating the systems architecture, for testing and communicating among the stakeholders of the project. Architecture-Centric means that a system’s architecture is used as a primary artifact for conceptualizing, constructing, managing and evolving the system under development. An Interactive process is one that involves managing a stream of executable releases. An Incremental process is one that involves the continuous integration of the systems architecture to produce the releases. Together, an interactive & incremental process is risk-driven, meaning that each new release is focused on attacking and reducing the most significant risks to the success of the project. Overview of Conceptual Model in UML Basic Building Blocks Rules Names Things Relationships Scope Visibility Diagrams Integrity Execution Common Mechanisms Specifications Adornments Common Divisions Extensibility Things Structural Things Behavioral Things Grouping Things Annotational Things Package Note Class Interface Interaction Collaboration Use Case Active Class Component Node State Machine Dependency Association/Aggregation Relationships Generalization/Specialization Realization Class Diagram Object Diagram Use Case Diagram Sequence Diagram Diagrams Collaboration Diagram State Chart Diagram Activity Diagram Component Diagram Deployment Diagram Rules Name Scope Visibility Integrity Execution Specifications Adornments Common Mechanisms Common Divisions Extensibility