mod3a
mod3a
Contents
• OOP Concepts
• Design Patterns
• Another advantage is that faster and low cost development, and creates
a high quality software
• Well-suited for programs that are large, complex and actively updated or
maintained
• Abstraction
• Abstraction means, showcasing only the required things to the
outside world while hiding the details
• Ex. Human being’s can talk, walk, hear, eat, but the details of the
muscles mechanism and their connections to the brain are hidden
from the outside world
• Encapsulation
• Hiding unnecessary details from the user
• For example, when we call from our mobile phone, we select the
number and press call button
• Persistence Classes
• Represents the data stores that will persist beyond the execution
of the software
• System Classes
• Implement software management and control functions
Design Class Characteristics
• Complete and Sufficient
• A design class should be complete encapsulation of all attributes
and method that can be reasonably be expected to exist for class
• Primitiveness
• Method associated with design class should be focused on
accomplishing one service for class. The class should not provide
another way to accomplish the same thing
Design Class Characteristics
• High Cohesion
• A cohesive design class has a small and focused set of
responsibilities
• Low-coupling
• A class should be associated with the minimum number of other
classes to allow it to fulfill its responsibilities. If a design model is
highly coupled then the system is difficult to implement, to test
and to maintain over time
Design Patterns
Basic Concepts of Design Patterns
• In software engineering, a design pattern is a general repeatable
solution to a commonly occurring problem in software design
• It is a description or template for how to solve a problem that
can be used in many different situations
• Each design pattern systematically names, explains, and
evaluates an important and recurring design in object-oriented
systems
• The goal is to capture design experience in a form that people
can use effectively
• To this end, some of the most important design patterns are
documented and present them as a catalog
• In general, a pattern has four essential elements
• Pattern Name
• Problem
• Solution
• Consequences
• Pattern Name
• Used to describe a design problem, its solutions, and
consequences in a word or two
• Naming a pattern increases our design vocabulary and makes it
easier to think about designs and communicate to others
• Finding good names has been one of the hardest part
• Problem
• Describes when to apply the pattern
• It explains the problem and its context
• Solution
• The solution doesn't describe a particular concrete design or
implementation. Because a pattern is like a template that can be
applied in many different situations
• Describes the elements (classes and objects) that make up the
design, their relationships, responsibilities, and collaborations
• Consequences
• They are the results and trade-offs of applying the pattern. These
are the costs and benefits of applying the patterns
Design Pattern - Benefits
• Design patterns can speed up the development process by
providing tested, proven development paradigms
• Reusing design patterns helps to prevent subtle issues that
can cause major problems
• Improves code readability
• Design patterns provide general solutions, documented in a
format
• Makes it easier to reuse successful designs and architectures
Characteristics of Design Pattern
• Smart
• Elegant solutions that a novice would not think of immediately
• Generic
• Not normally depend on a specific system type, programming
languages or application domains. They are generic in nature
• Well Proven
• They have been identified from real object oriented systems, and
have been successfully tested in several systems
Characteristics of Design Pattern
• Simple
• They are usually quite small involving small number of classes. The
complex systems are built using different design patterns and their
combinations
• Reusable
• They are documented in such a manner to increase reusability
• Object Oriented
• They are built with the basic object oriented mechanisms such as
classes, objects, generalization and polymorphism
How to Select a Design Pattern?