41
MODELING SOFTWARE Harsh Jegadeesan’s Harsh Jegadeesan’s Harsh Jegadeesan’s Harsh Jegadeesan’s CLASSROOM BITS Pilani Off-Campus Work-Integrated Learning Programmes

Modeling Software

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Modeling Software

MODELING SOFTWARE

Harsh Jegadeesan’s Harsh Jegadeesan’s Harsh Jegadeesan’s Harsh Jegadeesan’s CLASSROOM

BITS PilaniOff-Campus Work-Integrated Learning Programmes

Page 2: Modeling Software

ANALYSIS

� Analysis is a broad term. In Software development, we are primarily concerned with two forms of analysis.

� Requirements Analysis is discovering the requirements that a system must meet in order to be successful.to be successful.

� Object Analysis is investigating the object in a domain to discover information important to meet the requirements.

Friday, September 12, 2008

2

Object Oriented Analysis & Design

Page 3: Modeling Software

DESIGN

� Design emphasizes a conceptual solution that

fulfills the requirements. A design is not an

implementation, although a good design can be

implemented when it is complete.

� There are subsets of design, including � There are subsets of design, including

architectural design, object design, and database

design.

Friday, September 12, 2008

3

Object Oriented Analysis & Design

Page 4: Modeling Software

ANALYSIS AND DESIGN

�Analysis

�do the right thing

�Design�Design

�Do the thing right

Friday, September 12, 2008

4

Object Oriented Analysis & Design

Page 5: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

5

Object Oriented Analysis & Design

Page 6: Modeling Software

INDUSTRY SCORECARD� Startling revelations from the Standish Group (www.standishgroup.com) research (‘01) about software projects of US Corporations:

� Total IT Spend on Software Projects: $250 billion pa

� Average Project Cost – $430,000 – $2.3 million

� Cost Over-runs – 45%� Cost Over-runs – 45%

� Only 67% of functionality is

implemented

� Projects late/over-budget: 137, 000

� Project Failed: 65,000

� News: Project Success rates are up and

overruns are down ?!? (Compare ‘95)

Friday, September 12, 2008

6

Object Oriented Analysis & Design

49%

28%

23%

Challenged

Succeeded

Failed

Page 7: Modeling Software

INDUSTRY CHALLENGES

� Generality Vs. Specificity

� Ex. Specificity of Automobile Manufacturing Industry

Vs. Generality of the Software Industry

� Changing Requirements (Business/Platforms)

� Rising customer expectations with falling � Rising customer expectations with falling

budgets

� Developer need to acquire new skills

� Leverage maximum value from existing

applications

� Show quick ROI with lowTCO

Friday, September 12, 2008

7

Object Oriented Analysis & Design

Page 8: Modeling Software

INDUSTRY CHALLENGES [2]

� Development by hand from scratch using labor

extensive processes which are slow and expensive

� Problems of usability, reliability, performance

and security with businesses seeking higher

levels of automationlevels of automation

� Acute shortage of qualified developers leading to

escalating costs and time to market delays

� Tools lagging platform

Friday, September 12, 2008

8

Object Oriented Analysis & Design

Page 9: Modeling Software

ECONOMIC VIABILITY VARIABLES

Quality

Viability

� Economic viability is based on

how we can produce systems

whose quality and longevity are

in line with cost of production

Friday, September 12, 2008

9

Object Oriented Analysis & Design

Quality

� The history of Software industry

can be viewed as improvements

that rebalanced the viability of

the industry

Page 10: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

10

Object Oriented Analysis & Design

Page 11: Modeling Software

CRAFTSMANSHIP VS. INDUSTRIALIZED

PRODUCTION

� Software Industry is a ‘Cottage Industry’

� Development is similar to ‘Cottage Industry’

� Expectations are similar to manufacturing/services

industry

� Based on craftsmanship and Apprenticeship � Based on craftsmanship and Apprenticeship

which would never scale

� There is a need to automate menial and rote

development tasks and migrate resources to

high-end tasks.

Friday, September 12, 2008

11

Object Oriented Analysis & Design

Page 12: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

12

Object Oriented Analysis & Design

Page 13: Modeling Software

LEVELS OF ABSTRACTION

� Over the years the levels of abstraction have been increased

3GLs

Middleware / Platforms

Virtual Machine

Friday, September 12, 2008

13

Object Oriented Analysis & Design

1s and 0s

Assembly Language

3GLs

Operating SystemsLevel of Abstraction

Page 14: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

14

Object Oriented Analysis & Design

Page 15: Modeling Software

IMPORTANCE OF MODELING

� Requirement: Build a dog house

� Solution:

� Get raw materials: wood, nails and

hammer

� Build: Hammer the nails into the � Build: Hammer the nails into the

wood and build it

� Reaction:

� If your dog does not fit in rebuild

the house or change the dog.

Friday, September 12, 2008

15

Object Oriented Analysis & Design

Page 16: Modeling Software

IMPORTANCE OF MODELING

� Requirement: Build a house for your family

� Solution:

� Plan

� Sketch: Make rough sketches of how � Sketch: Make rough sketches of how the house will look

