uml and software modeling tools.pptx

58
UML AND SOFTWARE MODELING TOOLS Presented by Obioma, Nwabueze N.

Upload: nwabueze-obioma

Post on 06-May-2015

1.281 views

Category:

Technology


4 download

DESCRIPTION

Unified Modelling Language and the use of a Software tool in developing a UML diagram in the course of the software development process.

TRANSCRIPT

Page 1: UML and Software Modeling Tools.pptx

UML AND SOFTWARE MODELING TOOLS

Presented by

Obioma, Nwabueze N.

Page 2: UML and Software Modeling Tools.pptx

Unified Modeling Language (UML) is an industry standard modeling language with a rich graphical notation, and comprehensive set of diagrams and elements.

A standard language of creating visual models of business processes and functionality, interpreting user activities and client requirements of a software intensive system before any actual implementation in code.

It’s a useful in specifying, visualizing, constructing and documenting software systems in software development methods.

What is UML?

Page 3: UML and Software Modeling Tools.pptx

o A major reason for constructing a UML diagram is to manage complexity that is found in developing large software projects.

o UML models can be used to capture all the software development processes of analysis, specification, code generation, design and testing. So each model will capture all the decisions made in each process.

o So UML not only documents the results but also is used to arrive at the results themselves

o UML is not a development method, but is designed to compatible with object oriented software development methods.

Why do we need UML?

Page 4: UML and Software Modeling Tools.pptx

UML diagrams of a system can be represented using its:

Structural View: Which places an emphasis on the static structure of the

system using objects, attributes, operations and relationships.

Behavioral View: Which emphasizes the dynamic behavior of the system

by showing collaborations among objects and changes to the internal states of objects.

UML Diagram Categories

Page 5: UML and Software Modeling Tools.pptx

UML Categories

Page 6: UML and Software Modeling Tools.pptx

Class diagram: describes the structure of a system by showing the system's classes, their attributes, and the relationships among the classes.

Component diagram: describes how a software system is split up into components and shows the dependencies among these components.

Composite structure diagram: describes the internal structure of a class and the collaborations that this structure makes possible.

Structural View Overview

Page 7: UML and Software Modeling Tools.pptx

Deployment Diagram: describes the hardware used in system implementations and the execution environments and artifacts deployed on the hardware.

Object Diagram: shows a complete or partial view of the structure of an example modeled system at a specific time.

Package Diagram: describes how a system is split up into logical groupings by showing the dependencies among these groupings.

Profile diagram: operates at the metamodel level to show stereotypes as classes with the <<stereotype>> stereotype, and profiles as packages with the <<profile>> stereotype. The extension relation (solid line with closed, filled arrowhead) indicates what metamodel element a given stereotype is extending.

Structural Views Cont.…

Page 8: UML and Software Modeling Tools.pptx

Behavioral View Overview

Activity Diagram: describes the business and operational step-by-step workflows of components in a system. An activity diagram shows the overall flow of control.

UML State Machine diagram: describes the states and state transitions of the system.

Use Case Diagram: describes the functionality provided by a system in terms of actors, their goals represented as use cases, and any dependencies among those use cases.

Page 9: UML and Software Modeling Tools.pptx

Behavioral View Cont.…

The Following are sub categories of Behavioral views know as Interaction UML

Communication diagram : shows the interactions between objects or parts in

terms of sequenced messages. They represent a combination of information taken from Class, Sequence, and Use Case Diagrams describing both the static structure and dynamic behavior of a system.

Interaction overview diagram: provides an overview in which the nodes represent communication diagrams.

Sequence diagram: shows how objects communicate with each other in terms of a sequence of messages. Also indicates the lifespans of objects relative to those messages.

Timing diagrams: a specific type of interaction diagram where the focus is on timing constraints.

Page 10: UML and Software Modeling Tools.pptx

UML is a very broad subject and for this presentation we will discuss,1. The Behavioral View of a Job Application System using:

