SlideShare a Scribd company logo
Object Oriented Programming
Introduction to OOP Design
(Day 1)
Prof. Prasenjit Kumar Das,
Dept. of CST/CSIT, UEM Kolkata
Email : prasenjitdas139@gmail.com
Module 2: Object-Oriented Programming Constructs
 Class, Object
 relationships among classes- association, dependency (use, call), aggregation, grouping,
generalisation
 relationships among objects - instantiation, links
 meta-class
 Modelling with UML Class and Sequence Diagrams
OOP Design
Object-oriented programming (OOP) is a computer programming model
that organizes software design around data, or objects, rather than
functions and logic. An object can be defined as a data field that has
unique attributes and behavior.
Is OOP used in software development?
Object Oriented programming (OOP) is a programming paradigm that
relies on the concept of classes and objects.
 It is used to structure a software program into simple, reusable pieces of
code blueprints (usually called classes), which are used to create individual
instances of objects.
Object Oriented System Development Life Cycle
It consists of three macro processes −
Object Oriented Analysis (OOA)
Object oriented design (OOD)
Object oriented Implementation (OOI)
Object-Oriented Analysis(OOA)
This phase concerns with determining the system requirements and to
understand the system requirements build a use-case model.
 A use-case is a scenario to describe the interaction between user and
computer system. This model represents the user needs or user view of
system.
Object-Oriented Design
The objective of this phase is to design and refine the classes,
attributes, methods, and structures that are identified during the
analysis phase, user interface, and data access.
This phase also identifies and defines the additional classes or objects
that support implementation of the requirement
Object Oriented Implementation
Prototyping
Prototyping enables to fully understand how easy or difficult it will be
to implement some of the features of the system.
Implementation
It uses either Component-Based Development (CBD) or Rapid
Application Development (RAD)
Incremental Testing
Software development and all of its activities including testing are an
iterative process.
Therefore, it can be a costly affair if we wait to test a product only
after its complete development.
Here incremental testing comes into picture wherein the product is
tested during various stages of its development.
Class Diagram Relationships
Class diagrams are the main building blocks of object-oriented modeling so it
is important that you understand the various class diagram relationships and
how they affect your solution.
Classes are interrelated to each other in specific ways. In particular,
relationships in class diagrams include different types of logical connections.
The following are such types of logical connections that are possible in UML
• Association
Association - One of the most common in class diagram relationships
It is a broad term that encompasses just about any logical connection or
relationship between classes. For example, passenger and airline may be
linked as above.
Directed Association
refers to a directional relationship represented by a line with an
arrowhead. The arrowhead depicts a container-contained directional
flow.
Aggregation
refers to the formation of a particular class as a result of one class being
aggregated or built as a collection.
For example, the class “library” is made up of one or more books, among
other materials.
 In aggregation, the contained classes are not strongly dependent on the
lifecycle of the container. In the same example, books will remain so even
when the library is dissolved.
To show aggregation in a diagram, draw a line from the parent class to the
child class with a diamond shape near the parent class.
Composition
A composition association relationship represents a whole–part relationship and is a
form of aggregation.
A composition association relationship specifies that the lifetime of the part classifier is
dependent on the lifetime of the whole classifier.
In a composition association relationship, data usually flows in only one direction (that
is, from the whole classifier to the part classifier).
For example, a composition association relationship connects a Student class with a
Schedule class, which means that if you remove the student, the schedule is also
removed.
Dependency
Using a dependency relationship in UML, one can relate how various
things inside a particular system are dependent on each other.
Dependency is used to describe the relationship between various
elements in UML that are dependent upon each other
OOP_Module 2.pptx
Generalization
It is also called a parent-child relationship. In generalization, one element is
a specialization of another general component. It may be substituted for it. It
is mostly used to represent inheritance.
 To show inheritance in a UML diagram, a solid line from the child class to