� Blueprint

� Manage team and build

� Reaction:

� If your family does not like it make minor modifications

Friday, September 12, 2008

16

Object Oriented Analysis & Design

Page 17: Modeling Software

IMPORTANCE OF MODELING�Requirement: Build a multi-

storied office building

�Solution:

� Plan

� Organize Team� Organize Team

� Model

� Blueprint

� Manage team and execute

�Reaction:

� If the tenets do not like it –

BIG Loss

Friday, September 12, 2008

17

Object Oriented Analysis & Design

Page 18: Modeling Software

SOFTWARE MODELING?

� Many organizations or projects,

� Start off with an idea of creating a multi-storied

building and end up doing what one must for a dog-

house

� Build a dog house first and then try to construct an

entire building over itentire building over it

� Most successful projects have one common thread

- ‘Use of Modeling’

Friday, September 12, 2008

18

Object Oriented Analysis & Design

Page 19: Modeling Software

SO WHAT IS MODELING AND WHY DO WE

MODEL?

� A model is a simplification of reality

� Helps us to visualize the end product

� Permits us to specify the structure and behavior

of a system

Gives us a template that guides us in � Gives us a template that guides us in

constructing the system

� Documents the decisions we have made

Friday, September 12, 2008

19

Object Oriented Analysis & Design

Page 20: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

20

Object Oriented Analysis & Design

Page 21: Modeling Software

WHAT IS MODEL DRIVEN

ARCHITECTURE?

� A New Way to Specify and Build Systems

� Based on modeling with UML (Formal executable

UML)

� Supports full lifecycle: analysis, design,

implementation, deployment, maintenance, evolution

& integration with later systems& integration with later systems

� Builds in Interoperability and Portability

� Lowers initial cost and maximizes ROI

Friday, September 12, 2008

21

Object Oriented Analysis & Design

Page 22: Modeling Software

BUILDING AN MDA APPLICATION

Start with a Platform-Independent Model (PIM) representing business functionality and behavior,

Platform-

Independent

Model

A Detailed Model, stating

Pre- and Post-Conditions

in OCL, and Semantics in

Action Language

Friday, September 12, 2008

22

Object Oriented Analysis & Design

and behavior, undistorted by technology details.

Page 23: Modeling Software

GENERATING PLATFORM-SPECIFIC MODEL

Platform-

Independent

Model

Map a PIM to

Specific

Middleware

Technologies via

OMG Standard

MDA tool applies a standard mapping to generate Platform-Specific Model (PSM)

Friday, September 12, 2008

23

Object Oriented Analysis & Design

OMG Standard

Mappings

Specific Model (PSM) from the PIM. Code is partially automatic, partially hand-written.

CORBA

Model

Page 24: Modeling Software

MAPPING TO MULTIPLE DEPLOYMENT

TECHNOLOGIES

Platform-

Independent

Model

MDA tool applies an standard mapping to

Friday, September 12, 2008

24

Object Oriented Analysis & Design

CORBA

Model

standard mapping to generate Platform-Specific Model (PSM) from the PIM. Code is partially automatic, partially hand-written.

Java/EJB

Model

XML/SOAP

Model

Other

Model

Map a PIM to Many

Middleware

Technologies via OMG

Standard Mappings

Page 25: Modeling Software

GENERATING IMPLEMENTATIONS

Platform-

Independent

Model

MDA Tool generates all or most of the

Map PSM to application

interfaces, code, GUI

descriptors, SQL

queries, etc.

Friday, September 12, 2008

25

Object Oriented Analysis & Design

CORBA

Model

or most of the implementation code for deployment technology selected by the developer.

Java/EJB

Model

CORBA

XML/SOAP

Model

Java/EJB XML/SOAP Other

Other

Model

Page 26: Modeling Software

INTEGRATING LEGACY & COTS

Platform-

Independent

Model

Legacy

MDA Tools for reverse engineering automate COTS Other

Friday, September 12, 2008

26

Object Oriented Analysis & Design

Legacy

App

engineering automate discovery of models for re-integration on new platforms.

COTS

App

Other

Other

Model

Reverse-engineer

existing application

into a model and

redeploy.

Page 27: Modeling Software

AUTOMATING BRIDGES

Platform-

Independent

Model

MDA Tools

combine

Bridge generation is simplified by common

Friday, September 12, 2008

27

Object Oriented Analysis & Design

CORBA

Model

XML/SOAP

Model

CORBA

System

XML/SOAP

SystemInterop

Bridge

combine

application and

platform

knowledge to

generate bridges

simplified by common application models, simplifying creation of integrated applications both within and across enterprises.

Page 28: Modeling Software

AGENDA

� Software Industry Landscape

� Craftsmanship Vs. Industrial Production

� Levels of Abstraction

� Modeling

Model-Driven Architecture (MDATM)� Model-Driven Architecture (MDATM)

� Unified Modeling Language (UML)

Friday, September 12, 2008

28

Object Oriented Analysis & Design

Page 29: Modeling Software

SOFTWARE MODELING – USING UML

