UNIT 2 STATIC MODELING.

Slides:



Advertisements
Similar presentations
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 9 Object, Package, Component and Deployment Diagrams (Based on Fowler, 2004,
Advertisements

CIT731: Database Development Object Oriented Modeling (OOM)
UML Diagrams Jung Woo. What is UML? Standard language for specifying, visualizing, constructing, and documenting the artifacts of software systems, business.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
COMPONENT DIAGRAM in UML 2.0 Veronica Carrega
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Architectural Modeling Notations.
Object-Oriented Analysis and Design
C OMPONENT & D EPLOYMENT D IAGRAMS Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn.
UML – Class Diagrams.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
Component and Deployment Diagrams
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
© Copyright Eliyahu Brutman Programming Techniques Course.
COMS W4156: Advanced Software Engineering
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Modelling Class T16: Conceptual Modelling – Architecture Image from
CS3773 Software Engineering Lecture 04 UML Class Diagram.
UML diagrams What is UML UML diagrams –Static modeoing –Dynamic modeling 1.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML Class Diagrams.
CBSE 2014 Modeling Components with UML. Bibliography Modelling components in UML – Main text: Kim Hamilton, Russell Miles, Learning UML 2.0, OReilly,
TAL7011 – Lecture 4 UML for Architecture Modeling.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Design Model Lecture p6 T120B pavasario sem.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
Ch- 8. Class Diagrams Class diagrams are the most common diagram found in modeling object- oriented systems. Class diagrams are important not only for.
Software Engineering Lecture 8 Object-Oriented Analysis.
 Building Block Building Block  Things in the UML Things in the UML  Structural Things Structural Things  Behavioral Things Behavioral Things  Grouping.
COMPONENT DIAGRAM in UML 2.0 Veronica Carrega. PLAN OF TALK  Introduction about components  Components and component diagrams in uml 2.0  Case study.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Identifying classes, Packages and drawing class Diagrams, Object Diagrams and composite structure diagrams Week 07 1.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Introduction to UML Hazleen Aris Software Eng. Dept., College of IT, UNITEN. …Unified Modeling Language.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Diagrams. Typically, we view the static parts of a system using one of the four following diagrams. 1. Class diagram 2. Object diagram 3. Component diagram.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
ITEC1301 Object-Oriented Systems Construction Lecture Notes #4 1.
R R R CSE870: UML Component Diagrams Implementation Diagrams.
Deployment Diagram.
Method – Notation 8 Hours.
Modeling with UML – Class Diagrams
CHAPTER
UML Diagrams: Class Diagrams The Static Analysis Model
UML(Unified Modeling Language)
UML Diagrams By Daniel Damaris Novarianto S..
Deployment Diagram.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
COMPONENT & DEPLOYMENT DIAGRAMS
Object-Oriented Analysis and Design
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Unified Modeling Language
Introduction to Unified Modeling Language (UML)
University of Central Florida COP 3330 Object Oriented Programming
UML Diagrams Jung Woo.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Object Oriented Analysis and Design
CBSE 2014 Modeling Components with UML
UML Class Diagram.
Chapter 20 Object-Oriented Analysis and Design
UNIT – V.
CIS 375 Bruce R. Maxim UM-Dearborn
Analysis models and design models
Class Diagrams.
Copyright 2007 Oxford Consulting, Ltd
Design Yaodong Bi.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CIS 375 Bruce R. Maxim UM-Dearborn
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

UNIT 2 STATIC MODELING

Class Diagrams Object Diagrams Component Diagrams Deployment Diagrams Package Diagrams

A classifier is a mechanism that describes structural and behavioral features. Classifiers include classes, interfaces, datatypes, signals, components, nodes, use cases, and subsystems.

Classifiers

CLASS DIAGRAM Books: UML in a Nutshell by Dan Pilone UML User Guide UML 2 & the Unified Process by Jim Arlow

Class diagrams are one of the most fundamental diagram types in UML. They are used to capture the static relationships of your software; in other words, how things are put together A class represents a group of things that have common state and behavior.

Class vs Objects Volkswagen, Toyota, and Ford are all cars, so you can represent them using a class named Car. Each specific type of car is an instance of that class, or an object.

UML suggests that the class name: Start with a capital letter Be centered in the top compartment Be written in a boldface font

Typically you show the name of the object followed by a colon followed by its type (i.e., class). You show that this is an instance of a class by underlining the name and type

Attributes Inlined Attributes

Inlined Attributes You can list a class's attributes right in rectangle notation; these are typically called inlined attributes

1. Visibility One of the most important details you can specify for a classifier's attributes and operations. The visibility of a feature specifies whether it can be used by other classifiers. In the UML, you can specify any of three levels of visibility. Use the following symbols: +, -, #, ~ for public, private, protected, or package, respectively

Public: Any outside classifier with visibility to the given classifier can use the feature; specified by the symbol + 2. Protected Any descendant of the classifier can use the feature; specified by the symbol # 3. Private Only the classifier itself can use the feature; specified by the symbol -

When you specify the visibility of a classifier's features, you generally want to hide all its implementation details and expose only those features that are necessary to carry out the responsibilities of the abstraction. That's the very basis of information hiding, which is essential to building solid, flexible systems. If you don't explicitly adorn a feature with a visibility symbol, you can usually assume that it is public.

Visibility

2. Derived Attribute / Indicates the attribute is derived. A derived attribute is simply one that can be computed from other attributes of the class.

3. name Is a noun or short phrase naming the attribute. Typically the first letter is lowercase. 4. type Is the type of the attribute as another classifier, typically a class, interface, or built-in type like int.

5. multiplicity Specifies how many instances of the attribute's type are referenced by this attribute. Can be absent (meaning multiplicity of 1), a single integer, or a range of values specified between square brackets separated by ".." * means zero or more.

Attribute Multiplicity

Multiplicity ( Attributes and Classes) Multiplicity applies to attributes, as well. You can specify the multiplicity of an attribute by writing a suitable expression in brackets just after the attribute name. For example, in the figure, there are two or more consolePort instances in the instance of NetworkController.

6. default Is the default value of the attribute

Attributes [visibility] name [multiplicity] [: type] [= initial-value] [{property-string}]

7. Navigation

8. Role Names

Relationships

1. Association

2. Generalization

3. Dependency

4. Aggregation / Whole Part Relationship

5. Composition

Relationships in the hierarchy of strength

Derived Attribute

Post Conditions on Operations

Class diagrams commonly contain the following things: · Classes · Interfaces · Collaborations · Dependency, generalization, and association relationships

Purposes of Class Diagram: 1. To model the vocabulary of a system Modeling the vocabulary of a system involves making a decision about which abstractions are a part of the system under consideration and which fall outside its boundaries. You use class diagrams to specify these abstractions and their responsibilities. Collaborations are discussed in Chapter 27. 2. To model simple collaborations A collaboration is a society of classes, interfaces, and other elements that work together to provide some cooperative behavior that's bigger than the sum of all the elements. For example, when you're modeling the semantics of a transaction in a distributed system, you can't just stare

of classes that work together of classes that work together. You use class diagrams to visualize and specify this set of classes and their relationships. Persistence is discussed in Chapter 23; modeling physical databases is discussed in Chapter 29. 3. To model a logical database schema Think of a schema as the blueprint for the conceptual design of a database. In many domains, you'll want to store persistent information in a relational database or in an object-oriented database. You can model schemas for these databases using class diagrams

Association Classes An association class is a class that is part of an association relationship between two other classes. You can attach an association class to an association relationship to provide additional information about the relationship. An association class is identical to other classes and can contain operations, attributes,

FootballPlayer may not have a direct reference to FootballLeague but may have a reference to FootballTeam instead. FootballTeam would then have a reference to FootballLeague

Interface An interface is a classifier that has declarations of properties and methods but no implementations. Contr act.

Provided and Required interfaces

Realization Relationship A class is said to realize an interface if it provides an implementation for the operations and properties.

Realization vs Dependency wrt Interfaces

Association Qualifier

In a banking application, a class called Bank represents a banking institution and has an association with a class called Person, which represents an individual. The account number qualifies the association, and it enables the indexing of many associations between the Person and Bank classes.

Constraints

OBJECT Diagram

An object diagram is a diagram that shows a set of objects and their relationships at a point in time. Graphically, an object diagram is a collection of vertices and arcs

You use object diagrams to show snapshots of the relationships in your system

The terms "instance" and "object" are largely synonymous and so, for the most part, may be used interchangeably. An instance is a concrete manifestation of an abstraction to which a set of operations may be applied and which may have a state that stores the effects of the operation

Orphan Attribute

The UML defines two standard stereotypes that apply to the dependency relationships among objects and among classes: instanceOf: Specifies that the client object is an instance of the supplier classifier 2. instantiate: Specifies that the client class creates instances of the supplier class

Object diagrams commonly contain · Objects · Links Like all other diagrams, object diagrams may contain notes and constraints

You use object diagrams to model the static design view or static process view of a system just as you do with class diagrams, but from the perspective of real or prototypical instances. This view primarily supports the functional requirements of a system• that is, the services the system should provide to its end users. Object diagrams let you model static data structures.

If class A has a one-to-many association to class B, then for one instance of A there might be five instances of B; for another instance of A there might be only one instance of B. Furthermore, at a given moment in time, that instance of A, along with the related instances of B, will each have certain values for their attributes and state machines. If you freeze a running system or just imagine a moment of time in a modeled system, you'll find a set of objects, each in a specific state, and each in a particular relationship to other objects. You can use object diagrams to visualize, specify, construct, and document the structure of these objects. Object diagrams are especially useful for modeling complex data structures

Therefore, when you use object diagrams, you can only meaningfully expose interesting sets of concrete or prototypical objects. This is what it means to model an object structure• an object diagram shows one set of objects in relation to one another at one moment in time.

Task: Class Diagram Object Diagram

Aggregation implies a relationship where the child can exist independently of the parent Composition implies a relationship where the child cannot exist independent of the parent

COMPONENT DIAGRAM Interfaces and Components

A component is a replaceable, executable piece of a larger system whose implementation details are hidden. .

The functionality provided by a component is specified by a set of provided interfaces that the component realizes In addition to providing interfaces, a component may require interfaces in order to function. These are called required interfaces

UML VERSION 2.0

Component Diagram

Component Views UML uses two views of components, a black-box view and a white-box view.

The black-box view shows a component from an outside perspective; the white-box view shows how a component realizes the functionality specified by its provided interfaces.

Black-Box View The black-box view of a component shows the interfaces the component provides, the interfaces it requires, and any other detail necessary to explain the guaranteed behavior of the component. It does not specify anything about the internal implementation of the component. This distinction is central to the concept of replaceable components.

2. Interface Dependencies 3. Component Compartments Black Box View 1. Assembly connectors 2. Interface Dependencies 3. Component Compartments

1. Assembly connectors When modeling a black-box view of a component, you represent the provided and required interfaces using assembly connectors. Assembly connectors are illustrated using ball and socket icons

To wire components together, simply connect the matching provided and required interfaces. Component dependencies using assembly connectors provide more details about the actual relationships between components than simple dependency relations

2. Interface Dependencies

3. Component Compartments Use the stereotype:: «provided interfaces» «required interfaces»

2. Interface Dependencies 3. Component Compartments Black Box View 1. Assembly connectors 2. Interface Dependencies 3. Component Compartments

White Box view In order to provide details about the implementation of a component, UML defines a white box view. The white-box view shows exactly how a component realizes the interfaces it provides. This is typically done using classes and is illustrated with a class diagram; however a component may delegate some or all of its behavior to other components.

Level 1

Detailed Realization Level 2

Level 3

Ports Ports provide a way to model how a component's provided/required interfaces relate to its internal elements. 

Levels of Abstraction in Component Diagram White Box View Level 1: High level Level 2: lower than 1 Level 3: lowest

Task

ENDS ……..

Level 1: High level - Component Dependencies Level 2:Ball and socket Notation Level 3: Realization and Dependency relations

DEPLOYMENT DIAGRAM Deployment diagrams model the mapping of software pieces of a system to the hardware that is going to execute it.

ELEMENTS OF DEPLOYMENT DIAGRAM Artifact Nodes Devices Communication Paths

1. Artifact Artifacts represent physical pieces of information related to the software development process. For example, you can use an artifact to represent a DLL needed by your system, A user's manual, or an executable produced Typically artifacts are used to represent the compiled version of a component

2. Node A node is a physical entity that can execute artifacts. Nodes can vary in size from a simple embedded device to a server. Nodes are a critical piece of any deployment diagram because they show where a particular piece of code executes and how the various pieces of the system (at the execution level) communicate.

You show a node as a 3D box with the name of the node written inside

2. Device A device is a specialization of a node that represents a physical machine capable of performing calculations. You show a device as a node with the stereotype «device>>

One of the more powerful features of devices is that they can be nested. For example, You can model a server with internal devices representing RAID controllers, video cards, etc. A real-world use of nested devices can be pixel and vertex shading code running on a video card (represented as a device) while the rest of the application runs on the machine's CPU

3. Execution Environment An execution environment is a specialized node that represents a software configuration hosting specific types of artifacts. An execution environment is expected to provide specific services to hosted artifacts by means of mutually agreed upon interfaces.

4. COMMUNICATION PATHS Because many nodes may be associated with the deployment of a system, communication between nodes can be modeled using communication paths Communication paths represent generic communication between nodes.

Deployment diagram

DEPLOYMENT DIAGRAM ends..

PACKAGE DIAGRAM

Package diagrams Packages provide a way to group related UML elements and scope their names. For example, you can put all elements having to do with 3D rendering into a package named 3DGraphics. Package diagrams provide a great way to visualize dependencies between parts of your system and are often used to look for problems or determine compilation order. .

Package may contain any other UML elements, including another package .

You place a circle with a plus sign in it at the end nearest the package to indicate containment

Visibility

Importing and Accessing Package

Using a Qualifier When accessing elements in one package from a different package, you must qualify the name of the element you are accessing. For example, if Car is a class in the transportation package and you are trying to access it from a package named RoutePlanning, you need to qualify Car as transportation::Car Package Class

Importing Package Imported Package

To simplify accessing elements in a different package, UML allows a package to import another package. Elements of the imported package are available without qualification in the importing package. So, if the RoutePlanning package imported the transportation package, you can refer to Car without any qualifications from within the RoutePlanning package

By default, imported elements are given public visibility in the importing package. UML allows you to specify that imported elements should be given private visibility, meaning they can't be used by anyone outside the package To specify that imported elements should have private visibility, you use the «access» keyword rather than the «import» keyword

Figure shows the RoutePlanning package importing the Transportation package and accessing the Algorithms package. If a package imports the RoutePlanning package, both packages can use public elements from Transportation, but they can't use anything in Algorithms.

1. Package Diagram drawn by a Project Manager

2. Use Case Package Use case packages organize the functional behavior of a system. You manage the use case packages to manage the project.

3. Directed Dependency Graph Directed dependency graphs of the packages in a system reveal nonfunctional issues related to buildability, testability, and robustness; they provide a guide for several roles in software development.

When all the dependencies flow in one direction, without any loops or cycles, the graph is acyclic . Acyclic graphs show a project in good health.

Cycles - > pain for stakeholders.

IMPORT When a package imports another package, elements in the importing package can use elements in the imported package without having to use their fully scoped names. This feature is similar to a Java import, in which a class can import a package and use its contents without having to provide their package names. In an import relationship, the imported package is referred to as the target package . To show the import relation, draw a dependency arrow from the importing package to the target package with the stereotype import

When importing a package, only public elements of the target package are available in the importing namespace. For example, in Figure 13-16, elements in users can see Credentials and IdentityVerifier but not MD5Crypt.

UNIT 2 ends