Builder Compositional Design – with a twist…. Problem Consider your favorite –Text editor, word processor, spreadsheet, drawing tool They allow editing.

Slides:



Advertisements
Similar presentations
Don’t Type it! OCR it! How to use an online OCR..
Advertisements

DOCUMENT TYPES. Digital Documents Converting documents to an electronic format will preserve those documents, but how would such a process be organized?
Adding Dynamic Content to your Web Site
 Consists of Creational patterns  Each generator pattern has a Client, Product, and Generator.  The Generator needs at least one operation that creates.
Design Pattern Course Builder Pattern 1 Mahdieh Monzavi AmirKabir University of Technology, Department of Computer Engineering & Information Technology.
Design Patterns CS is not simply about programming
1 Computers and Representations Ascii vs. Binary Files Over the last few million years, Earth has experienced numerous ice ages when vast regions of the.
GoF Sections 2.7 – 2.9 More Fun with Lexi. Lexi Document Editor Lexi tasks discussed:  Document structure  Formatting  Embellishing the user interface.
Reuse Activities Selecting Design Patterns and Components
CS 0008 Day 2 1. Today Hardware and Software How computers store data How a program works Operators, types, input Print function Running the debugger.
Software and Multimedia
Computer Concepts 2014 Chapter 7 The Web and .
Copyright © 2006, SAS Institute Inc. All rights reserved. Enterprise Guide 4.2 : A Primer SHRUG : Spring 2010 Presented by: Josée Ranger-Lacroix SAS Institute.
Application Software.
Peter Hinrichsen TechInsite Pty Ltd Rolling your own Object Persistence Framework (OPF) Please consider the following questions:
An Introduction to Software Architecture
CHAPTER FOUR COMPUTER SOFTWARE.
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
Introduction to Interactive Media Interactive Media Tools: Software.
XML Publisher Business Applications Government Forms.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Chapter 13-Tools for the World Wide Web. Overview Web servers. Web browsers. Web page makers and site builders. Plug-ins and delivery vehicles. Beyond.
Abstract Factory Design Pattern making abstract things.
Chapter 17 GRASP: Designing Objects with Responsibilities. 1CS6359 Fall 2011 John Cole.
Updating JUPITER framework using XML interface Kobe University Susumu Kishimoto.
Cs413_chapt01.ppt Chapter 1 Web Sites Numerous
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
Tools for information processes Organising IPT 2009.
By James Sheets. An object creational pattern. Separates the construction of a complex object from its representation so that the same construction process.
SEC (1.4) Representing Information as bit patterns.
Design Patterns -- Omkar. Introduction  When do we use design patterns  Uses of design patterns  Classification of design patterns  Creational design.
C# and Design Patterns Builder Pattern. 2 C# and Design Patterns Builder Pattern Object creational pattern Object creational pattern Separates construction.
Searches and Search Results 1 CONFIDENTIAL - LPS Real Estate Group Client Use Only.
Chapter 11 Using SAS ® Web Report Studio. Section 11.1 Overview of SAS Web Report Studio.
Chapter 14: Files and Streams. 2Microsoft Visual C# 2012, Fifth Edition Files and the File and Directory Classes Temporary storage – Usually called computer.
Chapter Three The UNIX Editors.
Builder An Object Creational Pattern Tim Rice CSPP51023 March 2, 2010.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Workshops 5 & 6 Design Patterns. Composite pattern Make Parts (components) into a Unit (composite) Client.
Structural Design Software TYLER HUTCHISON. Requirements  Develop an interface to generate a text file.  The text file is then passed to one of five.
File Formats in the Context of Archiving Dr. Thomas Fischer EMANI – Project Meeting February 14 th - 16 th, 2002 Springer-Verlag Heidelberg Göttingen State.
Steps to integrate XML How does XML processing work? Simple uses of passive DOM objects Adding behaviour to information A converter and translator subsystem.
Files in Python The Basics. Why use Files? Very small amounts of data – just hardcode them into the program A few pieces of data – ask the user to input.
A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and Applications software. Systems.
MiniDraw Introducing a Framework... and a few patterns.
Chapter – 8 Software Tools.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Huang-Ming Huang, Shih-Ling Chen, Sajeeva Pallemulle.
Design Patterns Creational Patterns. Abstract the instantiation process Help make the system independent of how its objects are created, composed and.
XML Extensible Markup Language
XML scheme for configuration data V.Černý on behalf of the Bratislava group Initiated by Marco’s call:...a software layer for implementing the handling.
1 AQA ICT AS Level © Nelson Thornes 2008 Operating Systems What are they and why do we need them?
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
Command Pattern. Intent encapsulate a request as an object  can parameterize clients with different requests, queue or log requests, support undoable.
GCSE ICT Data Transfer. Data transfer Users often need to transfer data between software packages or computers. Until relatively recently this was difficult.
Topic 2: Hardware and Software
GCSE ICT Data Transfer.
Turning method call into an object
Design Patterns Lecture part 2.
Guide To UNIX Using Linux Third Edition
Chapter 8, Design Patterns Builder
Representing Information as bit patterns
COMPSCI 111 / 111G An introduction to practical computing
Jim Fawcett CSE776 – Design Patterns Summer 2003
Ms Munawar Khatoon IV Year I Sem Computer Science Engineering
Tutorial Developing a Basic Web Page
funCTIONs and Data Import/Export
Creational Patterns.
Software Engineering and Architecture
Software Engineering and Architecture
Presentation transcript:

Builder Compositional Design – with a twist…

Problem Consider your favorite –Text editor, word processor, spreadsheet, drawing tool They allow editing a complex data structure representing a document, spreadsheet, etc.

Problem But they also need to save it to a persistent store, typically a hard disk. –Converting internal data structure to external format –Ex: Binary encoding, XML, HTML, RTF, PDF, …

Example A document consists of –Sections, subsections –paragraphs We like to output in formats: HTML Or ASCII

3-1-2 A classic variability problem

Dynamics Create the builder –User chose ‘html’ or ‘ascii’ The common part is the director that knows the structure and iterates over all its parts. The builder handles building each part for the particular output format Output data structure is known to the client

A Fake Object WordProcessor Note: Also plays the Director role! (Quite often the case) Note: Also plays the Director role! (Quite often the case)

Demo Code

Builder part

Exercise Why is there no getResult method defined in the interface???

The Pattern

Aspects Benefits are –Fine grained control over the building process Compare to Abstract Factory –Construction process and part construction decoupled Change by addition to support new formats Many-to-many relation between directors and builders –Reuse the builders in other directors… Liabilities –Client must know the product of the builder as well as the concrete builder types