SlideShare a Scribd company logo
1 of 33
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Object & Class Diagram
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
• Objects:
– a concept, abstraction, or thing with identity that has meaning for an
application.
– often appear as proper nouns or specific references in problem
descriptions
– All objects have identity and are distinguishable
– the choice of objects depends on judgment and the nature of problem
• Classes:
– Describes a group of objects with the same properties (attributes),
behavior (operations), kinds of relationships and semantics.
– Often appear as common nouns and noun phrases in problem
description.
– Objects in a class have the same attributes and forms of behavior
• Difference in attribute values and specific relationship to other objects
– The choice of classes depends on the nature and scope of an
application and is matter of judgment
– The interpretation of semantics depends on the purpose of each
application and is a matter of judgment.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
• The class model captures the static view of an
system
– by characterizing the objects in the system
– the relationship between the objects
– and the attributes and operations for each class of objects
• Class diagram is not only used for visualizing,
describing and documenting different aspects of a
system but also for constructing executable system
through forward and reverse engineering.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
• The class diagram is the main building block of
object oriented modeling.
• used for
– general conceptual modeling of the systematics of the
application
– detailed modeling translating the models into
programming code.
• Class diagrams can also be used for data modeling
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
• describes the attributes and operations of a class
and also the constraints imposed on the system.
• widely used in the modeling of object oriented
systems
– can be mapped directly with object oriented
languages
– widely used at the time of construction.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
• The class diagram shows a collection of
classes, interfaces, associations,
collaborations and constraints. It is also
known as a structural diagram.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Object Diagram
JoeSmith:Person MaySharp:Person :Person
Objects
An object diagram shows individual objects and their relationships
•Helpful for documenting test cases
A class diagram corresponds to an infinite set of object diagrams.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class and Objects
JoeSmith:Person MaySharp:Person :Person
Objects
Person
Class
Fig: Objects and Classes are the focus of class modeling
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
Class Name
Attributes
Operations
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class and Object
• First, there is the division of class and object.
– A class is an abstraction;
– an object is one concrete manifestation of that
abstraction.
• In the UML, you can model classes as well as
objects, as shown in following Figures
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class and Object
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Purpose of Class Diagram
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Purpose of Class Diagram
• The purpose of the class diagram can be
summarized as:
To describe objects.
Analysis and design of the static view of an
application.
Describe responsibilities of a system.
Base for component and deployment diagrams.
Forward and reverse engineering
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Visibility in UML
To specify the visibility of a class member (i.e., any
attribute or method) these are the following
notations that must be placed before the member's
name:
"+" Public
"-" Private
"#" Protected
"/" Derived (can be combined with one of the
others)
“~" Static
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
How to draw Class Diagram
???
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
How to draw Class Diagram???
• Class diagram is basically a graphical
representation of the static view of the system
and represents different aspects of the
application. So a collection of classes represent
the whole system.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
The following points should be remembered
while drawing a class diagram:
• The name of the class diagram should be meaningful
to describe the aspect of the system.
• Each element and their relationships should be
identified in advance.
• Responsibility (attributes and methods) of each class
should be clearly identified.
• For each class minimum number of properties should
be specified. Because unnecessary properties will
make the diagram complicated.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Contd.. :
• Use notes when ever required to describe some
aspect of the diagram.
• at the end of the drawing it should be
understandable to the developer/coder.
• Finally, before making the final version, the diagram
should be drawn on plain paper and rework as many
times as possible to make it correct.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
“Order System”
• First of all Order and Customer are identified as the
two elements of the system and they have a one to
many relationship because a customer can have
multiple orders.
• We would keep Order class is an abstract class and it
has two concrete classes (inheritance relationship)
SpecialOrder and NormalOrder.
• The two inherited classes have all the properties as
the Order class. In addition they have additional
functions like dispatch () and receive ().
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram for Order System
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Relationships among Classes
• Links
– the basic relationship among objects
– a tuple i.e. the list of objects
– an instance of an association
• Association
– represents a family of links with common structure and semantics.
– Links of an association connect objects from same classes.
– Describes a set of potential links
– Binary associations (with two ends) are normally represented as a line.
Fig: Class diagram example of association between two classes
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Notation
• Link
– line between objects
– If the link has name, it is underlined
• Association
– Line between related classes
– Association name is optional, if unambiguous
• Ambiguity arise when a model has multiple associations among
the same classes
– Bidirectional
• Can be traversed in either direction and equally meaningful
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram with All Relationships
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram: Generalization
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram: Association Names
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram: Roles
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram: Aggregation
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Relationships among Classes
• Multiplicity
– Multiplicity specifies the number of instances of
one class that may relate to a single instance of an
associated class.
– Multiplicity constrains the number of related
objects.
– a subset of nonnegative integers.
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Multiplicity
• UML specifies multiplicity with an interval,
such as..
0..1 No instances, or one instance (optional, may)
1 Exactly one instance
0..* or *  Zero or more instances
1..*  One or more instances (at least one)
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Class Diagram: Multiplicity
Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
Association Types
• Aggregation
– a variant of the "has a" association relationship;
– aggregation is more specific than association
– It is an association that represents a part-whole or
part-of relationship.
– can occur when a class is a collection or container of
other classes, but where the contained classes do not
have a strong life cycle dependency on the container
– if the container is destroyed, its contents are not.

