Design Patterns in Python
|
|
- Magnus Cole
- 2 years ago
- Views:
Transcription
1 Design Patterns in Python Alex Martelli Copyright 2007, Google Inc
2 The "levels" of this talk Shu ("Retain") DP Ha ("Detach") Py Ri ("Transcend") 2
3 Hit the ground running... "Forces": some rich, complex subsystem offers a lot of useful functionality; client code interacts with several parts of this functionality in a way that's "out of control" this causes many problems for client-code programmers AND subsystem ones too (complexity + rigidity) 3
4 Solution: the "Facade" DP interpose a simpler "Facade" object/class exposing a controlled subset of functionality DP "Facade" client code now calls existing supplier code! provides ric into the Facade, only complex functionality in protocol S the Facade implements we need a simpler "subset" C of S facade code " implements and supp its simpler functionality (by calling S on!) via calls into the rich, complex subsystem subsystem implementation gains flexibility, clients gain simplicity!!! 2004 AB Strakt 4 17
5 Facade is a Design Pattern summary of a frequent design problem + structure of a solution to that problem (+ pros and cons, alternatives,...), and: A NAME (much easier to retain/discuss!) "descriptions of communicating objects and classes customized to solve a general design problem in a particular context" that's NOT: a data structure, algorithm, domain-specific system architecture, programming-language/library feature MUST be studied in a language's context! MUST supply Known Uses ("KU") 5
6 Some Facade KUs...in the Python standard library...: dbhash facades for bsddb highly simplified/subset access also meets the "dbm" interface (thus, also an example of the Adapter DP) os.path: basename, dirname facade for split + indexing; isdir (&c) facade for os.stat + stat.s_isdir (&c) Facade is a structural DP (we'll see another, Adapter, later; in dbhash, they "merge"!-) 6
7 Design Patterns 7
8 What's a Design Pattern summary of a frequent design problem + structure of a solution to that problem + pros and cons, alternatives,..., and: A NAME (much easier to retain/discuss!) "descriptions of communicating objects and classes customized to solve a general design problem in a particular context" DPs are NOT: data structures, algorithms, domain-specific system architectures, programming language features MUST be studied in a language's context! MUST supply Known Uses ("KU") 8
9 Many Good DP Books (biblio on the last slide) 9
10 Classic DP Categories Creational: ways and means of object instantiation Structural: mutual composition of classes or objects (the Facade DP is Structural) Behavioral: how classes or objects interact and distribute responsibilities among them Each can be class-level or object-level 10
11 Prolegomena to DPs "program to an interface, not to an implementation" that's mostly done with "duck typing" in Python -- rarely w/"formal" interfaces actually similar to "signature-based polymorphism" in C++ templates 11
12 Duck Typing Helps a Lot! Teaching the ducks to type takes a while, but saves you a lot of work afterwards!-) 12
13 Prolegomena to DPs "favor object composition over class inheritance" in Python: hold, or wrap inherit only when it's really convenient expose all methods in base class (reuse + usually override + maybe extend) but, it's a very strong coupling! 13
14 Python: hold or wrap? 14
15 Python: hold or wrap? Hold : object O has subobject S as an attribute (maybe property) -- that s all use self.s.method or O.S.method simple, direct, immediate, but... pretty strong coupling, often on the wrong axis holder holdee client 15
16 Python: hold or wrap? Wrap : hold (often via private name) plus delegation (so you directly use O.method) explicit (def method(self...)...self.s.method) automatic (delegation in getattr ) gets coupling right (Law of Demeter) wrapper wrappee client 16
17 E.g: wrap to "restrict" class RestrictingWrapper(object): def init (self, w, block): self._w = w self._block = block def getattr (self, n): if n in self._block: raise AttributeError, n return getattr(self._w, n)... Inheritance cannot restrict! 17
18 Creational Patterns not very common in Python......because "factory" is essentially built-in!-) 18
19 Creational Patterns [1] "we want just one instance to exist" use a module instead of a class no subclassing, no special methods,... make just 1 instance (no enforcement) need to commit to "when" to make it singleton ("highlander") subclassing not really smooth monostate ("borg") Guido dislikes it 19
20 Singleton ("Highlander") class Singleton(object): def new (cls, *a, **k): if not hasattr(cls, '_inst'): cls._inst = super(singleton, cls ). new (cls, *a, **k) return cls._inst subclassing is a problem, though: class Foo(Singleton): pass class Bar(Foo): pass f = Foo(); b = Bar(); #...???... problem is intrinsic to Singleton 20
21 Monostate ("Borg") class Borg(object): _shared_state = {} def new (cls, *a, **k): obj = super(borg, cls ). new (cls, *a, **k) obj. dict = cls._shared_state return obj subclassing is no problem, just: class Foo(Borg): pass class Bar(Foo): pass class Baz(Foo): _shared_state = {} data overriding to the rescue! 21
22 Creational Patterns [2] "we don't want to commit to instantiating a specific concrete class" "Dependency Injection" DP no creation except "outside" what if multiple creations are needed? "Factory" subcategory of DPs may create w/ever or reuse existing factory functions (& other callables) factory methods (overridable) abstract factory classes 22
23 Structural Patterns "Masquerading/Adaptation" subcategory: Adapter: tweak an interface (both class and object variants exist) Facade: simplify a subsystem's interface...and many others I don't cover, such as: Bridge: many implementations of an abstraction, many implementations of a functionality, no repetitive coding Decorator: reuse+tweak w/o inheritance Proxy: decouple from access/location 23
24 Adapter client code γ requires a protocol C supplier code σ provides different protocol S (with a superset of C's functionality) adapter code α "sneaks in the middle": to γ, α is a supplier (produces protocol C) to σ, α is a client (consumes protocol S) "inside", α implements C (by means of appropriate calls to S on σ) 24
25 Toy-example Adapter C requires method foobar(foo, bar) S supplies method barfoo(bar, foo) e.g., σ could be: class Barfooer(object): def barfoo(self, bar, foo):... 25
26 Object Adapter per-instance, with wrapping delegation: class FoobarWrapper(object): def init (self, wrappee): self.w = wrappee def foobar(self, foo, bar): return self.w.barfoo(bar, foo) foobarer=foobarwrapper(barfooer) 26
27 Class Adapter (direct) per-class, w/subclasing & self-delegation: class Foobarer(Barfooer): def foobar(self, foo, bar): return self.barfoo(bar, foo) foobarer=foobarer(...w/ever...) 27
28 Class Adapter (mixin) flexible, good use of multiple inheritance: class BF2FB: def foobar(self, foo, bar): return self.barfoo(bar, foo) class Foobarer(BF2FB, Barfooer): pass foobarer=foobarer(...w/ever...) 28
29 Adapter KU socket._fileobject: from sockets to file-like objects (w/much code for buffering) doctest.doctestsuite: adapts doctest tests to unittest.testsuite dbhash: adapt bsddb to dbm StringIO: adapt str or unicode to file-like shelve: adapt "limited dict" (str keys and values, basic methods) to complete mapping via pickle for any <-> string + UserDict.DictMixin 29
30 Adapter observations some RL adapters may require much code mixin classes are a great way to help adapt to rich protocols (implement advanced methods on top of fundamental ones) Adapter occurs at all levels of complexity in Python, it's _not_ just about classes and their instances (by a long shot!-) -- often _callables_ are adapted (via decorators and other HOFs, closures, functools,...) 30
31 Facade vs Adapter Adapter's about supplying a given protocol required by client-code or, gain polymorphism via homogeneity Facade is about simplifying a rich interface when just a subset is often needed Facade most often "fronts" for a subsystem made up of many classes/objects, Adapter "front" for just one single object or class 31
32 Behavioral Patterns Template Method: self-delegation..."the essence of OOP"... some of its many Python-specific variants 32
33 Template Method great pattern, lousy name "template" very overloaded generic programming in C++ generation of document from skeleton... a better name: self-delegation directly descriptive!-) 33
34 Classic TM abstract base class offers "organizing method" which calls "hook methods" in ABC, hook methods stay abstract concrete subclasses implement the hooks client code calls organizing method on some reference to ABC (injecter, or...) which of course refers to a concrete SC 34
35 TM skeleton class AbstractBase(object): def orgmethod(self): self.dothis() self.dothat() class Concrete(AbstractBase): def dothis(self):... def dothat(self):... 35
36 KU: cmd.cmd.cmdloop def cmdloop(self): self.preloop() while True: s = self.doinput() s = self.precmd(s) finis = self.docmd(s) finis = self.postcmd(finis,s) if finis: break self.postloop() 36
37 Classic TM Rationale the "organizing method" provides "structural logic" (sequencing &c) the "hook methods" perform "actual ``elementary'' actions" it's an often-appropriate factorization of commonality and variation focuses on objects' (classes') responsibilities and collaborations: base class calls hooks, subclass supplies them applies the "Hollywood Principle": "don't call us, we'll call you" 37
38 A choice for hooks class TheBase(object): def dothis(self): # provide a default (often a no-op) pass def dothat(self): # or, force subclass to implement # (might also just be missing...) raise NotImplementedError Default implementations often handier, when sensible; but "mandatory" may be good docs. 38
39 KU: Queue.Queue class Queue:... def put(self, item): self.not_full.acquire() try: while self._full(): self.not_full.wait() self._put(item) self.not_empty.notify() finally: self.not_full.release() def _put(self, item):... 39
40 Queue s TMDP Not abstract, often used as-is thus, implements all hook-methods subclass can customize queueing discipline with no worry about locking, timing,... default discipline is simple, useful FIFO can override hook methods (_init, _qsize, _empty, _full, _put, _get) AND......data (maxsize, queue), a Python special 40
41 Customizing Queue class LifoQueueA(Queue): def _put(self, item): self.queue.appendleft(item) class LifoQueueB(Queue): def _init(self, maxsize): self.maxsize = maxsize self.queue = list() def _get(self): return self.queue.pop() 41
42 "Factoring out" the hooks "organizing method" in one class "hook methods" in another KU: HTML formatter vs writer KU: SAX parser vs handler adds one axis of variability/flexibility shades towards the Strategy DP: Strategy: 1 abstract class per decision point, independent concrete classes Factored TM: abstract/concrete classes more "grouped" 42
43 TM + introspection "organizing" class can snoop into "hook" class (maybe descendant) at runtime find out what hook methods exist dispatch appropriately (including "catchall" and/or other error-handling) 43
44 KU: cmd.cmd.docmd def docmd(self, cmd, a):... try: fn = getattr(self, 'do_' + cmd) except AttributeError: return self.dodefault(cmd, a) return fn(a) 44
45 Questions & Answers Q? A! 45
46 1.Design Patterns: Elements of Reusable Object-Oriented Software -- Gamma, Helms, Johnson, Vlissides -- advanced, very deep, THE classic "Gang of 4" book that started it all (C++) 2.Head First Design Patterns -- Freeman -- introductory, fast-paced, very hands-on (Java) 3.Design Patterns Explained -- Shalloway, Trott -- introductory, mix of examples, reasoning and explanation (Java) 4.The Design Patterns Smalltalk Companion -- Alpert, Brown, Woolf -- intermediate, very language-specific (Smalltalk) 5.Agile Software Development, Principles, Patterns and Practices -- Martin -- intermediate, extremely practical, great mix of theory and practice (Java, C++) 6.Refactoring to Patterns -- Kerievsky -- introductory, strong emphasis on refactoring existing code (Java) 7.Pattern Hatching, Design Patterns Applied -- Vlissides -- advanced, anecdotal, specific applications of idea from the Gof4 book (C++) 8.Modern C++ Design: Generic Programming and Design Patterns Applied -- Alexandrescu -- advanced, very language specific (C++) 46
Python Dependency Injection
Python Dependency Injection Alex Martelli (aleax@google.com) http://www.aleax.it/yt_pydi.pdf Copyright 2008, Google Inc The "levels" of this talk Shu ("Retain") Ha ("Detach") Py DP Ri ("Transcend") 2 The
Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering
Patterns in Software Engineering Lecturer: Raman Ramsin Lecture 2 GoF Design Patterns Creational 1 GoF Design Patterns Principles Emphasis on flexibility and reuse through decoupling of classes. The underlying
Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING. The Design-Code-Debug Cycle. Divide and Conquer! Documentation is Code
Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING Lecture 16 CS2110 Spring 2013 2 Don't sit down at the terminal immediately and start hacking Design stage THINK first about the data you
DESIGN PATTERNS MOCK TEST DESIGN PATTERNS MOCK TEST I
http://www.tutorialspoint.com DESIGN PATTERNS MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Design Patterns Framework. You can download these sample
ios Design Patterns Jackie Myrose CSCI 5448 Fall 2012
ios Design Patterns Jackie Myrose CSCI 5448 Fall 2012 Design Patterns A design pattern is a common solution to a software problem They are helpful for speeding up problem solving, ensuring that a developer
Objects and classes. Objects and classes. Jarkko Toivonen (CS Department) Programming in Python 1
Objects and classes Jarkko Toivonen (CS Department) Programming in Python 1 Programming paradigms of Python Python is an object-oriented programming language like Java and C++ But unlike Java, Python doesn
Code Qualities and Coding Practices
Code Qualities and Coding Practices Practices to Achieve Quality Scott L. Bain and the Net Objectives Agile Practice 13 December 2007 Contents Overview... 3 The Code Quality Practices... 5 Write Tests
Structural Design Patterns Used in Data Structures Implementation
Structural Design Patterns Used in Data Structures Implementation Niculescu Virginia Department of Computer Science Babeş-Bolyai University, Cluj-Napoca email address: vniculescu@cs.ubbcluj.ro November,
ABSTRACT FACTORY AND SINGLETON DESIGN PATTERNS TO CREATE DECORATOR PATTERN OBJECTS IN WEB APPLICATION
ABSTRACT FACTORY AND SINGLETON DESIGN PATTERNS TO CREATE DECORATOR PATTERN OBJECTS IN WEB APPLICATION Vijay K Kerji Department of Computer Science and Engineering, PDA College of Engineering,Gulbarga,
PHP5 Design Patterns in a Nutshell. By Janne Ohtonen, August 2006
By Janne Ohtonen, August 2006 Contents PHP5 Design Patterns in a Nutshell... 1 Introduction... 3 Acknowledgments... 3 The Active Record Pattern... 4 The Adapter Pattern... 4 The Data Mapper Pattern...
Design Patterns. Advanced Software Paradigms (A. Bellaachia) 1
Design Patterns 1. Objectives... 2 2. Definitions... 3 2.1. What is a Pattern?... 3 2.2. Categories of Patterns... 4 3. Pattern Characteristics [Buschmann]:... 5 4. Essential Elements of a Design Pattern
Course MS10975A Introduction to Programming. Length: 5 Days
3 Riverchase Office Plaza Hoover, Alabama 35244 Phone: 205.989.4944 Fax: 855.317.2187 E-Mail: rwhitney@discoveritt.com Web: www.discoveritt.com Course MS10975A Introduction to Programming Length: 5 Days
Design Patterns. Design patterns are known solutions for common problems. Design patterns give us a system of names and ideas for common problems.
Design Patterns Design patterns are known solutions for common problems. Design patterns give us a system of names and ideas for common problems. What are the major description parts? Design Patterns Descriptions
Advanced C++ Programming
Advanced C++ Programming Course ID CPP110 Course Description The comprehensive, five-day course consists of three modules. A preliminary module reviews topics, including inheritance, the ANSI C++ Standard
Génie Logiciel et Gestion de Projets. Patterns
Génie Logiciel et Gestion de Projets Patterns 1 Alexander s patterns Christoffer Alexander The Timeless Way of Building, Christoffer Alexander, Oxford University Press, 1979, ISBN 0195024028 Each pattern
Teaching Object-Oriented Software Design within the Context of Software Frameworks
Teaching Object-Oriented Software Design within the Context of Software Frameworks Zoya Ali, Joseph Bolinger, Michael Herold, Thomas Lynch, Jay Ramanathan, Rajiv Ramnath The Ohio State University, aliz@cse.ohio-state.edu,
The Facade Pattern. According to the Gang of Four, the intent of the Facade pattern is to
CHAPTER 6 The Facade Pattern Overview I start the study of design patterns with a pattern that you have probably implemented in the past but may not have had a name for: the Facade pattern. In this chapter
The Command Dispatcher Pattern
The Command Dispatcher Pattern Can also be called: Command Evaluator Pattern. Benoit Dupire and Eduardo B Fernandez {bdupire@seatech.fau.edu, ed@cse.fau.edu} Department of Computer Science and Engineering.
Agile Software Development
Agile Software Development Principles, Patterns, and Practices Robert Cecil Martin Alan Apt Series Prentice «: : Hall Pearson Education, Inc. Upper Saddle River, New Jersey 07458 Foreword Preface About
GenericServ, a Generic Server for Web Application Development
EurAsia-ICT 2002, Shiraz-Iran, 29-31 Oct. GenericServ, a Generic Server for Web Application Development Samar TAWBI PHD student tawbi@irit.fr Bilal CHEBARO Assistant professor bchebaro@ul.edu.lb Abstract
REST Client Pattern. [Draft] Bhim P. Upadhyaya ABSTRACT
REST Client Pattern [Draft] Bhim P. Upadhyaya EqualInformation Chicago, USA bpupadhyaya@gmail.com ABSTRACT Service oriented architecture (SOA) is a common architectural practice in large enterprises. There
ARCHITECTURAL DESIGN OF MODERN WEB APPLICATIONS
ARCHITECTURAL DESIGN OF MODERN WEB APPLICATIONS Lech MADEYSKI *, Michał STOCHMIAŁEK Abstract. Architectural design is about decisions which influence characteristics of arising system e.g. maintainability
Python, C++ and SWIG
Robin Dunn Software Craftsman O Reilly Open Source Convention July 21 25, 2008 Slides available at http://wxpython.org/oscon2008/ Python & C++ Comparisons Each is a general purpose programming language,
Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces
Software Engineering, Lecture 4 Decomposition into suitable parts Cross cutting concerns Design patterns I will also give an example scenario that you are supposed to analyse and make synthesis from The
Master s Project Proposal An Application to create Problem- Specific DOMs for XML
Master s Project Proposal An Application to create Problem- Specific DOMs for XML Liangxiao Zhu lxz0062@cs.rit.edu October 9, 2002 1. SUMMARY... 2 2. OVERVIEW... 2 3. FUNCTIONAL SPECIFICATION... 3 3.1
JOURNAL OF OBJECT TECHNOLOGY
JOURNAL OF OBJECT TECHNOLOGY Online at http://www.jot.fm. Published by ETH Zurich, Chair of Software Engineering JOT, 2009 Vol. 8, No. 5, July-August 2009 The Application of Design Patterns to Develop
SL-110: Fundamentals of Java Revision 15 October Sun Educational Services Instructor-Led Course Description
Sun Educational Services Instructor-Led Course Description Fundamentals of Java SL-110 The Fundamentals of the Java course provides students, with little or no programming experience, with the basics of
Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.
Web Frameworks web development done right Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.ssa Anna Corazza Outline 2 Web technologies evolution Web frameworks Design Principles
MiniDraw Introducing a framework... and a few patterns
MiniDraw Introducing a framework... and a few patterns What is it? [Demo] 2 1 What do I get? MiniDraw helps you building apps that have 2D image based graphics GIF files Optimized repainting Direct manipulation
Fundamental Computer Science Concepts Sequence TCSU CSCI SEQ A
Fundamental Computer Science Concepts Sequence TCSU CSCI SEQ A A. Description Introduction to the discipline of computer science; covers the material traditionally found in courses that introduce problem
Glossary of Object Oriented Terms
Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction
Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition
Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating
Lecture Notes on Programming Languages
Lecture Notes on Programming Languages 1 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered include:
Fundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example
Overview Elements of Programming Languages Lecture 12: Object-oriented functional programming James Cheney University of Edinburgh November 6, 2015 We ve now covered: basics of functional and imperative
Java EE Web Development Course Program
Java EE Web Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive types, variables, basic operators, expressions,
Johannes Sametinger. C. Doppler Laboratory for Software Engineering Johannes Kepler University of Linz A-4040 Linz, Austria
OBJECT-ORIENTED DOCUMENTATION C. Doppler Laboratory for Software Engineering Johannes Kepler University of Linz A-4040 Linz, Austria Abstract Object-oriented programming improves the reusability of software
Twin A Design Pattern for Modeling Multiple Inheritance
Twin A Design Pattern for Modeling Multiple Inheritance Hanspeter Mössenböck University of Linz, Institute of Practical Computer Science, A-4040 Linz moessenboeck@ssw.uni-linz.ac.at Abstract. We introduce
CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards
CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards Course Title: TeenCoder: Java Programming Course ISBN: 978 0 9887070 2 3 Course Year: 2015 Note: Citation(s) listed may represent
CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.
CSCI 253 Object Oriented Design: Java Review OOP George Blankenship George Blankenship 1 Object Oriented Programming (OOP) OO Principles Abstraction Encapsulation Abstract Data Type (ADT) Implementation
GRASP Design Principles. By Danya Rao
GRASP Design Principles By Danya Rao GRASP stands for General Responsibility Assignment Software Patterns guides in assigning responsibilities to collaborating objects. 9 GRASP patterns Creator Information
Design Patterns in Parsing
Abstract Axel T. Schreiner Department of Computer Science Rochester Institute of Technology 102 Lomb Memorial Drive Rochester NY 14623-5608 USA ats@cs.rit.edu Design Patterns in Parsing James E. Heliotis
A Reusability Concept for Process Automation Software
A Reusability Concept for Process Automation Software Wolfgang Narzt, Josef Pichler, Klaus Pirklbauer, Martin Zwinz Business Information Systems C. Doppler Laboratory for Software Engineering University
The Phases of an Object-Oriented Application
The Phases of an Object-Oriented Application Reprinted from the Feb 1992 issue of The Smalltalk Report Vol. 1, No. 5 By: Rebecca J. Wirfs-Brock There is never enough time to get it absolutely, perfectly
10266A: Programming in C# with Microsoft Visual Studio 2010
10266A: Programming in C# with Microsoft Visual Studio 2010 Course Overview The course focuses on the C# program structure, language syntax, and implementation details with.net Framework 4.0. This course
Software Engineering. Software Reuse. Based on Software Engineering, 7 th Edition by Ian Sommerville
Software Engineering Software Reuse Based on Software Engineering, 7 th Edition by Ian Sommerville Objectives To explain the benefits of software reuse and some reuse problems To discuss several different
Using Testing and JUnit Across The Curriculum
Using Testing and JUnit Across The Curriculum Michael Wick, Daniel Stevenson and Paul Wagner Department of Computer Science University of Wisconsin-Eau Claire Eau Claire, WI 54701 {wickmr, stevende, wagnerpj@uwec.edu
Computing Concepts with Java Essentials
2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann
Design with Reuse. Building software from reusable components. Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 1
Design with Reuse Building software from reusable components. Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 1 Objectives To explain the benefits of software reuse and some reuse
DESIGN PATTERN GENERATOR FOR PYTHON
Project Number. GFP1405 DESIGN PATTERN GENERATOR FOR PYTHON A Major Qualifying Project Report: submitted to the faculty of the WORCESTER POLYTECHNIC INSTITUTE in partial fulfillment of the requirements
ATV Data Link Simulator: A Development based on a CCSDS Layers Framework
SpaceOps 2010 ConferenceDelivering on the DreamHosted by NASA Mars 25-30 April 2010, Huntsville, Alabama AIAA 2010-2089 ATV Data Link Simulator: A Development based on a CCSDS
Name Spaces. Introduction into Python Python 5: Classes, Exceptions, Generators and more. Classes: Example. Classes: Briefest Introduction
Name Spaces Introduction into Python Python 5: Classes, Exceptions, Generators and more Daniel Polani Concept: There are three different types of name spaces: 1. built-in names (such as abs()) 2. global
Design Patterns. Dennis Mancl Alcatel-Lucent Bell Labs. November 28, 2007
Design Patterns Dennis Mancl Alcatel-Lucent Bell Labs November 28, 2007 1 1 Design Patterns Outline What is a pattern? The Design Patterns Book One example pattern: Singleton Patterns versus Idioms Wrapping
Design Patterns and ColdFusion. Sean A Corfield Chief Systems Architect Broadchoice, Inc.
Design Patterns and ColdFusion Sean A Corfield Chief Systems Architect Broadchoice, Inc. Patterns describe problems and solutions Each pattern describes a problem which occurs over and over again in our
CS193j, Stanford Handout #10 OOP 3
CS193j, Stanford Handout #10 Summer, 2003 Manu Kumar OOP 3 Abstract Superclass Factor Common Code Up Several related classes with overlapping code Factor common code up into a common superclass Examples
Framework Development for Large Systems
Framework Development for Large Systems Dirk Bäumer 1, Guido Gryczan 2, Rolf Knoll 3, Carola Lilienthal 2, Dirk Riehle 4, and Heinz Züllighoven 2 Abstract Frameworks are a key asset in large-scale object-oriented
Course 10550A: Programming in Visual Basic with Microsoft Visual Studio 2010 OVERVIEW
Course 10550A: Programming in Visual Basic with Microsoft Visual Studio 2010 OVERVIEW About this Course This course teaches you Visual Basic language syntax, program structure, and implementation by using
Course: Introduction to Java Using Eclipse Training
Course: Introduction to Java Using Eclipse Training Course Length: Duration: 5 days Course Code: WA1278 DESCRIPTION: This course introduces the Java programming language and how to develop Java applications
Xtreme RUP. Ne t BJECTIVES. Lightening Up the Rational Unified Process. 2/9/2001 Copyright 2001 Net Objectives 1. Agenda
Xtreme RUP by Ne t BJECTIVES Lightening Up the Rational Unified Process 2/9/2001 Copyright 2001 Net Objectives 1 RUP Overview Agenda Typical RUP Challenges Xtreme Programming Paradigm Document driven or
Excerpts from Chapter 4, Architectural Modeling -- UML for Mere Mortals by Eric J. Naiburg and Robert A. Maksimchuk
Excerpts from Chapter 4, Architectural Modeling -- UML for Mere Mortals by Eric J. Naiburg and Robert A. Maksimchuk Physical Architecture As stated earlier, architecture can be defined at both a logical
Managing Variability in Software Architectures 1 Felix Bachmann*
Managing Variability in Software Architectures Felix Bachmann* Carnegie Bosch Institute Carnegie Mellon University Pittsburgh, Pa 523, USA fb@sei.cmu.edu Len Bass Software Engineering Institute Carnegie
Agile Software Development
Agile Software Development Lecturer: Raman Ramsin Lecture 13 Refactoring Part 3 1 Dealing with Generalization: Pull Up Constructor Body Pull Up Constructor Body You have constructors on subclasses with
Automating Rich Internet Application Development for Enterprise Web 2.0 and SOA
Automating Rich Internet Application Development for Enterprise Web 2.0 and SOA Enterprise Web 2.0 >>> FAST White Paper November 2006 Abstract Modern Rich Internet Applications for SOA have to cope with
Introduction to Java A First Look
Introduction to Java A First Look Java is a second or third generation object language Integrates many of best features Smalltalk C++ Like Smalltalk Everything is an object Interpreted or just in time
Framework Development for Large Systems
Framework Development for Large Systems Dirk Bäumer RWG Stuttgart Guido Gryczan University of Hamburg Vogt-Kölln-Str. 30 22527 Hamburg Germany Phone: +49-40-54 94-2302 Fax: +49-40-54 94-2303 Email:gryczan@informatik.uni-hamburg.de
The WebShop e-commerce framework
The WebShop e-commerce framework Marcus Fontoura 1, Wolfgang Pree 2, and Bernhard Rumpe 3 1 Cyberspace and Web Technology Department, IBM Almaden Research Center 650 Harry Rd., San Jose, CA, 91520, U.S.A
September 18, 2014. Modular development in Magento 2. Igor Miniailo Magento
September 18, 2014 Modular development in Magento 2 Igor Miniailo Magento Agenda 1 Magento 2 goals 2 Magento 1 modules 3 Decoupling techniques 4 Magento 2 is it getting better? 5 Modularity examples Magento
JavaScript Patterns. Stoyan Stefanov. O'REILLY' Beijing Cambridge Farnham Koln Sebastopol Tokyo
JavaScript Patterns Stoyan Stefanov O'REILLY' Beijing Cambridge Farnham Koln Sebastopol Tokyo Table of Contents Preface xi 1. Introduction 1 Patterns 1 JavaScript: Concepts 3 Object-Oriented 3 No Classes
Core Java+ J2EE+Struts+Hibernate+Spring
Core Java+ J2EE+Struts+Hibernate+Spring Java technology is a portfolio of products that are based on the power of networks and the idea that the same software should run on many different kinds of systems
History OOP languages Year Language 1967 Simula-67 1983 Smalltalk
History OOP languages Intro 1 Year Language reported dates vary for some languages... design Vs delievered 1957 Fortran High level programming language 1958 Lisp 1959 Cobol 1960 Algol Structured Programming
socketio Documentation
socketio Documentation Release 0.1 Miguel Grinberg January 17, 2016 Contents 1 What is Socket.IO? 3 2 Getting Started 5 3 Rooms 7 4 Responses 9 5 Callbacks 11 6 Namespaces 13 7 Using a Message Queue 15
RenderCAD S.r.l. Formazione
Descrizione This course teaches participants how to develop Java programs. The course focuses on teaching the core Java language (J2SE), including essential object-oriented principles. In addition to Java,
Object Oriented Programming (Interview Questions & Answers)
Object Oriented Programming (Interview Questions & Answers) Collected from different websites. Use for non-commercial purpose. Sohail Basheer Lecturer- Computer Science (visiting) Department of Computer
NOTICE: This is the author s version of a work accepted for publication by Wiley. Changes resulting from the publishing process, including peer
NOTICE: This is the author s version of a work accepted for publication by Wiley. Changes resulting from the publishing process, including peer review, editing, corrections, structural formatting and other
Programming in Python. Basic information. Teaching. Administration Organisation Contents of the Course. Jarkko Toivonen. Overview of Python
Programming in Python Jarkko Toivonen Department of Computer Science University of Helsinki September 18, 2009 Administration Organisation Contents of the Course Overview of Python Jarkko Toivonen (CS
Chapter -5 SCALABILITY AND AVAILABILITY
Chapter -5 SCALABILITY AND AVAILABILITY 78 CHAPTER 5 Chapter - 5. Scalability and Availability S.No. Name of the Sub-Title Page No. 5.1 The importance of Scalability and Availability 79 5.2. Design Patterns
CHAPTER 4: PATTERNS AND STYLES IN SOFTWARE ARCHITECTURE
CHAPTER 4: PATTERNS AND STYLES IN SOFTWARE ARCHITECTURE SESSION I: OVERVIEW AND HISTORY OF STYLES AND PATTERNS Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012
Object Oriented System Development with VB.NET
Chapter 1 Object Oriented System Development with Objectives In this chapter, you will: Learn about OO development and Understand object-oriented concepts Recognize the benefits of OO development Preview
Chapter 3 Chapter 3 Service-Oriented Computing and SOA Lecture Note
Chapter 3 Chapter 3 Service-Oriented Computing and SOA Lecture Note Text book of CPET 545 Service-Oriented Architecture and Enterprise Application: SOA Principles of Service Design, by Thomas Erl, ISBN
.NET and J2EE Intro to Software Engineering
.NET and J2EE Intro to Software Engineering David Talby This Lecture.NET Platform The Framework CLR and C# J2EE Platform And Web Services Introduction to Software Engineering The Software Crisis Methodologies
City University of Hong Kong Course Syllabus. offered by Department of Computer Science with effect from Semester A 2015/16
City University of Hong Kong Course Syllabus offered by Department of Computer Science with effect from Semester A 2015/16 Part I Course Overview Course Title: Problem Solving and Programming Course Code:
Chapter 12. Support for Object-Oriented Programming ISBN
Chapter 12 Support for Object-Oriented Programming ISBN 0-321-33025-0 Chapter 12 Topics Introduction Object-Oriented Programming Design Issues for Object-Oriented Languages Support for Object-Oriented
Introduction to Patterns and Frameworks
Patterns and Frameworks Introduction to Patterns and Frameworks Professor Department of EECS d.schmidt@vanderbilt.edu Vanderbilt University www.cs.wustl.edu/schmidt/ (615) 343-8197 Motivation for Patterns
Java course - IAG0040. Unit testing & Agile Software Development
Java course - IAG0040 Unit testing & Agile Software Development 2011 Unit tests How to be confident that your code works? Why wait for somebody else to test your code? How to provide up-to-date examples
Information systems modelling UML and service description languages
Internet Engineering Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik Information systems modelling UML and service description languages Student Contact Hours: 25.02.2015- Location: 325 C3 room 25.03.2015:
Basic Concepts. Objects. Chapter
Chapter 1 Basic Concepts In traditional programming, we start with a problem to solve. We figure out how to break the problem into smaller parts, then each part into smaller parts still. At each stage
Business-Driven Software Engineering Lecture 3 Foundations of Processes
Business-Driven Software Engineering Lecture 3 Foundations of Processes Jochen Küster jku@zurich.ibm.com Agenda Introduction and Background Process Modeling Foundations Activities and Process Models Summary
10 Proxy Pattern [Gamma et al]
10 Pattern [Gamma et al] pattern is used in scenarios when it is required to use avoid heavy-weight objects. So lightweight objects that are actually replica of the original objects exposing the same interface
UML Class Diagrams - Introduction
UML class diagrams allow us to denote the static contents of and the relationships between classes. This reading is adapted from Robert Martin s book. UML class diagrams allow us to denote the static contents
Chapter 12. Support for. Oi t Programming
Chapter 12 Support for Object-Oriented Oi t Programming Chapter 12 Topics Introduction Object-Oriented Programming Design Issues for Object-Oriented Languages Support for Object-Oriented Programming g
An Automatic Reversible Transformation from Composite to Visitor in Java
An Automatic Reversible Transformation from Composite to Visitor in Java Akram To cite this version: Akram. An Automatic Reversible Transformation from Composite to Visitor in Java. CIEL 2012, P. Collet,
Chapter 6 Concurrent Programming
Chapter 6 Concurrent Programming Outline 6.1 Introduction 6.2 Monitors 6.2.1 Condition Variables 6.2.2 Simple Resource Allocation with Monitors 6.2.3 Monitor Example: Circular Buffer 6.2.4 Monitor Example:
Developing the Architectural Framework for SOA Adoption
Developing the Architectural Framework for SOA Adoption Oliver Sims Enterprise Architect oliver.sims@open-it.co.uk Copyright Open-IT Limited 2005 Agenda Service Orientation just a good technology? The
core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt
core. 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Volume I - Fundamentals Seventh Edition CAY S. HORSTMANN GARY
Curriculum Map. Discipline: Computer Science Course: C++
Curriculum Map Discipline: Computer Science Course: C++ August/September: How can computer programs make problem solving easier and more efficient? In what order does a computer execute the lines of code
Organization. Introduction to Software Engineering
Dr. Michael Eichberg Software Technology Group Department of Computer Science Technische Universität Darmstadt Introduction to Software Engineering Organization Teaser Background Information 3 As long
Thread-Safe Interface
345 Thread-Safe Interface The Thread-Safe Interface design pattern minimizes locking overhead and ensures that intra-component method calls do not incur selfdeadlock by trying to reacquire a lock that
Unit testing with mock code EuroPython 2004 Stefan Schwarzer p.1/25
Unit testing with mock code EuroPython 2004 Stefan Schwarzer sschwarzer@sschwarzer.net Informationsdienst Wissenschaft e. V. Unit testing with mock code EuroPython 2004 Stefan Schwarzer p.1/25 Personal
Python Standard Library: Data Storage 10-1. Clemens Szyperski, in Component Software
Python Standard Library: Data Storage 10-1 Data Storage "Unlike mainstream component programming, scripts usually do not introduce new components but simply "wire" existing ones. Scripts can be seen as
Lecture 4. The Java Collections Framework
Lecture 4. The Java s Framework Chapters 6.3-6.4-1 - Outline Introduction to the Java s Framework Iterators Interfaces Classes Classes - 2 - The Java s Framework We will consider the Java s Framework as