OOP OOAD

 Object means a real-world entity such as a pen, chair, table, computer, watch, etc. 

Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects.

Object
Any entity that has state and behavior is known as an object. 
An Object can be defined as an instance of a class.
An object contains an address and takes up some space in memory.

Class
Collection of objects is called class. It is a logical entity.

Inheritance(IS-A)
When one object acquires all the properties and behaviors of a parent object, it is known as inheritance. 
It provides code reusability. 
It is used to achieve runtime polymorphism.

Polymorphism
If one task is performed in different ways, it is known as polymorphism.
Uuse method overloading and method overriding to achieve polymorphism.

Abstraction
Hiding internal details and showing functionality is known as abstraction.
In Java, use abstract class and interface to achieve abstraction.

Encapsulation
Binding (or wrapping) code and data together into a single unit are known as encapsulation.
A java class is the example of encapsulation.
Java bean is the fully encapsulated class because all the data members are private.

Coupling
Coupling refers to the knowledge or information or dependency of another class.

Cohesion
Cohesion refers to the level of a component which performs a single well-defined task.

Association
Association represents the relationship between the objects.
  • One to One
  • One to Many
  • Many to One, and
  • Many to Many
Aggregation(HAS-A)
Aggregation is a way to achieve Association.
Aggregation represents the relationship where one object contains other objects as a part of its state. 
It represents the weak relationship between objects. 
It is also termed as a has-a relationship in Java.

Composition
The composition is also a way to achieve Association.
The composition represents the relationship where one object contains other objects as a part of its state. There is a strong relationship between the containing object and the dependent object. It is the state where containing objects do not have an independent existence.

Object-Oriented Analysis and Design(OOAD)

OOAD is a software engineering methodology that employs object-oriented principles to model and design complex systems.

Aspects of OOAD
1) Object-Oriented Programming: Object-oriented programming involves modeling real-world objects as software objects
2) Design Patterns: Design patterns are reusable solutions to common problems in software design.
3) UML Diagrams: Unified Modeling Language (UML) is a standardized notation for creating diagrams that represent different aspects of a software system.
4) Use Cases: Use cases are a way of describing the different ways in which users interact with a software system.

Object-Oriented Analysis
Object-Oriented Analysis (OOA) is the first technical activity performed as part of object-oriented software engineering. OOA introduces new concepts to investigate a problem. It is based on a set of basic principles, which are as follows:
1) The information domain is modeled
2) Behavior is represented
3) The function is described
4) Data, functional, and behavioral models are divided to uncover greater detail
5) Starting Simple, Getting Detailed

Object-Oriented Design
The analysis model, undergoes a transform, into a detailed design model, essentially serving as a blueprint for constructing the software.
A design model characterized by multiple levels of modularity.
1) Subsystem Partitioning
2) Object Encapsulation

The object-oriented design process, specific aspects:
1) Data Organization of Attributes
determining the types of data each object will hold
ensuring a coherent and efficient data structure
2) Procedural Description of Operations
detailing the steps or processes involved in carrying out specific tasks
ensuring clarity and precision in the implementation of functionality

The Design pyramid for object-oriented systems. It is having the following four layers.
1) The Subsystem Layer: It represents the subsystem that enables software to achieve user requirements and implement technical frameworks that meet user needs.
2) The Class and Object Layer: It represents the class hierarchies that enable the system to develop using generalization and specialization. This layer also represents each object.
3) The Message Layer: This layer deals with how objects interact with each other. It includes messages sent between objects, method calls, and the flow of control within the system.
4) The Responsibilities Layer: It focuses on the responsibilities of individual objects. This includes defining the behavior of each class, specifying what each object is responsible for, and how it responds to messages.

Benefits of Object-Oriented Analysis and Design(OOAD)
Improved modularity
Better abstraction
Improved reuse
Improved communication
Reusability
Scalability
Maintainability
Flexibility
Improved software quality

Challenges of Object-Oriented Analysis and Design(OOAD)
Complexity
Overhead
Steep learning curve
Time-consuming
Rigidity
Cost

Real world applications of Object-Oriented Analysis and Design(OOAD)
Financial Systems
Healthcare Systems
Aerospace and Defense
Telecommunications
E-commerce

How do you approach the analysis of a software system for OOAD?
Step1: Gather requirements: Understand the problem domain, system requirements, and constraints through stakeholder interviews, documentation review, and other techniques.
Step2: Identify key objects and concepts
Step3: Define object responsibilities
Step4: Establish relationships
Step5: Create Class Diagrams
Step6: Identify Use Cases
Step7: Create Sequence and State Machine Diagrams
Step8: Refine and iterate
Step9: Consider Design Principles and Patterns

How do you design a system using Object-Oriented Principles?
1. Key objects
2. Relationships
3. Key operations
4. Design patterns

How do you design a library management system using Object-Oriented Principles?
1. Key objects:
Library: Manages the overall library operations, including catalogs, members, and book lending/returning.
Book: Represents a book in the library, with properties like title, author, ISBN, and availability status.
Member: Represents a library member with personal information and the ability to borrow and return books.
Catalog: Manages the collection of books in the library, including search and retrieval operations.
LendingRecord: Tracks the lending history of a book, including the member who borrowed it and the due date.
2. Relationships:
The Library has a Catalog of Books.
The Library has a collection of Members.
A Member can borrow multiple Books, and a Book can be borrowed by multiple Members over time.
A LendingRecord is created when a Member borrows a Book from the Library.
3. Key operations:
Library: addMember(), removeMember(), lendBook(), returnBook(), viewCatalog()
Book: updateAvailability()
Member: borrowBook(), returnBook(), viewBorrowedBooks()
Catalog: addBook(), removeBook(), searchBooks()
LendingRecord: calculateDueDate(), extendDueDate(), markReturned()
4. Design patterns:
Singleton pattern for the Library and Catalog classes to ensure only one instance exists.
Observer pattern to notify Members when a book they want becomes available.
Factory pattern for creating different types of Members (e.g., StudentMember, FacultyMember).


Comments

Popular posts from this blog

PL/SQL

JAVA8 Features

Build Automation