Activity Diagram Use Case Diagram

2. The Structural View using , Class Diagram Component Diagram

Page 11: UML and Software Modeling Tools.pptx

Activity DiagramActivity diagram describes the flow control from one activity to another.

These diagrams are used to model high level view of business requirements.

It is also used to construct the executable system by using forward and reverse engineering techniques

Page 12: UML and Software Modeling Tools.pptx

Things to know before Drawing an Activity Diagram

we must have a clear understanding about the elements used in an activity diagram

The following should be identified before drawing an activity diagram

Activities Association Conditions Constraints

An activity is a function performed by the system After identifying the activities we need to

understand how they are associated with constraints and conditions

Page 13: UML and Software Modeling Tools.pptx

Use Case Diagram

Use case diagram is used to capture the dynamic nature of a system. It consists of use cases, actors and their relationships.

Use case diagram is used at a high level design to capture the requirements of a system. So it represents the system functionalities and their flow.

Page 14: UML and Software Modeling Tools.pptx

Things to Know Before Drawing a Use Case Diagram

Functional Requirements of the system and its components.

Identify external and internal factors influencing the system.

Interaction among the requirements are actors. The actors can be a human user, some internal

applications or may be some external applications.

Functional requirement to be represented as an use case

Relationships among the use cases and actors.

Page 15: UML and Software Modeling Tools.pptx

Component diagrams are used to show the structural relationships between the components of a system.

Components are represented as a rectangular classifier with the keyword «component»; optionally the component may be displayed as a rectangle with a component icon in the right-hand upper corner.

Component Diagram

Page 16: UML and Software Modeling Tools.pptx

Component Diagram Cont..

In UML 2, components are considered autonomous, encapsulated units within a system or subsystem that provide one or more interfaces (An interface is a collection of operations that are used to specify a service of a component).

The interfaces provided represent the formal contract of services the component provides to its consumers/clients. So a component encapsulates behavior and implements interfaces.

Component

InterfaceRelationship

Page 17: UML and Software Modeling Tools.pptx

The assembly connector bridges a component’s required interface (Job Application portal) with the provided interface of another component (User Applicant); this allows one component to provide the services that another component requires.

Connectors and Ports

Provided Interface Required Interface

Using Ports with component diagrams allows for a service or behavior to be specified to its environment as well as a service or behavior that a component requires. Ports may specify inputs and outputs as they can operate bi-directionally.

Page 18: UML and Software Modeling Tools.pptx

Sample Component Diagram

Job Application System Component Diagram Representation

Page 19: UML and Software Modeling Tools.pptx

Class Diagram Class diagrams model static class relationships that represent the

fundamental architecture of the system. A class diagram consists of the following features:

Classes: These titled boxes represent the classes in the system and contain information about the name of the class, fields, methods and access specifiers.