the parent class is drawn using an unfilled arrowhead
When to Draw Class Diagram?
Most of the UML diagrams can not be mapped directly with any
object-oriented programming languages except class diagrams. In
other words, class diagram ideally can have one to one mapping to
UML class diagrams. Besides, class diagrams are useful in the
following situations:
 Describing the static view of the system.
 Modeling the collaboration among the elements of the static view.
 Describing the functionalities performed by the system.
 Construction of software applications using object oriented languages.
 Performing code forward engineering for the target systems
 Classifying classes or components as library for future reuse
What are the Class Diagrams?
Class diagrams are the main building block in object-oriented
modeling. They are used to show the different objects in a system,
their attributes, their operations and the relationships among them.
The following figure is an example of a Simple class diagram with
attributes and operations
In the example, a class called “loan account” is depicted. Classes in class
diagrams are represented by boxes that are partitioned into three:
The top partition contains the name of the class.
The middle part contains the class’s attributes.
The bottom partition shows the possible operations that are associated with
the class.
The example shows how a class can encapsulate all the relevant data of a
particular object in a very systematic and clear way. A class diagram is a
collection of classes similar to the one above.
Class Diagram For LMS(Library Management
System)
Class Diagram for Library Management System simply describes structure of
Library Management System class, attributes, methods or operations,
relationship among objects.
• Classes of Library Management System :
• Library Management System class –
It manages all operations of Library Management System. It is central part of
organization for which software is being designed.
• User Class –
It manages all operations of user.
• Librarian Class – It manages all operations of Librarian.
• Book Class –
It manages all operations of books. It is basic building block of system.
• Account Class –
It manages all operations of account.
• Library database Class –
It manages all operations of library database.
• Staff Class –
It manages all operations of staff.
• Student Class –
It manages all operations of student.
Attributes of Library Management System :
• Library Management System Attributes –
• UserType, Username, Password
• User Attributes –
• Name, Id
• Librarian Attributes –
• Name, Id, Password, SearchString
• Book Attributes –
• Title, Author, ISBN, Publication
• Account Attributes –
• no_borrowed_books, no_reserved_books, no_returned_books, no_lost_books fine_amount
• Library database Attributes –
• List_of_books
• Staff Class Attributes –
• Dept
• Student Class Attributes –
• Class
Methods of Library Management System :
• Library Management System Methods –
• Login(), Register(), Logout()
• User Methods –
• Verify(), CheckAccount(), get_book_info()
• Librarian Methods –
• Verify_librarian(), Search()
• Book Methods –
• Show_duedt(), Reservation_status(), Feedback(), Book_request(), Renew_info()
• Account Methods –
• Calculate_fine()
• Library database Methods –
• Add(), Delete(), Update(), Display(), Search()
OOP_Module 2.pptx

More Related Content

PDF
Object oriented analysis and design unit- iv
PPT
ASP.NET System design 2
PPTX
SMD Unit ii
PPTX
Slideshow on the notes of software engineering
PPTX
PPT
Oomd unit1
PPTX
Architecture and design
Object oriented analysis and design unit- iv
ASP.NET System design 2
SMD Unit ii
Slideshow on the notes of software engineering
Oomd unit1
Architecture and design

Similar to OOP_Module 2.pptx (20)

