Programmeerimine Delphi keskkonnas MTAT.03.214 Programmeerimine Delphi keskkonnas MTAT.03.214 Jelena Zaitseva

Slides:



Advertisements
Similar presentations
Design Patterns.
Advertisements

Design Patterns based on book of Gang of Four (GoF) Erich Gamma, Richard Helm, Ralph Johnson, and John VlissidesGang of Four (GoF) Elements of Reusable.
Welcome to. Who am I? A better way to code Design Patterns ???  What are design patterns?  How many are there?  How do I use them?  When do I use.
Nov R McFadyen1 Design Patterns (GoF) contains the creational patterns: Abstract factory Builder Factory method (section 23.3 has a Simple.
 Consists of Creational patterns  Each generator pattern has a Client, Product, and Generator.  The Generator needs at least one operation that creates.
Design Patterns CS is not simply about programming
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
7/16/2015Singleton creational design pattern1 Eivind J. Nordby Karlstad University Dept. of Computer Science.
Chapter 26 Applying Gang of Four Design Patterns 1CS6359 Fall 2012 John Cole.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
Design Patterns.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
CSSE 374: Introduction to Gang of Four Design Patterns
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Factory, Singleton & Strategy All References and Material From: Applying UML and Patterns, 3 rd ed, chpt 26 & 13 BTS530: Major Project Planning and Design.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Design Pattern. The Observer Pattern The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Unit 4 Object-Oriented Design Patterns NameStudent Number CAI XIANGHT082182A KYAW THU LINHT082238Y LI PENGFEIHT082220L NAUNG NAUNG LATTHT082195L PLATHOTTAM.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
ECE450S – Software Engineering II
Patterns in programming1. 2 What are patterns? Answers to common design problems. A language used by developers –To discuss answers to design problems.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
CDP-1 9. Creational Pattern. CDP-2 Creational Patterns Abstracts instantiation process Makes system independent of how its objects are –created –composed.
Introduction to Design Patterns. Questions What is a design pattern? Who needs design patterns? How different are classes and objects in APL compared.
CS 4233 Review Feb February Review2 Outline  Previous Business – My.wpi.edu contains all grades to date for course – Review and contact.
Design Patterns Yonglei Tao. Design Patterns  A design pattern describes a recurring design problem, a solution, and the context in which that solution.
CSC 480 Software Engineering Design With Patterns.
OO Methodology Elaboration Iteration 2 - Design Patterns -
Gang of Four Patterns 23 total 15 useful How are they different from GRASP Patterns?
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns David Talby. This Lecture Re-routing method calls Chain of Responsibility Coding partial algorithms Template Method The Singleton Pattern.
Design Patterns Introduction
BEHAVIORAL PATTERNS 13-Sep-2012 Presenters Sanjeeb Kumar Nanda & Shankar Gogada.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
StarBuzz Coffee Recipe Boil some water Brew coffee in boiling water Pour coffee in cup Add sugar and milk Tea Recipe Boil some water Steep tea in boiling.
Singleton Pattern. Problem Want to ensure a single instance of a class, shared by all uses throughout a program Context Need to address initialization.
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
Design Patterns: MORE Examples
Design Patterns: Brief Examples
Chapter 10 Design Patterns.
Presentation on GoF Design Patterns Submitted by WWW. ASSIGNMENTPOINT
GoF Patterns (GoF) popo.
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Design Patterns C++ Java C#.
Introduction to Design Patterns
Software Design and Architecture
object oriented Principles of software design
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Presented by Igor Ivković
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
Software Engineering Lecture 7 - Design Patterns
GoF Design Patterns (Ch. 26)
Object Oriented Design Patterns - Behavioral Patterns
CSC 480 Software Engineering
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
GoF Design Patterns (Ch. 26)
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
CSC 480 Software Engineering
Presented by Igor Ivković
GoF Patterns Ch. 26.
Presentation transcript:

Programmeerimine Delphi keskkonnas MTAT Programmeerimine Delphi keskkonnas MTAT Jelena Zaitseva

Design patterns – frequently recurring structures and relationships in object- oriented design. Design patterns – frequently recurring structures and relationships in object- oriented design.

adapter adapter singleton singleton template method template method factory factory observer observer

adapter PROBLEM: How to resolve incompatible interfaces, or provide a stable interface to similar components with different interfaces? SOLUTION: Convert the original interface of a component into another interface, through an intermediate adapter object.

singleton PROBLEM: Exactly one instance of a class is allowed – it is a “singleton”. Objects need a global and single point of access. SOLUTION: Define a static method of a class that returns the singleton.

singleton Benefits: Benefits: –controlled access to sole instance –reduced name space –permits refinement of operations and representations –permits a variable number of instances

template method template method – “define the skeleton of an algorithm in an operation, deferring some steps to subclasses” template method – “define the skeleton of an algorithm in an operation, deferring some steps to subclasses” Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

template method The pattern is essentially an extension of abstract methods to more complex algorithms. The pattern is essentially an extension of abstract methods to more complex algorithms.

factory PROBLEM: Who should be responsible for creating objects when there are special considerations, such as complex creation logic, a desire to separate the creation responsibilities for better cohesion, and so forth? SOLUTION: Create an object called a Factory that handles the creation.

Observer PROBLEM: Different kinds of subscriber objects are interested in the state changes or events of a publisher object, and want to react in their own unique way when the publisher generates an event. Moreover, the publisher wants to maintain low coupling to the subscribers. What to do? SOLUTION: Define a “subscriber” or “listener” interface. Subscribers implement this interface. The publisher can dynamically register subscribers who are interested in an event, and notify them when an event occurs.