`

Abstract roles of the class in the system can also be indicated. Interfaces: These titled boxes represent interfaces in the system and

contain information about the name of the interface and its methods.

Page 20: UML and Software Modeling Tools.pptx

Class Diagram RelationshipsAssociation A structural link between two peer classes. There is an association between UserRoles and HR_User

Other forms of Association are:Composition:A composition models the notion of one object "owning"another and thus being responsible for the creation and destruction of another object.Aggregation:. An aggregation models the notion that one object uses another object without "owning" it and thus is not responsible for its creation or destruction.

Page 21: UML and Software Modeling Tools.pptx

GeneralizationThe Generalization relationship ("is a") indicates that one of the two related classes (the subclass) is considered to be a specialized form of the other (the super type) and superclass is considered as 'Generalization' of subclass.

The generalization relationship is also known as the inheritance or "is a" relationship. The super class(base class) in the generalization relationship is also known as the "parent", superclass, base class, or base type.

Super class is Person withSub classes Applicants and HR_Users

Page 22: UML and Software Modeling Tools.pptx

Class Responsibilities

Knowing a. knowing about private encapsulated data b. knowing about related objects c. knowing about things it can derive or calculate Doing a. doing something itself, such as creating an object or doing Calculation a. initiating action in other objects b. controlling and coordinating activities in other objects

Page 23: UML and Software Modeling Tools.pptx

Class Diagram Cont.…Job Application System Class Diagram Representation

Page 24: UML and Software Modeling Tools.pptx

ERD Data Model

Page 25: UML and Software Modeling Tools.pptx

Entity Relationship Diagram

Entity Relationship Diagrams (ERDs) is a data model that identifies the concepts or entities that exist in a system and the relationships between those entities. An ERD is often used as a way to visualize a relational database: each entity represents a database table, and the relationship lines represent the keys in one table that point to specific records in related tables.

ERDs may also be more abstract, not necessarily capturing every table needed within a database, but serving to diagram the major concepts and relationships. So it can be used in the database design process for an e-resource management system, but does not identify every table that would be necessary for an electronic resource management database

Note that ERD are data models and are not UML model diagrams, though some modeling tools use the representation of the data model to generate Class Diagrams and other UML diagrams.

Page 26: UML and Software Modeling Tools.pptx

Understanding the ModelEntities An entity might be considered a container that holds all of the instances of a particular thing in a system. Entities are equivalent to database tables in a relational database, with each row of the table representing an instance of that entity.

The diagram has an entity for “LoginDetails” This indicates that the system being modeled may contain one or more LoginDetails. The table representation is shown below, showing each attribute as a column

Page 27: UML and Software Modeling Tools.pptx

Understanding The ERD Cont.…

RelationshipsRelationships are represented by lines between entities. Relationship lines indicate that each instance of an entity may have a relationship with instances of the connected entity, and vice versa.

The diagram above infers that there is a relationship between Applicant and ScannedDocument. So an Applicant has zero or more ScannedDocument(s) or ScannedDocument has an Applicant

Page 28: UML and Software Modeling Tools.pptx

ERD Relationship Cont.….

Recursive Relationships Instances of entities may have relationships with other instances of the same entity. These relationships may be drawn with relationship lines that begin and end connected to the same entity. Common occurrences of these recursive relationships include User/Friend relationships for a social networking site: 

The diagram indicates that a user may be the friend of zero or many users, and that a user may have zero or one friend. (Not every user’s friend will be recorded in the system, so the relationship is modeled as optional).

Page 29: UML and Software Modeling Tools.pptx

ERD RelationshipsMultiple Relationships Between Entities An entity may have multiple relationships with another entity. In the sample ERD section shown below a HR_User can have one or more UserRoles and a UserRole can be assigned to zero or more HR_Users. So a mapper entity is used “HR_User_UserRoles” is used to map the multiple relationship between the entities

Page 30: UML and Software Modeling Tools.pptx

Understanding The ERD Cont.…

Optionality and CardinalitySymbols at the ends of the relationship lines indicate the optionality and the cardinality of each relationship. “Optionality” expresses whether the relationship is optional or mandatory. “Cardinality” expresses the maximum number of relationships.Where the end of a relationship line meets an entity two symbols will appear. The first of those is the optionality indicator.

A circle ( ) indicates that the relationship is optional—the minimum number of relationships between each instance of the first entity and instances of the related entity is zero.

A stroke ( | ) indicates that the relationship is mandatory—the minimum number of relationships between each instance of the first entity and instances of the related entity is one.

Page 31: UML and Software Modeling Tools.pptx

Understanding The ERD Cont.…The second symbol indicates cardinality.

A stroke ( | ) indicates that the maximum number of relationships is one.

A “crows-foot” ( ) indicates that many such relationships between instances of the related entities might exist.

All Possible Combinations of two entities

Each instance of A is related to zero or more instances of B

Each instance of C is related to a maximum of one instance of D

Each instance of E is related to one or more instances of F

Each instance of G is related to zero or one instance of H

Page 32: UML and Software Modeling Tools.pptx

ERD Data ModelJob Application System ERD Representation

Page 33: UML and Software Modeling Tools.pptx

Modeling Tools

Page 34: UML and Software Modeling Tools.pptx

UML modeling tool is a software application that is used in the creation and editing of diagrams associated with some or all of the notation and semantics of the Unified Modeling Language (UML).

UML Modeling tools are useful tools in Software Engineering, Application Analysis and Development and Testing using various functions as shown in the next slides.

What is a UML Modeling Tool?

Page 35: UML and Software Modeling Tools.pptx

Code Generation

UML diagrams which have some connoted model data can be used by a UML tool to derive from the part or all of the source code in the any of the major programming languages for a software system.

In some tools the user can provide a skeleton of the program source code, in the form of a source code template, where predefined tokens are then replaced with program source code parts during the code generation process.

Page 36: UML and Software Modeling Tools.pptx

Some UML tools can read program source code or the database schema as input and derive a model data and its corresponding graphical UML diagrams from it.

This is useful in situations where a graphical description of an inherited software application is required where only the database or the source code is available

Reverse Code Generation

Page 37: UML and Software Modeling Tools.pptx

UML diagrams can be used to design object relation models which can be used as input to generate databases schema for major relational database managements systems such as MySQL, MS SQL Server, Oracle, PostgresSQL, DB2 etc.

The database schema can be reverse engineered to build other UML graphical models and source code of the software system

Database Generation

Page 38: UML and Software Modeling Tools.pptx

UML diagrams are model-driven architecture initiative that have the capacity to transform a model into another model.

An example is to transform a platform-independent domain model into a Java or PHP5 platform-specific model for implementation. It is also possible to refactor UML models to produce more concise and well-formed UML models

Model Transformation

Page 39: UML and Software Modeling Tools.pptx

Some UML Tools UML Tool Code

(Languages)Generated

Reverse Engineered Language

Can be Integrated with

Software License

Development Programming Language

BOUML C++, Java, PHP, IDL, Python

C++, Java, PHP Commercial from Ver. 5.0

C++/Qt

Visual Paradigm for UML

Java, C#, C++, PHP, Ada, Action Script (all only in commercial version)

Java, C# (binary), C++, PHP (all only in commercial version)

Eclipse, NetBeans and IntelliJ

Free Community version, Commercial Version

Java

Enterprise Architect ActionScript, C, C#,

C++, Delphi, Java, PHP, Python, Visual Basic, Visual Basic .NET, DDL, EJB, XML Schema, Ada, VHDL, Verilog, WSDL, BPEL, Corba IDL

ActionScript, C, C#, C++, Delphi, Java, PHP, Python, Visual Basic, Visual Basic .NET, DDL, XML Schema, WSDL

Eclipse, Visual Studio, TcSE

Commercial C, C++, C#, Java, PHP, Delphi, VB, Actionscript

Magic Draw UML Java, C++, C#, CIL, CORBA IDL, DDL, EJB, XML Schema, WSDL

Java, C++, C#, CIL, CORBA IDL, DDL, EJB, XML Schema, WSDL

Eclipse, EMF, NetBeans

Commercial Java

Rational Rhapsody(IBM)

C++, C, Java, Ada, C#, Corba, Customizable for other languages

C++, C, Java, Ada, C#, Customizable for other languages

Visual Studio, Eclipse, TcSE, WindRiver, Green Hills, Qnx, Linux,

Commercial C++

Umbrello UML Modeller

C++, Java, Perl, PHP, Python 

C++, IDL, Pascal/Delphi, Ada, Python, Java; import XMI, RoseMDL

KDE

General Public Licnese

C++, KDE

Page 40: UML and Software Modeling Tools.pptx

Sample Database/Code Generation Using Visual Paradigm

Page 41: UML and Software Modeling Tools.pptx

Visual Paradigm for UML (VP-UML) is a powerful, cross-platform and yet the most easy-to-use visual UML modeling and CASE tool.

 It provides software developers the cutting edge development platform to build quality applications faster, better and cheaper

What Visual Paradigm for UML provides.

Visual Paradigm Editions Enterprise Edition Professional Edition Standard Edition Modeler Edition Community Edition

Page 42: UML and Software Modeling Tools.pptx

Available Features

Requirement Modeling Database Modeling(ERD)Business Process Modeling Object Relational Mapping(ORM)Team Collaboration Document Generation

UML diagrams available in  VP-UML include:

Class Diagram Use Case DiagramSequence Diagram Communication DiagramState Machine Diagram Activity DiagramComponent Diagram Deployment DiagramPackage Diagram Object DiagramComposite Structure Diagram Timing DiagramInteraction Overview Diagram

Page 43: UML and Software Modeling Tools.pptx

For the sample code and database generation I am using Visual Paradigm’s Smart Development Environment plug in for NetBeans/Sun™ ONE Enterprise Edition. (Go to http://www.visual-paradigm.com/resource/netbeans-plugin.jsp for more information)

A. Using the Job Application Entity Relationship Diagram data model previously shown we can generate a database for any of the database options:

MySQL MS SQL Server PostgresSQL Sybase Informix DB2 etc.

For this presentation , a MySQL Database schema will be generated

Page 44: UML and Software Modeling Tools.pptx

B. Using the Job Application Class Diagram, code can be generated in any of the following languagesJavaPHPC# etc.

For this presentation PHP class files will be generated.

Note that code generated contains no logic or any application process flow, but object classes that a direct representation of the class object diagrams. So you still have develop the logic of your application.

Page 45: UML and Software Modeling Tools.pptx

Starting up the SDE for NetBeans, the database selected has to be configured to enable a successful database generation

DATABASE CONFIGURATION

Browse to the location of the

database adapter fileSelect the Adapter Driver

Data Source Name Details of the Database

Test the database configuration

Save the configuration

Page 46: UML and Software Modeling Tools.pptx

Right Clicking in the Class Diagram View, navigate to the ORM option and select Wizards..

Note: VP SDE provides other ways to generate database and code. Select anyOf the options you find convenient.

Page 47: UML and Software Modeling Tools.pptx

Select the Language to generate to

Select the option to generate from class diagram

Click on Next

Page 48: UML and Software Modeling Tools.pptx

Select the classes that you want to be persistable (i.e. Tables generated )

Click on Next

Page 49: UML and Software Modeling Tools.pptx

Edit the names of the Table or Class to be generated

The attribute names, column names of the Class and Table respectively of the currently selected options above. These fields are also editable .

Click on Next

Page 50: UML and Software Modeling Tools.pptx

Select option of creating, update, drop and create or drop database

Check to generate DDL file for the database

Update Database Settings as appropriate

Test Connection

Click on Next

Page 51: UML and Software Modeling Tools.pptx

Browse to location where the Class files will be generated to.

Select if the code’s programming interfaceName of the directory source

Click on Finish

Page 52: UML and Software Modeling Tools.pptx

Viewed using HeidiSQL 7.0

Generated Database Structure

Page 53: UML and Software Modeling Tools.pptx

Generate PHP CodeTo Generate PHP Class codes select the instant Generator from the Modeling menu option and select PHP.

Page 54: UML and Software Modeling Tools.pptx

Browse to location where you want to generate the location

Select Class Diagram to generate code from

Click to preview structure of generated codes

Generate PHP Code

Page 55: UML and Software Modeling Tools.pptx

PHP Class files Generated

Classes been generated

Page 56: UML and Software Modeling Tools.pptx

Generated Classes

Page 57: UML and Software Modeling Tools.pptx

QUESTIONS?

Page 58: UML and Software Modeling Tools.pptx

www.wikipedia.orghttp://www.visual-paradigm.com/http://www.ibm.com/developerworks/rational/libraryhttp://www.mu.ac.in/Object Oriented Modeling and Design using UML

References