� Unified Modeling Language is a standard language for creating software blueprints

� UML may be used to

� Visualize,

� Specify,� Specify,

� Construct and

� Document

the artifacts of a software system.

Friday, September 12, 2008

29

Object Oriented Analysis & Design

Page 30: Modeling Software

WHAT IS UML?

� A set of graphical notations that help in describing and

designing software systems

� The graphical notations are defined by a meta model

(more about it as we go further in the course)

� An open standard controlled by the Object Management � An open standard controlled by the Object Management

Group (OMG)

� It is a unification of many graphical modeling languages

that existed in the 80s and 90s

Friday, September 12, 2008

30

Object Oriented Analysis & Design

Page 31: Modeling Software

WHY UML? – THE ADVANTAGES

� UML makes communication across the software

development life cycle standardized through

visual models

� Makes analysis, architecture and design artifacts

codifiedcodified

� UML helps to ease in the rigor of design-before-

coding practice (Design by Contract)

� Lastly, UML could become executable like a

programming language. (The core idea behind

Model Driven Architecture)

Friday, September 12, 2008

31

Object Oriented Analysis & Design

Page 32: Modeling Software

UML DIAGRAMS

� Diagrams are central to the UML notation

� Diagrams have to be drawn only wherever necessary

� Each diagram has its own best-context, where it suits the

best

� A diagram needs to show only what fits in a context� A diagram needs to show only what fits in a context

� Every diagram is as formal as a programming language

Friday, September 12, 2008

32

Object Oriented Analysis & Design

Page 33: Modeling Software

UML DIAGRAMS TYPES

UML Diagram

Friday, September 12, 2008

33

Object Oriented Analysis & Design

Structure diagram Behavior diagram

Page 34: Modeling Software

STRUCTURE DIAGRAMS

� Class diagram - Class, features, and relationships

� Object diagram - Example configurations of instances

� Component diagram - Structure and connections of componentsComponent diagram - Structure and connections of components

� Package diagram - Compile diagram - time hierarchic structure

� Deployment diagram - Deployment of artifacts to nodes

� Composite structure diagram - Runtime decomposition of a class

Friday, September 12, 2008

34

Object Oriented Analysis & Design

Page 35: Modeling Software

BEHAVIOR DIAGRAMS

� Use case diagram - How users interact with a system

� Sequence diagram - Interaction between objects; emphasis on sequence

� Communication diagram - Interaction between objects; emphasis on links

Activity diagram - Procedural and parallel behavior� Activity diagram - Procedural and parallel behavior

� State machine diagram - How events change an object over its life

� Interaction overview diagram - Mix of sequence and activity diagram

� Timing diagram - Interaction between objects; emphasis on timing

Friday, September 12, 2008

35

Object Oriented Analysis & Design

Page 36: Modeling Software

EXAMPLE – DICE GAME

� Requirements for a dice game:

� A player rolls two die

� If the total is seven, he/she wins;

� Otherwise he/she loses

All this fine, but how do we put it in practice?� All this fine, but how do we put it in practice?

Friday, September 12, 2008

36

Object Oriented Analysis & Design

Define Use

Cases

Define Domain

Model

Define Interaction

Diagrams

Define design

class diagrams

1 2 3 4

Page 37: Modeling Software

STEP 1: WRITE USE CASES

� A use case is a written story that describes the goal of an

actor (a user) who uses the system

� Use case name: “Play a dice game”

� Description: A player picks up and rolls the dice. If the dice

face value totals seven he/she wins; otherwise he/she loses.

Friday, September 12, 2008 Object Oriented Analysis & Design

37

Page 38: Modeling Software

STEP 2: DRAW DOMAIN MODEL

� Domain model includes concepts in the domain, attributes of these concepts and their associations

Friday, September 12, 2008 Object Oriented Analysis & Design

38

Page 39: Modeling Software

STEP 3: DRAW INTERACTION DIAGRAM

� Interaction diagram captures the interactions between objects in the system to accomplish a scenario or system event

Friday, September 12, 2008 Object Oriented Analysis & Design

39

Page 40: Modeling Software

STEP 4: DRAW CLASS DIAGRAM

� The class diagram includes classes, their attributes and

operations and their relationships

-dieOne : Die

-dieTwo : Die

DiceGame

+Roll() : int

-nFaceValue : int

Die

1..*+Play() : bool

+Roll() : int1 1..*

2 Die objects per DiceGame object

Friday, September 12, 2008 Object Oriented Analysis & Design

40

Page 41: Modeling Software

REFERENCES

� “UML Distilled”, 3rd Edition by Martin Fowler

� “The UML User Guide”, by Grady Booch, James

Rumbaugh and Ivar Jacobson

� “Applying UML and Patterns”, by Craig Larman

“UML 2 Toolkit”, by Hans-Erik Eriksson et al.� “UML 2 Toolkit”, by Hans-Erik Eriksson et al.

� “Model Driven Architecture”, by David S. Frankel

� “Software Factories”, by Jack Greenfield et al.

Friday, September 12, 2008

41

Object Oriented Analysis & Design