Design Pattern is advance topic in Software Engineering and it is very important,you will find in this presentation explanation State Machine Pattern,Singleton Pattern and
Façade Pattern
2. Agenda
Mhd Adel Alajami 8/29/2014
2
Understanding the need for design patterns
What are design patterns
Using design patterns
State Design Patter
Singleton Design Patter
Façade Design Patter
7. the need for design patterns
Mhd Adel Alajami 8/29/2014
7
Software changes
We need to add a new features - boss
There is a change in the specification - customer
We have found a big bug – team
Flexible code
Maintainable Code
8. Use Design Pattern
Mhd Adel Alajami 8/29/2014
8
By learning theme
And then applying them in your OOP designs
You will create more flexible and maintainable
code
9. Dealing with change
Mhd Adel Alajami 8/29/2014
9
Software has lots of ways to change
There are many design pattern to deal with
changes
Design patterns address many of the ways
software changes over time
10. What are design pattern ?
Mhd Adel Alajami 8/29/2014
10
Design patterns are general solutions to
common problems
A pattern is a guideline for flexible and resilient
code design
It does not go in detail of implementation
There is no DP for Banking system and other
for games
It is a general solution for common problem in
software development
11. What are design pattern ?
Mhd Adel Alajami 8/29/2014
11
“I have a problem, when one of my object
changes , I need to let all other objects know.
Is there a good way to do that?”
This is a common problem in software
development
There is a proven method to solve it : The
Observer Pattern
12. Where did DP come from ?
Mhd Adel Alajami 8/29/2014
12
23 original pattern
Now, there are many patterns for many
different software problems
13. How To Use Design Pattern
Mhd Adel Alajami 8/29/2014
13
A design pattern is not a library, module or
package
It’s a guideline for how to solve a problem
Higher level than a library
First understand the pattern, and then use its
design in your software
14. Using Design Pattern
Mhd Adel Alajami 8/29/2014
14
Ultimate in reuse
Build from years of software development
experience
Save times, and trial and error
Not reusing code, but reusing experience
21. Disadvantage
Mhd Adel Alajami 8/29/2014
21
Is not really OO at all
Any additions require many change to code
Difficult to understand all the state and
transitions
Violates open closed principle
22. Think of Each State as an
object
Mhd Adel Alajami 8/29/2014
22
40. Benefits
Mhd Adel Alajami 8/29/2014
40
Shields clients from subsystem classes; reduces
the number of objects that clients deal with.
Promotes weak coupling between subsystem and
its clients.
Helps in layering the system. Helps eliminate
circular dependencies.
Makes using the subsystem easier