PPT
08 class and sequence diagrams
PPT
Uml - An Overview
PDF
Object-oriented modeling and design.pdf
PDF
UML-Advanced Software Engineering
PDF
Diagramming the Class Diagram: Toward a Unified Modeling Methodology
PPT
Chapter 2-Unified Modeling Languagee.ppt
PPT
Chapter 2-Unified Modeling Languagee.ppt
PPTX
UML Diagrams.pptxUML DiagramsUML DiagramsUML Diagrams
PPTX
DOCX
Chapterunifiedmo 3 UML Class Diagram.docx
PDF
OBJECT ORIENTED CONCEPTS,UML DIAGRAMS,DFD
PPTX
Software Engineering and Project Management - Introduction, Modeling Concepts...
PPTX
UNIT-3 Design Using UML_Design_of_UML.pptx
PDF
Class Diagram Object Oriented Programming
PPTX
Uml.pptx
PDF
Software Testing and UML Lab
PPTX
UNIT-3 Design Using UML (1).pptx
DOC
Ooad lab manual
PPTX
Object_Oriented_Design_Class and Object Diagrams.pptx
PPTX
detailed info of class diagram in ooad with uml
08 class and sequence diagrams
Uml - An Overview
Object-oriented modeling and design.pdf
UML-Advanced Software Engineering
Diagramming the Class Diagram: Toward a Unified Modeling Methodology
Chapter 2-Unified Modeling Languagee.ppt
Chapter 2-Unified Modeling Languagee.ppt
UML Diagrams.pptxUML DiagramsUML DiagramsUML Diagrams
Chapterunifiedmo 3 UML Class Diagram.docx
OBJECT ORIENTED CONCEPTS,UML DIAGRAMS,DFD
Software Engineering and Project Management - Introduction, Modeling Concepts...
UNIT-3 Design Using UML_Design_of_UML.pptx
Class Diagram Object Oriented Programming
Uml.pptx
Software Testing and UML Lab
UNIT-3 Design Using UML (1).pptx
Ooad lab manual
Object_Oriented_Design_Class and Object Diagrams.pptx
detailed info of class diagram in ooad with uml
Ad

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
OOP with Java - Java Introduction (Basics)
PDF
PPT on Performance Review to get promotions
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
DOCX
573137875-Attendance-Management-System-original
PPTX
Welding lecture in detail for understanding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
composite construction of structures.pdf
PPTX
Lecture Notes Electrical Wiring System Components
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Internet of Things (IOT) - A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Geodesy 1.pptx...............................................
OOP with Java - Java Introduction (Basics)
PPT on Performance Review to get promotions
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
additive manufacturing of ss316l using mig welding
CYBER-CRIMES AND SECURITY A guide to understanding
573137875-Attendance-Management-System-original
Welding lecture in detail for understanding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
composite construction of structures.pdf
Lecture Notes Electrical Wiring System Components
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Ad

