SlideShare ist ein Scribd-Unternehmen logo
1 von 22
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
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

Weitere ähnliche Inhalte

Ähnlich wie OOP_Module 2.pptx

Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
SHIVAM691605
 
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
viju001
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Aravinth NSP
 

Ähnlich wie OOP_Module 2.pptx (20)

Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 
UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 
Diagramming the Class Diagram: Toward a Unified Modeling Methodology
Diagramming the Class Diagram: Toward a Unified Modeling Methodology Diagramming the Class Diagram: Toward a Unified Modeling Methodology
Diagramming the Class Diagram: Toward a Unified Modeling Methodology
 
Sda 7
Sda   7Sda   7
Sda 7
 
Uml.pptx
Uml.pptxUml.pptx
Uml.pptx
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
 
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
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
Different Types Diagrams
Different Types Diagrams  Different Types Diagrams
Different Types Diagrams
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
System modeling
System modelingSystem modeling
System modeling
 
OOM Unit I - III.pdf
OOM Unit I - III.pdfOOM Unit I - III.pdf
OOM Unit I - III.pdf
 
DISE - OOAD Using UML
DISE - OOAD Using UMLDISE - OOAD Using UML
DISE - OOAD Using UML
 
Uml diagram assignment help
Uml diagram assignment helpUml diagram assignment help
Uml diagram assignment help
 
UML and Software Modeling Tools.pptx
UML and Software Modeling Tools.pptxUML and Software Modeling Tools.pptx
UML and Software Modeling Tools.pptx
 
Ooad
OoadOoad
Ooad
 
Introduction to Rational Rose
Introduction to Rational RoseIntroduction to Rational Rose
Introduction to Rational Rose
 

Kürzlich hochgeladen

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

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
  • 13.
  • 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()