Se 3
Se 3
OOP Concepts
• Object Oriented is a popular design approach for
• Most of the languages like C++, Java, .net are use object
eyes, mouth, etc, and functions like walk, talk, eat, see, etc.
Man and Woman are also classes, but most of the properties and
Hence, they can inherit everything from class HumanBeing using the
concept of Inheritance
Objects :
Abstraction :
Continuing our example, HumanBeing’s can talk, walk, hear, eat, but
the user
For example, when we call from our mobile phone, we select the
But the entire process of calling or what happens from the moment we
press or touch the call button to the moment we start having a phone
5) System Classes :
System classes implement software management and control
functions
Design class characteristics
Our goal is to capture design experience in a form that people can use
effectively
Reusing design patterns helps to prevent subtle issues that can cause
major problems
Improves code readability for coders and architects familiar with the
patterns
Often, people only understand how to apply certain software design
techniques to certain problems
These techniques are difficult to apply to a broader range of problems
Design patterns provide general solutions, documented in a format
that doesn't require specifics tied to a particular problem
In addition, patterns allow developers to communicate using well-
known, well understood names for software interactions
Common design patterns can be improved over time
How to select a design pattern
redesign
Organizing the Catalog
There are many design patterns, we need a way to organize them
We classify design patterns by two criteria (Table1.1)
The first criterion, called purpose, reflects what a pattern does
Patterns can have either creational, structural, or behavioral
purpose
Creational patterns concern the process of object creation
Structural patterns deal with the composition of classes or objects
Behavioral patterns characterize the ways in which classes or objects
interact and distribute responsibility
The second criterion, called scope, specifies whether the pattern
applies primarily to classes or to objects
Class patterns deal with relationships between classes and their
subclasses
These relationships are established through inheritance, so they are
static (fixed at compile-time)
Object patterns deal with object relationships, which can be changed
at run-time and are more dynamic
Only patterns labeled "class patterns" are those that focus on class
relationships
Note that most patterns are in the Object scope
Creational class patterns defer some part of object creation to
Object Creational
Builder
Object Creational
Factory Method
Class Creational
Prototype
Object Creational
Singleton
Object Creational
Structural
Patterns
These design patterns are all about Class and Object composition
new functionality
Adapter
Object Structural
Composite
Object Structural
Decorator
Object Structural
Facade
Object Structural
Flyweight
Object Structural
Proxy
Object Structural
Behavioral
Patterns
Behavioral patterns are concerned with algorithms and the assignment of
classes
Object Behavioral
Command
Object Behavioral
Interpreter
Class Behavioral
Iterator
Object Behavioral
Mediator
Object Behavioral
Memento
Object Behavioral
Observer
Object Behavioral
State
Object Behavioral
Strategy
Object Behavioral
Template Method
Class Behavioral
Visitor
Object Behavioral
Concept of
Anti-patterns
AntiPatterns, like their design pattern counterparts, define an industry
vocabulary for the common defective processes and implementations
within organizations
A higher-level vocabulary simplifies communication between software
practitioners and enables concise description of higher-level concepts
Describes a commonly occurring solution to a problem that generates
decidedly negative consequences
The AntiPattern may be the result of a manager or developer not
knowing any better, not having sufficient knowledge or experience in
solving a particular type of problem, or having applied a perfectly good
pattern in the wrong context
Recognizing recurring problems in the software industry
Provide a detailed remedy for the most common predicaments
Highlight the most common problems that face the software industry and
provide the tools to enable you to recognize these problems and to
determine their underlying causes
Implementing productive solutions
Improve the developing of applications, the designing of software systems
Effective management of software projects
Software Development AntiPatterns
A key goal of development AntiPatterns is to describe useful forms of
software refactoring
Software refactoring is a form of code modification, used to improve the
software structure in support of subsequent extension and long-term
maintenance