OOP_Module 2.pptx

  • 1. Object Oriented Programming Introduction to OOP Design (Day 1) Prof. Prasenjit Kumar Das, Dept. of CST/CSIT, UEM Kolkata Email : prasenjitdas139@gmail.com
  • 2. Module 2: Object-Oriented Programming Constructs  Class, Object  relationships among classes- association, dependency (use, call), aggregation, grouping, generalisation  relationships among objects - instantiation, links  meta-class  Modelling with UML Class and Sequence Diagrams
  • 3. OOP Design Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. Is OOP used in software development? Object Oriented programming (OOP) is a programming paradigm that relies on the concept of classes and objects.  It is used to structure a software program into simple, reusable pieces of code blueprints (usually called classes), which are used to create individual instances of objects.
  • 4. Object Oriented System Development Life Cycle It consists of three macro processes − Object Oriented Analysis (OOA) Object oriented design (OOD) Object oriented Implementation (OOI) Object-Oriented Analysis(OOA) This phase concerns with determining the system requirements and to understand the system requirements build a use-case model.  A use-case is a scenario to describe the interaction between user and computer system. This model represents the user needs or user view of system.
  • 5. Object-Oriented Design The objective of this phase is to design and refine the classes, attributes, methods, and structures that are identified during the analysis phase, user interface, and data access. This phase also identifies and defines the additional classes or objects that support implementation of the requirement Object Oriented Implementation Prototyping Prototyping enables to fully understand how easy or difficult it will be to implement some of the features of the system.
  • 6. Implementation It uses either Component-Based Development (CBD) or Rapid Application Development (RAD) Incremental Testing Software development and all of its activities including testing are an iterative process. Therefore, it can be a costly affair if we wait to test a product only after its complete development. Here incremental testing comes into picture wherein the product is tested during various stages of its development.
  • 7. Class Diagram Relationships Class diagrams are the main building blocks of object-oriented modeling so it is important that you understand the various class diagram relationships and how they affect your solution. Classes are interrelated to each other in specific ways. In particular, relationships in class diagrams include different types of logical connections. The following are such types of logical connections that are possible in UML
  • 8. • Association Association - One of the most common in class diagram relationships It is a broad term that encompasses just about any logical connection or relationship between classes. For example, passenger and airline may be linked as above.
  • 9. Directed Association refers to a directional relationship represented by a line with an arrowhead. The arrowhead depicts a container-contained directional flow.
  • 10. Aggregation refers to the formation of a particular class as a result of one class being aggregated or built as a collection. For example, the class “library” is made up of one or more books, among other materials.  In aggregation, the contained classes are not strongly dependent on the lifecycle of the container. In the same example, books will remain so even when the library is dissolved. To show aggregation in a diagram, draw a line from the parent class to the child class with a diamond shape near the parent class.
  • 11. Composition A composition association relationship represents a whole–part relationship and is a form of aggregation. A composition association relationship specifies that the lifetime of the part classifier is dependent on the lifetime of the whole classifier. In a composition association relationship, data usually flows in only one direction (that is, from the whole classifier to the part classifier). For example, a composition association relationship connects a Student class with a Schedule class, which means that if you remove the student, the schedule is also removed.
  • 12. Dependency Using a dependency relationship in UML, one can relate how various things inside a particular system are dependent on each other. Dependency is used to describe the relationship between various elements in UML that are dependent upon each other
  • 14. Generalization It is also called a parent-child relationship. In generalization, one element is a specialization of another general component. It may be substituted for it. It is mostly used to represent inheritance.  To show inheritance in a UML diagram, a solid line from the child class to the parent class is drawn using an unfilled arrowhead
  • 15. When to Draw Class Diagram? Most of the UML diagrams can not be mapped directly with any object-oriented programming languages except class diagrams. In other words, class diagram ideally can have one to one mapping to UML class diagrams. Besides, class diagrams are useful in the following situations:  Describing the static view of the system.  Modeling the collaboration among the elements of the static view.  Describing the functionalities performed by the system.  Construction of software applications using object oriented languages.  Performing code forward engineering for the target systems  Classifying classes or components as library for future reuse
  • 16. What are the Class Diagrams? Class diagrams are the main building block in object-oriented modeling. They are used to show the different objects in a system, their attributes, their operations and the relationships among them. The following figure is an example of a Simple class diagram with attributes and operations
  • 17. In the example, a class called “loan account” is depicted. Classes in class diagrams are represented by boxes that are partitioned into three: The top partition contains the name of the class. The middle part contains the class’s attributes. The bottom partition shows the possible operations that are associated with the class. The example shows how a class can encapsulate all the relevant data of a particular object in a very systematic and clear way. A class diagram is a collection of classes similar to the one above.
  • 18. Class Diagram For LMS(Library Management System) Class Diagram for Library Management System simply describes structure of Library Management System class, attributes, methods or operations, relationship among objects. • Classes of Library Management System : • Library Management System class – It manages all operations of Library Management System. It is central part of organization for which software is being designed. • User Class – It manages all operations of user. • Librarian Class – It manages all operations of Librarian. • Book Class – It manages all operations of books. It is basic building block of system.
  • 19. • Account Class – It manages all operations of account. • Library database Class – It manages all operations of library database. • Staff Class – It manages all operations of staff. • Student Class – It manages all operations of student.
  • 20. Attributes of Library Management System : • Library Management System Attributes – • UserType, Username, Password • User Attributes – • Name, Id • Librarian Attributes – • Name, Id, Password, SearchString • Book Attributes – • Title, Author, ISBN, Publication • Account Attributes – • no_borrowed_books, no_reserved_books, no_returned_books, no_lost_books fine_amount • Library database Attributes – • List_of_books • Staff Class Attributes – • Dept • Student Class Attributes – • Class
  • 21. Methods of Library Management System : • Library Management System Methods – • Login(), Register(), Logout() • User Methods – • Verify(), CheckAccount(), get_book_info() • Librarian Methods – • Verify_librarian(), Search() • Book Methods – • Show_duedt(), Reservation_status(), Feedback(), Book_request(), Renew_info() • Account Methods – • Calculate_fine() • Library database Methods – • Add(), Delete(), Update(), Display(), Search()