More Related Content

What's hot

Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLAjit Nayak
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramKumar
 
09 package diagram
09 package diagram09 package diagram
09 package diagramBaskarkncet
 
state modeling In UML
state modeling In UMLstate modeling In UML
state modeling In UMLKumar
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing StrategiesAlpana Bhaskar
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewRajiv Kumar
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classificationgopal10scs185
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologiesnaina-rani
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationmewaseem
 
Component Diagram Example Templates
Component Diagram Example TemplatesComponent Diagram Example Templates
Component Diagram Example TemplatesCreately
 

What's hot (20)

Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
09 package diagram
09 package diagram09 package diagram
09 package diagram
 
Unit 4
Unit 4Unit 4
Unit 4
 
state modeling In UML
state modeling In UMLstate modeling In UML
state modeling In UML
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief Overview
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classification
 
Unit 5
Unit 5Unit 5
Unit 5
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Object oriented methodologies
Object oriented methodologiesObject oriented methodologies
Object oriented methodologies
 
Object modeling
Object modelingObject modeling
Object modeling
 
Behavioural modelling
Behavioural modellingBehavioural modelling
Behavioural modelling
 
Use case Diagram
Use case DiagramUse case Diagram
Use case Diagram
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Component Diagram Example Templates
Component Diagram Example TemplatesComponent Diagram Example Templates
Component Diagram Example Templates
 
State Diagrams
State DiagramsState Diagrams
State Diagrams
 
Ooad unit – 1 introduction
Ooad unit – 1 introductionOoad unit – 1 introduction
Ooad unit – 1 introduction
 

Viewers also liked

ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in javaAtul Sehdev
 
Using class and object java
Using class and object javaUsing class and object java
Using class and object javamha4
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagramSadhana28
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPTPooja Jaiswal
 

Viewers also liked (6)

ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in java
 
Using class and object java
Using class and object javaUsing class and object java
Using class and object java
 
Object and class
Object and classObject and class
Object and class
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Class and object_diagram
Class  and object_diagramClass  and object_diagram
Class and object_diagram
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 

Similar to classes & objects introduction

UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxviju001
 
Chapter 6 Object Modeling .pptxInformation Technology Project Management
Chapter 6 Object Modeling .pptxInformation Technology Project ManagementChapter 6 Object Modeling .pptxInformation Technology Project Management
Chapter 6 Object Modeling .pptxInformation Technology Project ManagementAxmedMaxamuudYoonis
 
chapter06-120827115400-phpapp01.pdf
chapter06-120827115400-phpapp01.pdfchapter06-120827115400-phpapp01.pdf
chapter06-120827115400-phpapp01.pdfAxmedMaxamuud6
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)riarana10
 
Object-Oriented Systems Analysis and Design Using UML.pptx
Object-Oriented Systems Analysis and Design Using UML.pptxObject-Oriented Systems Analysis and Design Using UML.pptx
Object-Oriented Systems Analysis and Design Using UML.pptxXanGwaps
 
New phase ii-2010
New  phase ii-2010New  phase ii-2010
New phase ii-2010vijet
 
Object oriented analysis and design
Object oriented analysis and designObject oriented analysis and design
Object oriented analysis and designnaveed428
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientationDr Chetan Shelke
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software EngineeringAmit Singh
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisLuis Goldster
 

Similar to classes & objects introduction (20)

SMD Unit ii
SMD Unit iiSMD Unit ii
SMD Unit ii
 
classdiagram.pptx
classdiagram.pptxclassdiagram.pptx
classdiagram.pptx
 
Cs8592 ooad unit 1
Cs8592 ooad unit 1Cs8592 ooad unit 1
Cs8592 ooad unit 1
 
Cs8592 ooad unit 1
Cs8592 ooad unit 1Cs8592 ooad unit 1
Cs8592 ooad unit 1
 
UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptx
 
Chapter 6 Object Modeling .pptxInformation Technology Project Management
Chapter 6 Object Modeling .pptxInformation Technology Project ManagementChapter 6 Object Modeling .pptxInformation Technology Project Management
Chapter 6 Object Modeling .pptxInformation Technology Project Management
 
RRC AD
RRC ADRRC AD
RRC AD
 
chapter06-120827115400-phpapp01.pdf
chapter06-120827115400-phpapp01.pdfchapter06-120827115400-phpapp01.pdf
chapter06-120827115400-phpapp01.pdf
 
Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)Software enginering.group-no-11 (1)
Software enginering.group-no-11 (1)
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
 
Object-Oriented Systems Analysis and Design Using UML.pptx
Object-Oriented Systems Analysis and Design Using UML.pptxObject-Oriented Systems Analysis and Design Using UML.pptx
Object-Oriented Systems Analysis and Design Using UML.pptx
 
New phase ii-2010
New  phase ii-2010New  phase ii-2010
New phase ii-2010
 
Object oriented analysis and design
Object oriented analysis and designObject oriented analysis and design
Object oriented analysis and design
 
Object oriented analysis and design unit- iv
Object oriented analysis and design unit- ivObject oriented analysis and design unit- iv
Object oriented analysis and design unit- iv
 
OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
 
OOP Presentation.pptx
OOP Presentation.pptxOOP Presentation.pptx
OOP Presentation.pptx
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientation
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 

More from Kumar

Graphics devices
Graphics devicesGraphics devices
Graphics devicesKumar
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithmsKumar
 
region-filling
region-fillingregion-filling
region-fillingKumar
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivationKumar
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons dericationKumar
 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xsltKumar
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xmlKumar
 
Xml basics
Xml basicsXml basics
Xml basicsKumar
 
XML Schema
XML SchemaXML Schema
XML SchemaKumar
 
Publishing xml
Publishing xmlPublishing xml
Publishing xmlKumar
 
Applying xml
Applying xmlApplying xml
Applying xmlKumar
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XMLKumar
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee applicationKumar
 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLKumar
 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB FundmentalsKumar
 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programmingKumar
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programmingKumar
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversKumar
 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EEKumar
 

More from Kumar (20)

Graphics devices
Graphics devicesGraphics devices
Graphics devices
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
 
region-filling
region-fillingregion-filling
region-filling
 
Bresenham derivation
Bresenham derivationBresenham derivation
Bresenham derivation
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
 
Introductionto xslt
Introductionto xsltIntroductionto xslt
Introductionto xslt
 
Extracting data from xml
Extracting data from xmlExtracting data from xml
Extracting data from xml
 
Xml basics
Xml basicsXml basics
Xml basics
 
XML Schema
XML SchemaXML Schema
XML Schema
 
Publishing xml
Publishing xmlPublishing xml
Publishing xml
 
DTD
DTDDTD
DTD
 
Applying xml
Applying xmlApplying xml
Applying xml
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
How to deploy a j2ee application
How to deploy a j2ee applicationHow to deploy a j2ee application
How to deploy a j2ee application
 
JNDI, JMS, JPA, XML
JNDI, JMS, JPA, XMLJNDI, JMS, JPA, XML
JNDI, JMS, JPA, XML
 
EJB Fundmentals
EJB FundmentalsEJB Fundmentals
EJB Fundmentals
 
JSP and struts programming
JSP and struts programmingJSP and struts programming
JSP and struts programming
 
java servlet and servlet programming
java servlet and servlet programmingjava servlet and servlet programming
java servlet and servlet programming
 
Introduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC DriversIntroduction to JDBC and JDBC Drivers
Introduction to JDBC and JDBC Drivers
 
Introduction to J2EE
Introduction to J2EEIntroduction to J2EE
Introduction to J2EE
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

