0% found this document useful (0 votes)
8 views

Oosd Unit-1 Modelling

Uploaded by

Akshay Dwivedi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Oosd Unit-1 Modelling

Uploaded by

Akshay Dwivedi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Introduction to UML

What is UML?
UML: Unified Modeling Language

⚫ An industry-standard graphical language for specifying,


visualizing, constructing and documenting the software
systems, as well as for business modeling.

⚫ The UML uses mostly graphical notations to express the OO


modeling and design of software projects.

⚫ Simplifies the complex process of software design


Why we use UML?

฀ Use graphical notation: more clearly than natural language and code.

฀ Help acquire an overall view of a system.

฀ UML is not dependent on any one language or technology.


How to use UML diagrams to design software system?

⚫ Types of UML Diagrams:

฀ Use Case Diagram


฀ Class Diagram
฀ Sequence Diagram
฀ Collaboration Diagram
฀ State Diagram
Different Views

Users Designers Analyzers

13
UML Diagram –
The Unified Modeling Language (UML) is a standard language for

Specifying Visualizing Constructing Documenting

Business Modeling Communications

14
Object-Oriented Modelling and
Design
⚫ Object-Oriented Modelling and Design is a way of
thinking about problems using models organized around
real world concepts. The fundamental construct is the
object, which combines both data and behaviour.
Objects
⚫ An object has:

⚫ state - descriptive characteristics

⚫ behaviors - what it can do (or what can be done to it)

⚫ The state of a bank account includes its account number and its
current balance
⚫ The behaviors associated with a bank account include the
ability to make deposits and withdrawals
⚫ Note that the behavior of an object might change its state

17
Objects

• Objects have three responsibilities:


What they know about themselves – (e.g., Attributes)

What they do – (e.g., Operations)

What they know about other objects – (e.g., Relationships)

18
19
Objects
⚫ Software objects model read-world objects or abstract concepts
● dog, bicycle, Bank account
⚫ Real-world objects have states and behaviors
●Dogs' states: name, color, breed, hungry
●Dogs' behaviors: barking fetching
●Bicycle ‘s State :
●Bicycle’ s behavior :
⚫ Other examples of objects are:
⚫ myself – an instructor object.
⚫ you – a student object
⚫ this room – a room object
⚫ this university
⚫ your car, etc.
What is Object-Orientation about?
⚫ One of the key challenges faced by Computer Scientist is how to handle complexity.

⚫ Two main concepts used to manage complexity are Modularity and Abstractions.
⚫ Modularity means breaking a large system up into smaller pieces until each
peace becomes simple enough to be handled easily.

⚫ Abstraction focus on essential aspects of an application while ignoring details.

⚫ Over the years, computer scientists have developed a number of approaches to


achieve modularity and abstraction.

⚫ The latest of these approaches is Object-Orientation or OO for short.

⚫ The key concept in OO is of course Object,


Object-Oriented
⚫ Software is organized as a collection of discrete objects that
incorporate both State and behavior.
⚫ Four aspects (characteristics) required by an OO approach
are -
Identity
Classification
Polymorphism
Inheritance

22
Identity
⦿ Identity means that data is organized into discrete,
distinguishable entities called objects.

⦿ E.g. for objects: personal computer, bicycle

⚫ ฀ Objects can be concrete (such as a file in a file system) or


conceptual (such as scheduling policy in a multiprocessing
OS). Each object has its own inherent identity. (i.e two objects
are distinct even if all their attribute values are identical).

23
24
Classification
⚫ It means that objects with same data structure (attribute) and
behavior (operations) are grouped into a class.

⚫ Each object is said to be an instance of its class.

⚫ A class is simply a representation of a type of object. It is the


blueprint/ plan/ template that describe the details of an object.

⚫ A class is the blueprint from which the individual objects are


created.

25
Classes – Example

Class
Attributes
Account
+Owner: Person
+Amount: double
+suspend()
+deposit(sum:double)
+withdraw(sum:double) Operations

26
Classes and Objects – Example

Class Object ivanAccount


+Owner=“ABC"
+Amount=5000.0
Account
+Owner: Person
+Amount: double
Object peterAccount
+suspend() +Owner=“XYZ"
+deposit(sum:double) +Amount=1825.33
+withdraw(sum:double)

kirilAccount
Object +Owner=“CSE”
27
+Amount=25.0
Object-Oriented Methodology
⦿ The process for OO development and graphical notation for
representing OO concepts consists of building a model of an
application and then adding details to it during design.
The methodology has the following stages:
฀ System conception : Software development begins with business
analysis or users conceiving an application and formulating tentative
requirements
฀ Analysis : The analyst must work with the requestor to understand
the problem, because problem statements are rarely complete or
correct.
The analysis model is a precise abstraction of what the desired
system must do, not how it will be done.
It should not contain implementation decisions.

