Design Pattern

Views:
 
Category: Entertainment
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

SCHOOL OF COMPUTER SCIENCE & ITDAVV, Indore : 

SCHOOL OF COMPUTER SCIENCE & ITDAVV, Indore DESIGN PATTERN & FRAMEWORK Guided by: Dr. U. SUMAN Presented by: SUMIT LOLE M. Tech. (CS) 1st Sem

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

INTRODUCTION : 

Object Oriented software is hard, and designing Reusable Object-Oriented software is even harder. Expert Designer do not solve every problem from first principles, they reuse the solutions that have worked for them in past. Here we’ll discuss two approaches: Design Pattern Framework INTRODUCTION

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

DESIGN PATTERN : 

“Design pattern is a general repeatable solution to a commonly-occurring problem in software design.” “Design patterns are recurring solutions to design problems.” Studying design patterns is a way of studying how the “experts” do design. “Design patterns constitute a set of rules describing how to accomplish certain tasks in the realm of software development.” DESIGN PATTERN

How Pattern Aries : 

How Pattern Aries Problem Context Solution Benefits Related Patterns Consequences Forces

Learning Process of Design Pattern : 

Learning the design patterns is a multiple step process: Acceptance Recognition Internalization Learning Process of Design Pattern

Elements of Design Pattern : 

Name Problem/ Intent Applicability Forces Solution Examples Resulting Context Rationale Related Patterns Known Uses Elements of Design Pattern

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

Types of Design Pattern : 

Creational Patterns Creational patterns are ones that create objects for you, rather than having you instantiate objects directly. Structural Patterns Structural patterns help you compose groups of objects into larger structures, such as complex user interfaces or accounting data. Behavioral Patterns Behavioral patterns help you define the communication between objects in your system and how the flow is controlled in a complex program. Types of Design Pattern

Creational Pattern : 

Factory Pattern Returned one of the several sub-classes. Abstract Factory Pattern This pattern is one level of abstraction higher than factory pattern. Singleton Pattern The Singleton pattern is grouped with the other Creational patterns. Builder Pattern Builder, as the name suggests builds complex objects from simple ones step-by-step. It separates the construction of complex objects from their representation. Prototype Pattern Creational Pattern

Factory Pattern : 

Factory Pattern public class Male extends Person {   public Male(String fullName) {System.out.println("Hello Mr. "+fullName);} }// End of class public class Female extends Person {   public Female(String fullNname) {System.out.println("Hello Ms. "+fullNname);} }// End of class

Singleton Pattern : 

Singleton Pattern

Structural Patterns : 

Structural Patterns Adapter Bridge Composite Decorator Fecade Proxy

Adapter Pattern : 

public class TeaBag { boolean teaBagIsSteeped; public TeaBag() { teaBagIsSteeped = false; } public void steepTeaInCup() { teaBagIsSteeped = true; System.out.println("tea bag is steeping in cup"); } } Adapter Pattern public class LooseLeafTea { boolean teaIsSteeped; public LooseLeafTea() { teaIsSteeped = false; } public void steepTea() { teaIsSteeped = true; System.out.println("tea is steeping"); } } public class TeaCup { public void steepTeaBag(TeaBag teaBag) { teaBag.steepTeaInCup(); } } class TestTeaBagAdaptation {public static void main(String[] args) { TeaCup teaCup = new TeaCup();System.out.println("Steeping tea bag"); TeaBag teaBag = new TeaBag(); teaCup.steepTeaBag(teaBag);System.out.println("Steeping loose leaf tea"); LooseLeafTea looseLeafTea = new LooseLeafTea(); TeaBall teaBall = new TeaBall(looseLeafTea); teaCup.steepTeaBag(teaBall); } } // Adapter public class TeaBall extends TeaBag { LooseLeafTea looseLeafTea; public TeaBall(LooseLeafTea looseLeafTeaIn) { looseLeafTea = looseLeafTeaIn; teaBagIsSteeped = looseLeafTea.teaIsSteeped; } public void steepTeaInCup() { looseLeafTea.steepTea(); teaBagIsSteeped = true; } }

Behavioral Patterns : 

Chain of responsibility Command Iterator Mediator Observer State Strategy Template method Visitor Behavioral Patterns

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

What is FRAMEWORK? : 

“A Framework is a skeleton of code used for developing an application with ease” A framework is a suite of package using which application will implement its function and non-functional requirements. Every framework has its own purpose, best-practices, restrictions and limitations. Framework in general specifies collection Of classes and Interfaces that are designed to work together to handle a particular type of Problem. What is FRAMEWORK?

Framework : 

An application framework is a specific set of classes that cooperate closely with each other and together embody a reusable design for a category of problems. E.g., Java APIs (Applet, Thread, etc) E.g., MFC, JFC, etc. A Framework dictates the architecture of an application and can be customized to get an application. (E.g., Java Applets) Framework

Examples of Framework : 

Struts and JSF – Java Server Faces are frameworks for building Web Interfaces. Toplink and Hybernate are frameworks for object persistence.  Log4J is a framework for auditory. You can use Log4J for implementing technical logs and business audit logs. J2EE its framework for building Enterprise Applications. LEAF - Lucasian Enterprise Application Framework is a white-box framework for building Enterprise Java Applications with high productivity in development and robustness in production environments. Examples of Framework

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

Difference between DESIGN PATTERN & FRAMEWORK : 

Framework A framework is a product. A framework is part of your system.  Framework is a set of well designed components with the help of which applications can be built upon.  Framework is/can be collection of patterns with implementation.   A framework is executable software. Design Pattern A design pattern is a specification Design pattern is part of your system design Design Pattern is a proven way to solve a problem programmatically. Pattern is a subset of framework. Design patterns represent knowledge and experience about software. Difference between DESIGN PATTERN & FRAMEWORK

Some More Differences . . . : 

Some More Differences . . . Major differences: Design patterns are more abstract than frameworks. Design patterns are smaller architectural elements than frameworks. Design patterns are less specialized than frameworks. “A Framework embodies a complete design of an application, while a pattern is an outline of a solution to a class of problems.” A framework can be viewed as the implementation of a system of design patterns.

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

BENEFITS : 

Design Pattern: They provide you with a way to solve issues related to software development using a proven solution. Its solutions facilitates the development of highly cohesive modules with minimal coupling. Design patterns helps to improve developer communication. Framework: Easy access to a list of pre-qualified suppliers for non-permanent workers that meet a predefined standard of service. Quality candidates that can be provided at short notice and deliver high performance. BENEFITS

AGENDA : 

Introduction Design Pattern Types of Design Patterns Framework Design pattern & Framework Comparisons Benefits References AGENDA

References : 

“The Design Patterns Java Companion” by - JAMES W. COOPER “Design Pattern Element of Reusable Object Oriented Software” by - Gamma, Helm, Johnson & Vlissides. http://www.allapplabs.com/java_design_patterns/singleton_pattern.htm http://www.theserverside.com http://www.theperlreview.com/Articles/v01/singletons.htm http://exciton.cs.oberlin.edu/javaresources/DesignPatterns/default.htm References

Any Queries . . . : 

Any Queries . . . Thank You