classes & objects introduction

  • 1. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Object & Class Diagram
  • 2. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES • Objects: – a concept, abstraction, or thing with identity that has meaning for an application. – often appear as proper nouns or specific references in problem descriptions – All objects have identity and are distinguishable – the choice of objects depends on judgment and the nature of problem • Classes: – Describes a group of objects with the same properties (attributes), behavior (operations), kinds of relationships and semantics. – Often appear as common nouns and noun phrases in problem description. – Objects in a class have the same attributes and forms of behavior • Difference in attribute values and specific relationship to other objects – The choice of classes depends on the nature and scope of an application and is matter of judgment – The interpretation of semantics depends on the purpose of each application and is a matter of judgment.
  • 3. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram • The class model captures the static view of an system – by characterizing the objects in the system – the relationship between the objects – and the attributes and operations for each class of objects • Class diagram is not only used for visualizing, describing and documenting different aspects of a system but also for constructing executable system through forward and reverse engineering.
  • 4. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram • The class diagram is the main building block of object oriented modeling. • used for – general conceptual modeling of the systematics of the application – detailed modeling translating the models into programming code. • Class diagrams can also be used for data modeling
  • 5. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram • describes the attributes and operations of a class and also the constraints imposed on the system. • widely used in the modeling of object oriented systems – can be mapped directly with object oriented languages – widely used at the time of construction.
  • 6. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram • The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is also known as a structural diagram.
  • 7. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Object Diagram JoeSmith:Person MaySharp:Person :Person Objects An object diagram shows individual objects and their relationships •Helpful for documenting test cases A class diagram corresponds to an infinite set of object diagrams.
  • 8. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class and Objects JoeSmith:Person MaySharp:Person :Person Objects Person Class Fig: Objects and Classes are the focus of class modeling
  • 9. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram Class Name Attributes Operations
  • 10. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class and Object • First, there is the division of class and object. – A class is an abstraction; – an object is one concrete manifestation of that abstraction. • In the UML, you can model classes as well as objects, as shown in following Figures
  • 11. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class and Object
  • 12. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram
  • 13. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Purpose of Class Diagram
  • 14. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Purpose of Class Diagram • The purpose of the class diagram can be summarized as: To describe objects. Analysis and design of the static view of an application. Describe responsibilities of a system. Base for component and deployment diagrams. Forward and reverse engineering
  • 15. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Visibility in UML To specify the visibility of a class member (i.e., any attribute or method) these are the following notations that must be placed before the member's name: "+" Public "-" Private "#" Protected "/" Derived (can be combined with one of the others) “~" Static
  • 16. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES How to draw Class Diagram ???
  • 17. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES How to draw Class Diagram??? • Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application. So a collection of classes represent the whole system.
  • 18. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES The following points should be remembered while drawing a class diagram: • The name of the class diagram should be meaningful to describe the aspect of the system. • Each element and their relationships should be identified in advance. • Responsibility (attributes and methods) of each class should be clearly identified. • For each class minimum number of properties should be specified. Because unnecessary properties will make the diagram complicated.
  • 19. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Contd.. : • Use notes when ever required to describe some aspect of the diagram. • at the end of the drawing it should be understandable to the developer/coder. • Finally, before making the final version, the diagram should be drawn on plain paper and rework as many times as possible to make it correct.
  • 20. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES “Order System” • First of all Order and Customer are identified as the two elements of the system and they have a one to many relationship because a customer can have multiple orders. • We would keep Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and NormalOrder. • The two inherited classes have all the properties as the Order class. In addition they have additional functions like dispatch () and receive ().
  • 21. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram for Order System
  • 22. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES
  • 23. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Relationships among Classes • Links – the basic relationship among objects – a tuple i.e. the list of objects – an instance of an association • Association – represents a family of links with common structure and semantics. – Links of an association connect objects from same classes. – Describes a set of potential links – Binary associations (with two ends) are normally represented as a line. Fig: Class diagram example of association between two classes
  • 24. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Notation • Link – line between objects – If the link has name, it is underlined • Association – Line between related classes – Association name is optional, if unambiguous • Ambiguity arise when a model has multiple associations among the same classes – Bidirectional • Can be traversed in either direction and equally meaningful
  • 25. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram with All Relationships
  • 26. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram: Generalization
  • 27. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram: Association Names
  • 28. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram: Roles
  • 29. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram: Aggregation
  • 30. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Relationships among Classes • Multiplicity – Multiplicity specifies the number of instances of one class that may relate to a single instance of an associated class. – Multiplicity constrains the number of related objects. – a subset of nonnegative integers.
  • 31. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Multiplicity • UML specifies multiplicity with an interval, such as.. 0..1 No instances, or one instance (optional, may) 1 Exactly one instance 0..* or *  Zero or more instances 1..*  One or more instances (at least one)
  • 32. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Class Diagram: Multiplicity
  • 33. Object Oriented Analysis and Design By P. K. Deka @ CIT Dept, UPES Association Types • Aggregation – a variant of the "has a" association relationship; – aggregation is more specific than association – It is an association that represents a part-whole or part-of relationship. – can occur when a class is a collection or container of other classes, but where the contained classes do not have a strong life cycle dependency on the container – if the container is destroyed, its contents are not.