Pedagogical and Elementary Patterns Patterns Overview

Total Page:16

File Type:pdf, Size:1020Kb

Pedagogical and Elementary Patterns Patterns Overview Pedagogical and Elementary Patterns Overview Patterns Joe Bergin Pace University http://csis.pace.edu/~bergin Thanks to Eugene Wallingford for some material here. Jim (Cope) Coplien also gave advice in the design. 11/26/00 1 11/26/00 2 Patterns--What they DO Where Patterns Came From • Capture Expert Practice • Christopher Alexander --A Pattern Language • Communicate Expertise to Others – Architecture • Solve Common Recurring Problems • Structural Relationships that recur in good spaces • Ward Cunningham, Kent Beck (oopsla ‘87), • Vocabulary of Solutions. Dick Gabriel, Jim Coplien, and others • Bring a set of forces/constraints into • Johnson, Gamma, Helm, and Vlisides (GOF) equilibrium • Structural Relationships that recur in good programs • Work with other patterns 11/26/00 3 11/26/00 4 Patterns Branch Out Patterns--What they ARE • Software Design Patterns (GOF...) •A Thing • Organizational Patterns (XP, SCRUM...) • A Description of a Thing • Telecommunication Patterns (Hub…) • A Description of how to Create the Thing • Pedagogical Patterns •A Solution of a Recurring Problem in a • Elementary Patterns Context – Unfortunately this “definition” is only useful if you already know what patterns are 11/26/00 5 11/26/00 6 Patterns--What they ARE (2) Elements of a Pattern • Structural relationships between •Problem components of a system that brings into • Context equilibrium a set of demands on the system •Forces • A way to generate complex (emergent) •Solution behavior from simple rules • Examples of Use (several) • A way to make the world a better place for humans -- not just developers or teachers... • Consequences and Resulting Context 11/26/00 7 11/26/00 8 Exercise Exercise • Problem: Build a stairway up a castle tower • Problem: Design the intersection of two or • Context: 12th Century Denmark. The region more rural roads is often at war • Context: Denmark • Forces: Confined space. Must be defended • Forces: Low maintenance. Land is cheap. against attack from below. Warriors are Electricity is expensive to deliver. Traffic is mostly right handed. light. Don’t cause an unnecessary stop. • Solution: • Solution: 11/26/00 9 11/26/00 10 Alexander Example Alexander Example (2) • Light On Two Sides of Every Room (159) • Light on Two Sides of Every room: • Major rooms have been placed... •A Thing -- a configuration of rooms with the property • People gravitate to such rooms (converse) • A Description of the Thing -- a picture or • Shadows, glare, softer light gradient... paragraph describing it. • A Description of how to build the thing-- • Locate every room so that it has outdoor Place rooms in the corners of the building. Juxtapose small space adjacent on at least two sides... rooms with large ones. Take care not to destroy the roof layout. Make the windows open onto something beautiful. 11/26/00 11 11/26/00 12 GOF Example Composite(2) • Composite •A Thing -- Panel in Java or (3 * (4 +5)) • Building a complex part-whole hierarchy • A Description of the Thing -- An object in a program that behaves like other objects but which also • Many parts must be composed flexibly contains other objects with that behavior • Tradeoff simplicity and flexibility • A Description of how to build the Thing -- • Structure objects so that a container of Create a class that implements the desired interface. Give the class an instance variable that is a collection of objects components is also itself a component that implement the interface. Implement the methods by delegating to the elements of the collection. 11/26/00 13 11/26/00 14 More Examples Forms for Writing Patterns • Grand- Patterns in Java • Alexandrian – Delegation – See Seminars – Singleton • Outline (sometimes called GOF) –Observer – See Grand – Decorator • Outline is easier and a good place to begin • Alexandrian is more informative and literate 11/26/00 15 11/26/00 16 Alexandrian Form (APL) Modified Alexandrian Form 1. PATTERN NAME* 1. PATTERN NAME* Picture giving architectural example Introduction giving context Introduction giving context *** *** Problem description Problem description Essence of Problem (1-2 sentences) Essence of Problem (1-2 sentences) Body of problem (longest section) Body of problem (longest section) Solution -- Stated in form of an instruction Solution -- Stated in form of an instruction Diagram giving solution graphically Diagram giving solution graphically Examples of use *** *** Resulting context Resulting context 11/26/00 17 11/26/00 18 Patterns--What they are NOT Patterns--What they are NOT (2) • A way to make software cheaper • Just GOF – Instead of software: courses, organizations... • Just OOP • A way to make software faster • Just programming templates • Surprising to experts (mostly) • Just tricks • Invented by their authors • Extra material for students • Just a literary form • New material for students • Stand alone incremental improvements 11/26/00 19 11/26/00 20 Patterns--What they are NOT (3) Overheard • If there is only one way to do something it • Why don’t you just have an immutable isn’t a pattern. (context and forces are key) singleton null object iterator mediate • If it doesn’t properly bring the applicable between your composite decorated facade forces into equilibrium, it isn’t a pattern. and the conoculator valve? • If there is no agreement among experts that • OR-- maybe bridge the flyweight proxy the solution is “best,” it isn’t a pattern. prototype with a factory method mememto adapter? 11/26/00 21 11/26/00 22 Pattern Languages Pattern Languages (2) • Patterns seldom occur alone • Patterns are defined at different time or • Seen properly they are part of pattern space “scale” languages • Patterns at different scale are all of similar • It is the languages that provide the emergent complexity behavior, not the individual patterns • Large scale patterns (towns)as simple as • Context of a pattern is the consequences of small scale (pictures on your wall) one or more other patterns. • Work from large scale down to small within – Patterns are applied in sequence a given context 11/26/00 23 11/26/00 24 Seminars: Fricke/Voelter Seminars 11/26/00 25 11/26/00 26 Seminars Pattern Languages are NOT • Just catalogs of patterns – Patterns in a language work together to solve a complex problem whose parts are solved by the individual patterns. The Goodness and Liveness emerge from the interactions. – In Alexandrian terms, from the spaces defined by the elements in the pattern. Spaces in which humans live. (Architect positions walls but defines spaces between the walls.) 11/26/00 27 11/26/00 28 Patterns Community Wiki Wiki Web • The patterns community tries hard to be • Ward Cunningham maintains a virtual supportive of its members meeting place for all patterns people at • There are many activities that work to this – http://c2.com/cgi/wiki/ end • The Wiki Wiki Web is an interactive web • PLoPs, Lists, Web sites site to which anyone can modify any page. • Patterns Process 11/26/00 29 11/26/00 30 Other Views-Resources More Resources • Brad Appleton’s overview of patterns • Introducing Patterns into Organizations – http://www.enteract.com/~bradapp/docs/patterns-intro.html – Mary Lynn Manns and Linda Rising • More On Christopher Alexander – [email protected] – http://g.oswego.edu/dl/ca/ca/ca.html – Linda is spending this year in Copenhagen • Jim Coplien's Home Page – She is also the author of the Patterns Almanac – http://www.bell-labs.com/~cope/ and the Patterns Handbook • Hillside Group • http://www.cs.unca.edu/~manns/intropatterns.html – http://hillside.net/patterns/ 11/26/00 31 11/26/00 32 Current Key Players Elementary Patterns • Eugene Wallingford • Dwight Duego •Joe Bergin •Zung Nguyen • Robert Duvall • Viera Proulx Overview • Owen Astrachan • Richard Rasala • Alyce Brady • Stephen Wong http://www.cs.uni.edu/~wallingf/patterns/elementary/ •Ed Epp • Javier Galve-Frances (There is a mailing list also) •Rick Mercer • <you> • Doug Dechow • <and you> 11/26/00 33 11/26/00 34 Elementary Patterns Goals • Intended for novices • More effective teaching (not new material) •Both • More effective learning – simpler standard design patterns and – Students can say why they do what they do – Patterns created especially for novices – Students can follow a plan • Varieties of scale, but attacking problems – Students can make connections encountered by novices • Introduction to the patterns way of thinking • Efficiency when solving recurring problems 11/26/00 35 11/26/00 36 Example How to use Elementary Patterns • The Decorator pattern can be used to dynamically add functionality to an object defined by an • Not a syllabus item or exam item interface without modifying the object • Tools for studying design principles • You can use it to develop search strategies in • Tools for reading and organizing programs simple lists/vectors • Tools for writing programs • It is also the basis of the design of the Java I/O libraries • Vocabulary for communication between • Once you understand Decorator, you understand instructor and student Java I/O • Benchmark for evaluating programs 11/26/00 37 11/26/00 38 Tools for reading & organizing Tools for studying design principles programs • Use Decorator or Composite • Enumeration -- Java collections – to show both inheritance and delegation in a • Observer -- Java events way that maximizes the benefits of both • Decorator -- Java I/O – to show dynamic polymorphism • Pipes & Filters -- Compiler passes – to show the power of interface • Immutable -- Making programs simple to understand 11/26/00 39 11/26/00 40 Tools for writing programs
Recommended publications
  • Patterns Senior Member of Technical Staff and Pattern Languages Knowledge Systems Corp
    Kyle Brown An Introduction to Patterns Senior Member of Technical Staff and Pattern Languages Knowledge Systems Corp. 4001 Weston Parkway CSC591O Cary, North Carolina 27513-2303 April 7-9, 1997 919-481-4000 Raleigh, NC [email protected] http://www.ksccary.com Copyright (C) 1996, Kyle Brown, Bobby Woolf, and 1 2 Knowledge Systems Corp. All rights reserved. Overview Bobby Woolf Senior Member of Technical Staff O Patterns Knowledge Systems Corp. O Software Patterns 4001 Weston Parkway O Design Patterns Cary, North Carolina 27513-2303 O Architectural Patterns 919-481-4000 O Pattern Catalogs [email protected] O Pattern Languages http://www.ksccary.com 3 4 Patterns -- Why? Patterns -- Why? !@#$ O Learning software development is hard » Lots of new concepts O Must be some way to » Hard to distinguish good communicate better ideas from bad ones » Allow us to concentrate O Languages and on the problem frameworks are very O Patterns can provide the complex answer » Too much to explain » Much of their structure is incidental to our problem 5 6 Patterns -- What? Patterns -- Parts O Patterns are made up of four main parts O What is a pattern? » Title -- the name of the pattern » A solution to a problem in a context » Problem -- a statement of what the pattern solves » A structured way of representing design » Context -- a discussion of the constraints and information in prose and diagrams forces on the problem »A way of communicating design information from an expert to a novice » Solution -- a description of how to solve the problem » Generative:
    [Show full text]
  • Wiki As Pattern Language
    Wiki as Pattern Language Ward Cunningham Cunningham and Cunningham, Inc.1 Sustasis Foundation Portland, Oregon Michael W. Mehaffy Faculty of Architecture Delft University of Technology2 Sustasis Foundation Portland, Oregon Abstract We describe the origin of wiki technology, which has become widely influential, and its relationship to the development of pattern languages in software. We show here how the relationship is deeper than previously understood, opening up the possibility of expanded capability for wikis, including a new generation of “federated” wiki. [NOTE TO REVIEWERS: This paper is part first-person history and part theory. The history is given by one of the participants, an original developer of wiki and co-developer of pattern language. The theory points toward future potential of pattern language within a federated, peer-to-peer framework.] 1. Introduction Wiki is today widely established as a kind of website that allows users to quickly and easily share, modify and improve information collaboratively (Leuf and Cunningham, 2001). It is described on Wikipedia – perhaps its best known example – as “a website which allows its users to add, modify, or delete its content via a web browser usually using a simplified markup language or a rich-text editor” (Wikipedia, 2013). Wiki is so well established, in fact, that a Google search engine result for the term displays approximately 1.25 billion page “hits”, or pages on the World Wide Web that include this term somewhere within their text (Google, 2013a). Along with this growth, the definition of what constitutes a “wiki” has broadened since its introduction in 1995. Consider the example of WikiLeaks, where editable content would defeat the purpose of the site.
    [Show full text]
  • The Culture of Patterns
    UDC 681.3.06 The Culture of Patterns James O. Coplien Vloebergh Professor of Computer Science, Vrije Universiteit Brussel, PO Box 4557, Wheaton, IL 60189-4557 USA [email protected] Abstract. The pattern community came about from a consciously crafted culture, a culture that has persisted, grown, and arguably thrived for a decade. The culture was built on a small number of explicit principles. The culture became embodied in its activities conferences called PLoPs that centered on a social activity for reviewing technical worksand in a body of literature that has wielded broad influence on software design. Embedded within the larger culture of software development, the pattern culture has enjoyed broad influence on software development worldwide. The culture hasnt been without its problems: conflict with academic culture, accusations of cultism, and compromises with other cultures. However, its culturally rich principles still live on both in the original organs of the pattern community and in the activities of many other software communities worldwide. 1. Introduction One doesnt read many papers on culture in the software literature. You might ask why anyone in software would think that culture is important enough that an article about culture would appear in such a journal, and you might even ask yourself: just what is culture, anyhow? The software pattern community has long taken culture as a primary concern and focus. Astute observers of the pattern community note a cultural tone to the conferences and literature of the discipline, but probably view it as a distant and puzzling phenomenon. Casual users of the pattern form may not even be aware of the cultural focus or, if they are, may discount it as a distraction.
    [Show full text]
  • Analysis Patterns.Pdf
    Symbols for mappings DLKING , : www.dlking.com Generalization notation DLKING , : www.dlking.com Contents Foreword v Foreword vii Preface xv Chapter 1. Introduction 1 1.1 Conceptual Models 1 1.2 The World of Patterns 4 1.3 The Patterns in this Book 8 1.4 Conceptual Models and Business Process Reengineering 10 1.5 Patterns and Frameworks 11 1.6 Using the Patterns 11 References 14 Part 1. Analysis Patterns 15 Chapter 2. Accountability 17 2.1 Party 18 2.2 Organization Hierarchies 19 2.3 Organization Structure 21 2.4 Accountability 22 2.5 Accountability Knowledge Level 24 2.6 Party Type Generalizations 27 2.7 Hierarchic Accountability 28 2.8 Operating Scopes 30 2.9 Post 32 References 33 Chapter 3. Observations and Measurements 35 3.1 Quantity 36 3.2 Conversion Ratio 38 3.3 Compound Units 39 3.4 Measurement 41 3.5 Observation 42 3.6 Subtyping Observation Concepts 46 3.7 Protocol 46 3.8 Dual Time Record 47 IX DLKING , : www.dlking.com x Contents 3.9 Rejected Observation 48 3.10 Active Observation, Hypothesis, and Projection 49 3.11 Associated Observation 50 3.12 Process of Observation 51 References 55 Chapter 4. Observations for Corporate Finance 57 4.1 Enterprise Segment 59 4.2 Measurement Protocol 65 4.3 Range 76 4.4 Phenomenon with Range 77 4.5 Using the Resulting Framework 82 References 83 Chapter 5. Referring to Objects 85 5.1 Name 86 5.2 Identification Scheme 88 5.3 Object Merge 90 5.4 Object Equivalence 92 References 93 Chapter 6.
    [Show full text]
  • A Model of Inheritance for Declarative Visual Programming Languages
    An Abstract Of The Dissertation Of Rebecca Djang for the degree of Doctor of Philosophy in Computer Science presented on December 17, 1998. Title: Similarity Inheritance: A Model of Inheritance for Declarative Visual Programming Languages. Abstract approved: Margaret M. Burnett Declarative visual programming languages (VPLs), including spreadsheets, make up a large portion of both research and commercial VPLs. Spreadsheets in particular enjoy a wide audience, including end users. Unfortunately, spreadsheets and most other declarative VPLs still suffer from some of the problems that have been solved in other languages, such as ad-hoc (cut-and-paste) reuse of code which has been remedied in object-oriented languages, for example, through the code-reuse mechanism of inheritance. We believe spreadsheets and other declarative VPLs can benefit from the addition of an inheritance-like mechanism for fine-grained code reuse. This dissertation first examines the opportunities for supporting reuse inherent in declarative VPLs, and then introduces similarity inheritance and describes a prototype of this model in the research spreadsheet language Forms/3. Similarity inheritance is very flexible, allowing multiple granularities of code sharing and even mutual inheritance; it includes explicit representations of inherited code and all sharing relationships, and it subsumes the current spreadsheet mechanisms for formula propagation, providing a gradual migration from simple formula reuse to more sophisticated uses of inheritance among objects. Since the inheritance model separates inheritance from types, we investigate what notion of types is appropriate to support reuse of functions on different types (operation polymorphism). Because it is important to us that immediate feedback, which is characteristic of many VPLs, be preserved, including feedback with respect to type errors, we introduce a model of types suitable for static type inference in the presence of operation polymorphism with similarity inheritance.
    [Show full text]
  • Frontiers of Pattern Language Technology
    Frontiers of Pattern Language Technology Pattern Language, 1977 Network of Relationships “We need a web way of thinking.” - Jane Jacobs Herbert Simon, 1962 “The Architecture of Complexity” - nearly decomposable hierarchies (with “panarchic” connections - Holling) Christopher Alexander, 1964-5 “A city is not a tree” – its “overlaps” create clusters, or “patterns,” that can be manipulated more easily (related to Object-Oriented Programming) The surprising existing benefits of Pattern Language technology.... * “Design patterns” used as a widespread computer programming system (Mac OS, iPhone, most games, etc.) * Wiki invented by Ward Cunningham as a direct outgrowth * Direct lineage to Agile, Scrum, Extreme Programming * Pattern languages used in many other fields …. So why have they not been more infuential in the built environment??? Why have pattern languages not been more infuential in the built environment?.... * Theory 1: “Architects are just weird!” (Preference for “starchitecure,” extravagant objects, etc.) * Theory 2: The original book is too “proprietary,” not “open source” enough for extensive development and refinement * Theory 3: The software people, especially, used key strategies to make pattern languages far more useful, leading to an explosion of useful new tools and approaches …. So what can we learn from them??? * Portland, OR. Based NGO with international network of researchers * Executive director is Michael Mehaffy, student and long-time colleague of Christopher Alexander, inter-disciplinary collaborator in philosophy, sciences, public affairs, business and economics, architecture, planning * Board member is Ward Cunningham, one of the pioneers of pattern languages in software, Agile, Scrum etc., and inventor of wiki * Other board members are architects, financial experts, former students of Alexander Custom “Project Pattern Languages” (in conventional paper format) Custom “Project Pattern Languages” create the elements of a “generative code” (e.g.
    [Show full text]
  • Lean Architecture for Agile Software Development
    LEAN ARCHITECTURE FOR AGILE SOFTWARE DEVELOPMENT This manuscript is Copyright ©2009 by James O. Coplien and Gertrud Bjørnvig. All rights reserved. No portion of this manuscript may be copied or repro- duced in any form nor by any means, whether elec- tronic, reprographic, or photographic, without prior written consent of the authors and all pertinent legal stakeholders. For a printable copy of this draft, contact Jim Co- plien at [email protected] Draft of August 2, 2009 ii LEAN ARCHITECTURE FOR AGILE SOFTWARE DEVELOPMENT James O. Coplien Gertrud Bjørnvig JOHN WILEY AND SONS Chichester • New York • Brisbane • Toronto • Singapore Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book and Wiley was aware of a trademark claim, the designations have been pointed in initial caps or all caps. The authors and publishers have taken care in the preparation of this book, but make not expressed or implied warranty of any kind and assume no responsibility for errors or omis- sions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Library of Congress Cataloging-in-Publication Data Coplien, James O. and Gertrud Bjørnvig Lean Software Architecture and Agile Production / James O. Coplien and Gertrud Bjørnvig. p. cm. Includes bibliographical references and index ISBN 0-XXX-YYYYY-1 C++ (Computer program language) I. Title QA7673C153C675 2010 05. 13’3-dcl21 08-36336 CIP Copyright ©2010 James O. Coplien and Gertrud Bjørnvig. All rights reserved.
    [Show full text]
  • Assessing Alexander's Later Contributions to a Science of Cities
    Review Assessing Alexander’s Later Contributions to a Science of Cities Michael W. Mehaffy KTH Royal Institute of Technology, 114 28 Stockholm, Sweden; mmehaff[email protected] or michael.mehaff[email protected] Received: 23 April 2019; Accepted: 28 May 2019; Published: 30 May 2019 Abstract: Christopher Alexander published his longest and arguably most philosophical work, The Nature of Order, beginning in 2003. Early criticism assessed that text to be a speculative failure; at best, unrelated to Alexander’s earlier, mathematically grounded work. On the contrary, this review presents evidence that the newer work was a logically consistent culmination of a lifelong and remarkably useful inquiry into part-whole relations—an ancient but still-relevant and even urgent topic of design, architecture, urbanism, and science. Further evidence demonstrates that Alexander’s practical contributions are remarkably prodigious beyond architecture, in fields as diverse as computer science, biology and organization theory, and that these contributions continue today. This review assesses the potential for more particular contributions to the urban professions from the later work, and specifically, to an emerging “science of cities.” It examines the practical, as well as philosophical contributions of Alexander’s proposed tools and methodologies for the design process, considering both their quantitative and qualitative aspects, and their potential compatibility with other tools and strategies now emerging from the science of cities. Finally, it highlights Alexander’s challenge to an architecture profession that seems increasingly isolated, mired in abstraction, and incapable of effectively responding to larger technological and philosophical challenges. Keywords: Christopher Alexander; The Nature of Order; pattern language; structure-preserving transformations; science of cities 1.
    [Show full text]
  • Programming Design Patterns
    Programming Design Patterns Patterns for High Performance Computing Marc Snir/Tim Mattson Feb 2006 Dagstuhl Marc Snir Design Pattern High quality solution to frequently recurring problem in some domain Each pattern has a name, providing a vocabulary for discussing the solutions Written in prescribed format to allow the reader to quickly understand the solution and its context 2 Dagstuhl Feb 2006 Marc Snir History ‘60s and ‘70s Berkeley architecture professor Christopher Alexander 253 patterns for city planning, landscaping, and architecture Attempted to capture principles for “living” design. Published in 1977 3 Dagstuhl Feb 2006 Marc Snir Patterns in Object-oriented Programming OOPSLA’87 Kent Beck and Ward Cunningham Design Patterns: Elements of Reusable Object-Oriented Software By the “Gang of Four (GOF)”: Gamma, Helm, Johnson, Vlissides Catalog of patterns Creation, structural, behavioral Published in 1995 4 Dagstuhl Feb 2006 Marc Snir Impact of GOF book Good solutions to frequently recurring problems Pattern catalog Significant influence on object-oriented programming! Created a new vocabulary for software designers. 5 Dagstuhl Feb 2006 Marc Snir The Task Parallelism Pattern Problem: How do you exploit concurrency expressed in terms of a set of distinct tasks? Forces Size of task – small size to balance load vs. large size to reduce scheduling overhead Managing dependencies without destroying efficiency. Solution Schedule tasks for execution with balanced load – use master worker, loop parallelism, or SPMD patterns. Manage dependencies by: removing them (replicating data), transforming induction variables, exposing reductions explicitly protecting (shared data pattern). Intrusion of shared memory model… 6 Dagstuhl Feb 2006 Marc Snir Pattern Languages: A new approach to design Not just a collection of patterns, but a pattern language: Patterns lead to other patterns creating a design as a network of patterns.
    [Show full text]
  • Design Patterns Past and Future
    Proceedings of Informing Science & IT Education Conference (InSITE) 2011 Design Patterns Past and Future Aleksandar Bulajic Metropolitan University, Belgrade, Serbia [email protected]; [email protected] Abstract A very important part of the software development process is service or component internal de- sign and implementation. Design Patterns (Gamma et al., 1995) provide list of the common pat- terns used in the object-oriented software design process. The primary goal of the Design Patterns is to reuse good practice in the design of new developed components or applications. Another important reason of using Design Patterns is improving common application design understand- ing and reducing communication overhead by reusing the same generic names for implemented solution. Patterns are designed to capture best practice in a specific domain. A pattern is supposed to present a problem and a solution that is supported by an example. It is always worth to listen to an expert advice, but keep in mind that common sense should decide about particular implemen- tation, even in case when are used already proven Design Patterns. Critical view and frequent and well designed testing would give an answer about design validity and a quality. Design Patterns are templates and cannot be blindly copied. Each design pattern records design idea and shall be adapted to particular implementation. Using time to research and analyze existing solutions is recommendation supported by large number of experts and authorities and fits very well in the pattern basic philosophy; reuse solution that you know has been successfully implemented in the past. Sections 2 and 3 are dedicated to the Design Patterns history and theory as well as literature sur- vey.
    [Show full text]
  • An Introduction to Dependency Inversion Page 1 of 12
    Peruse Muse Infuse: An Introduction to Dependency Inversion Page 1 of 12 An Introduction to Dependency Inversion Originaly posted by AdrianK, 1-Nov-2010 at: http://www.morphological.geek.nz/blogs/viewpost/Peruse Muse Infuse/An Introduction to Dependency Inversion.aspx Tagged under: Architecture, Web Development, Patterns An Introduction to Dependency Inversion This article is for anyone (mainly developers, and specifically .Net developers) who is unfamiliar with Dependency Inversion or design patterns in general. The basic rationale behind the Dependency Inversion Principle [1] (DIP, or simply DI) is very simple; and like most other simple design principles it is suitable in many different situations. Once you understand it you’ll wonder how you managed without it. The key benefit it brings is control over dependencies – by removing them (or perhaps more correctly – by “inverting” them), and this isn’t just limited to “code” – you’ll find this also opens up new opportunities regarding how you can structure and run the actual development process. Implementing DI and is fairly straight forward and will often involve other design patterns, such as the Factory pattern [2] and Lazy Load pattern [3] ; and embodies several other principles including the Stable Abstractions Principle and Interface Segregation Principle. I’ll be using acronyms where I can, here’s a quick glossary for them. • BL: Business Logic, sometimes referred to as the Business Logic Layer. • DA: Data Access, often referred to as the DAL or Data Access Layer. • DI: can refer to either Dependency Inversion or Dependency Injection – both of which (at least for this article) essentially mean the same thing.
    [Show full text]
  • Strengthening the Case for Pair Programming
    focusprocess diversity Strengthening the Case for Pair Programming The software Laurie Williams, North Carolina State University industry has Robert R. Kessler, University of Utah practiced pair programming—two Ward Cunningham, Cunningham & Cunningham programmers Ron Jeffries working side by side at one or years, programmers in industry have claimed that by working computer on the collaboratively, they have produced higher-quality software prod- same problem— ucts in shorter amounts of time. But their evidence was anecdotal with great success and subjective: “It works” or “It feels right.” To validate these for years. But F people who haven’t claims, we have gathered quantitative evidence showing that pair program- tried it often reject ming—two programmers working side by side at one computer on the same the idea as a waste of resources. The authors design, algorithm, code, or test—does in- programming skill from novice to expert. deed improve software quality and reduce demonstrate that time to market. Additionally, student and Earlier Observations using pair professional programmers consistently find In 1998, Temple University professor programming in pair programming more enjoyable than John Nosek reported on his study of 15 the software working alone. full-time, experienced programmers work- development Yet most who have not tried and tested ing for a maximum of 45 minutes on a chal- process yields pair programming reject the idea as a re- lenging problem important to their organi- dundant, wasteful use of programming re- zation. In their own environments and with better products in sources: “Why would I put two people on a their own equipment, five worked individu- less time—and job that just one can do? I can’t afford to do ally and 10 worked collaboratively in five happier, that!” But we have found, as Larry Con- pairs.
    [Show full text]