37
Object-oriented methodology
The analysis model has 2 parts:

⚫ Domain model - a description of the real-world objects reflected


within the system
Eg: Domain objects for a stock broker

⚫ Application – model - a description of the parts of the application


system itself that are visible to the user.
Eg:- Application might include stock, bond, trade and commission.

Application objects might control the execution of trades and present


the results.
Object-oriented methodology
฀ System design: The development teams devise a high – level
strategy – the system architecture for solving the application
problem.
They also establish policies that will serve as a default for the
subsequent, more detailed portions of design.
The system designer must decide what performance characteristics to
optimize, choose a strategy of attacking the problem and make
tentative resource allocations.
฀ Class design : The class designer adds details to the analysis model
in accordance with the system design strategy.
The focus of class design is the data structures and algorithms needed
to implement each class.
Object-oriented methodology
฀ Implementation : Implementers translate the classes and
relationships developed during class design into particular
programming language, database or hardware.
During implementation, it is important to follow good software
engineering practice so that traceability to the design is
apparent and so that the system remains flexible and extensible.
Object oriented Themes
Abstraction: let’s focus on essential aspects of an application while
ignoring details.

Encapsulation :( Information Hiding) separates the external aspects


of an object , that are accessible to other objects from internal
implementation details.

Sharing (reuse)

Emphasis on the essence of an object: OO technology stresses


what an object is, rather than how it is used.

Synergy: Identity, classification, polymorphism, and inheritance


characterize OO languages. Use all together.
42
43
Evidence for usefulness of OO development
⚫ Applications at General Electric Research and Development Center.(1990)
⚫ OO techniques for developing compilers, graphics, user interfaces,
databases ,an OO language, etc.
⚫ OO technology is a part of the computer science and software engineering
mainstream.
⚫ Important forums: (OOPSLA,ECOOP) Object Oriented Programming
systems, Languages and applications. European Conference on OOP.
OO Modeling history
⚫ Work at GE R&D led to OMT(Object-Modeling Technique) in
1991.
⚫ Rumbaugh, Grady Booch on unifying the OMT and Booch Notaions
in 1994.
⚫ In 1996 the OMG(Object Management Group) issued a request for
the proposals for a standard OO modeling notation.
⚫ 1997 UML was accepted by OMG as a standard.
⚫ In 2001 OMG released UML
⚫ Added features and released UML in 2004.
www.omg.org
Year & Version of UML
2011:UML 2.4
2010:UML2.3
2009:UML2.2
2007: UML 2.1.1
2005: UML 2.0
2003: UML 1.5
2001: UML 1.4

2000: UML 1.3


1998: UML 1.2
1997: UML 1.0, 1.1
1996: UML 0.9 & 0.91
1995: Unified Method 0.8
Modeling as a Design
Technique
What is Modeling

⚫ Modeling consists of building an abstraction of reality.

⚫ Abstractions are simplifications because:


⚫ They ignore irrelevant details and
⚫ They only represent the relevant details.

⚫ What is relevant or irrelevant depends on the purpose of the


model.
What is a Model
A model is a simplification of reality.
A model may provide
⚫ blueprints of a system
⚫ Organization of the system
⚫ Dynamic of the system

49
MODEL
⚫ A model is an abstraction, before building any system a
prototype may be developed. The main purpose of model is
for understanding of the system.

⚫ Designer build different kinds of models for various purposes


before constructing things.

⚫ For example car , airplane, blueprints of machine parts, Plan


for house construction etc., Models serve many purposes
Importance of Modeling
⚫ Models help us
⚫ to visualize a system as it is or as we want it to be.
⚫ to specify the structure or behavior of a system.
⚫ in providing a template that guides us in constructing a
system.
⚫ in providing documenting the decisions we have made.

54
Purpose of Modeling
Designers build many kinds of models for various purposes
before constructing things.

Models serve several purposes –


⚫ Testing a physical entity before building (simulation)
⚫ Communication with customer
⚫ Visualization
⚫ Reduction of complexity
⚫ Better understanding of the problem
Purpose of Modeling
Communication with customers
Architects and product designers build models to show
their customers. Mock ups are demonstration products that
imitate some or all of the external behaviour of a system.
Purpose of Modeling

Visualization
Storyboards of movies, television shows and
advertisements let writers see how their ideas flow. They
can modify awkward transitions, and unnecessary
segments before detailed writing begins.
Purpose of Modeling

Reduction of complexity
The main reason for modeling is to deal with systems that
are too complex to understand directly. Models reduce
complexity by separating out a small number of important
things to deal with at a time.
Three models
We use three kinds of models to describe a system from different
view points.

1.Class Model for the objects in the system & their


relationships.

2. State model—for the life history of objects.


Show how systems behave internally
3. Interaction Model—for the interaction among objects.
Show the behaviour of systems in terms of how objects interact with
each other

You might also like