0% found this document useful (0 votes)
6 views

Slide - 8 (Design Pattern) (1)

This document provides an overview of design patterns in software engineering, defining them as reusable solutions to common programming problems. It discusses the evolution of design patterns, particularly referencing the 'Gang of Four' and categorizes them into creational, structural, and behavioral types. Additionally, it touches on architectural patterns like MVC and emphasizes the importance of understanding object-oriented concepts for grasping design patterns.

Uploaded by

Swapnil Sett
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Slide - 8 (Design Pattern) (1)

This document provides an overview of design patterns in software engineering, defining them as reusable solutions to common programming problems. It discusses the evolution of design patterns, particularly referencing the 'Gang of Four' and categorizes them into creational, structural, and behavioral types. Additionally, it touches on architectural patterns like MVC and emphasizes the importance of understanding object-oriented concepts for grasping design patterns.

Uploaded by

Swapnil Sett
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Software Engineering and Information System

Lecture 10:

Design Pattern

Md. Al-Hasan
Assistant Professor
Department of Computer Science & Engineering (CSE)
Bangladesh Army University of Science & Technology (BAUST)
Design Patterns
We will just see some different definition to understand design pattern better.

Design patterns are reusable solutions to the problems that we encounter in the day to
day programming. They are generally targeted at solving the problems of object
generation and integration. In other words, Design patterns acts as templates which can
be applied to the real-world programming problems.

In software engineering, a design pattern is a general repeatable solution to a


commonly occurring problem in software design. A design pattern isn't a finished
design that can be transformed directly into code. It is a description or template for
how to solve a problem that can be used in many different situations.

Design patterns are used to represent some of the best practices adapted by
experienced object-oriented software developers. A design pattern systematically
names, motivates, and explains a general design that addresses a recurring design
problem in object-oriented systems. It describes the problem, the solution, when to
apply the solution, and its consequences. It also gives implementation hints and
examples.
Evolution of design Patterns

The four authors of the book famously know as Gang of four are the ones
who brought the concepts of design patterns in their book “Elements of
reusable Object-Oriented software” .

Gang of Four has divided the book into two parts with first part explaining
about the pros and cons of object oriented programming and the second part
describes the evolution of 23 classic software design patterns.

For more details, please refer to the following Wikipedia article


https://en.wikipedia.org/wiki/Design_Patterns
Usage of Design Pattern
Design Patterns have two main usages in software development.

1. Common platform for developers


Design patterns provide a standard terminology and are specific to particular scenario.
For example, a singleton design pattern signifies use of single object so all developers
familiar with single design pattern will make use of single object and they can tell each
other that program is following a singleton pattern.

2. Best Practices
Design patterns have been evolved over a long period of time and they provide best
solutions to certain problems faced during software development. Learning these
patterns helps inexperienced developers to learn software design in an easy and faster
way.
Types of Design Patterns
3 types based on different problems encountered in the real world applications:
– Creational
– Structural and
– Behavioral

Creational design patterns: These patterns deal with object creation and initialization.
Creational pattern gives the program more flexibility in deciding which objects need to be
created for a given case.
Examples: Singleton , Factory and Abstract Factory etc.
Structural design patterns: This pattern deals with class and object composition. In simple
words, This pattern focuses on decoupling interface, implementation of classes and its
objects.
Examples: Adapter, Facade and Bridge etc
Behavioral design patterns: These patterns deal with communication between Classes and
objects.
Examples: Chain of Responsibility, Command and Interpreter etc.

https://www.geeksforgeeks.org/mvc-design-pattern/
Architectural Pattern
An architectural pattern is a general, reusable solution to a commonly occurring problem
in software architecture within a given context.
Architectural patterns are similar to software design patterns but have a broader scope. The
architectural patterns address various issues in software engineering, such as:
 computer hardware performance limitations
 high availability and
 minimization of a business risk
Some architectural patterns have been implemented within software frameworks.

Examples: Model View Controller (MVC)

The Model View Controller (MVC) design pattern specifies that an application consist of a
data model, presentation information, and control information. The pattern requires that each
of these be separated into different objects.
MVC is more of an architectural pattern, but not for complete application. MVC mostly
relates to the UI / interaction layer of an application. You’re still going to need business
logic layer, maybe some service layer and data access layer.
Pre-requisite Concept
For understanding design patterns better it is very
important to have basic knowledge about the
following object oriented concepts

– Abstraction
– Inheritance
– Polymorphism
– Encapsulation
– Interfaces
– Classes
– Abstract classes
Interface
An interface is defined as a syntactical contract that all the classes inheriting the
interface should follow. The interface defines the 'what' part of the syntactical
contract and the deriving classes define the 'how' part of the syntactical contract.
Abstract Class
- Abstract classes allow you to provide default functionality for the subclasses. Compared to
interfaces abstract classes can have implementation. Without implementation an abstract
class does the same as an interface but C# allows you to inherit from / implement multiple
interfaces but inherit from one base class only.

- The short answer: An abstract class allows you to create functionality that subclasses can
implement or override. An interface only allows you to define functionality, not implement it.
And whereas a class can extend only one abstract class, it can take advantage of multiple
interfaces.

- No difference but only difference a class can inherit from one class (concrete or abstract)
but a class can implement lots of interface means more than one interface

http://
csharp-video-tutorials.blogspot.com/2012/06/part-33-c-tutorial-difference-between.html
# Design pattern link:
1. https://sourcemaking.com/design_patterns
2. read :
• Creational design patterns-> Abstract Factory,
Singleton
• Structural design patterns-> Adapter
• Behavioral design patterns-> Chain of
Resposibility
What Next??

We will learn some design patterns in next class

Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy