Software Engineering Introduction

Total Page:16

File Type:pdf, Size:1020Kb

Software Engineering Introduction COSC 340: Software Engineering Design Patterns Michael Jantz Recommended text: Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides COSC 340: Software Engineering 1 Why Design Patterns? • Designing object-oriented software is hard ‒ Designing reusable object-oriented software is even harder • Good designers do not solve every problem from first principles ‒ When a good solution is found, reuse it over and over again • Patterns make it easier to reuse successful designs and architectures ‒ Pattern vocabulary makes systems more accessible to new developers ‒ Help you choose reusable designs ‒ Improve the documentation and maintainability of existing systems ‒ Help you get the design 'right' faster COSC 340: Software Engineering 2 Elements of Design Patterns • Pattern name ‒ A one or two word handle for describing the pattern • Problem ‒ When to apply the pattern (the problem and its context) • Solution ‒ Elements of the design, their relationships, responsibilities and collaborations • Consequences ‒ Results and trade-offs of applying the pattern COSC 340: Software Engineering 3 What is a Design Pattern? • Depends on your point of view • Useful to concentrate on a certain level of abstraction ‒ Do not consider objects that can be encoded and reused as is (e.g. linked lists and hash tables) ‒ Do not consider complex, domain-specific designs for an entire system • GoF Definition: ‒ Design patterns are "descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context" COSC 340: Software Engineering 4 Classifying Design Patterns • Purpose (what does the pattern do?) ‒ Creational (object creation) ‒ Structural (composition of classes or objects) ‒ Behavioral (characterize object interaction) • Scope (where does it apply – classes or objects?) ‒ Class patterns • Deal with relationships b/w classes and their subclasses • Static – fixed at compile time ‒ Object patterns • Deal with object relationships • More dynamic – can be changed at runtime COSC 340: Software Engineering 5 Organizing the Catalog Purpose Creational Structural Behavioral Class Factory Method Adapter Interpreter Template Method Abstract Factory Adapter Chain of Responsibility Builder Bridge Command Prototype Composite Iterator Scope Singleton Decorator Mediator Object Façade Memento Proxy Flyweight Observer State Strategy Visitor 6 OMT Notation • Three diagrammatic notations ‒ Class diagram • depicts classes, their structure, and the static relationships between them ‒ Object diagram • depicts a particular object structure at run-time ‒ Interaction diagram • shows the flow of requests between objects COSC 340: Software Engineering 7 Class Diagrams 8 Class Diagrams 9 Object Diagrams COSC 340: Software Engineering 10 Interaction Diagram COSC 340: Software Engineering 11 Creational Patterns • Abstract away the instantiation process • Two recurring themes in creational patterns ‒ Encapsulate knowledge about which concrete classes the system uses ‒ Hide how instances of these classes are created and put together COSC 340: Software Engineering 12 Driving Example: Maze for a Computer Game • Focus only on how the maze is created ‒ Ignore players, operations for displaying and wandering around the maze, etc. • Maze definition ‒ Maze is a set of rooms ‒ Each room knows its neighbors ‒ Possible neighbors are another room, a wall, or a door to another room • Maze classes ‒ Room, Door, and Wall COSC 340: Software Engineering 13 Maze Class Diagram COSC 340: Software Engineering 14 MazeGame::CreateMaze COSC 340: Software Engineering 15 MazeGame::CreateMaze • Problem: CreateMaze is inflexible • Classes that get instantiated are hard-coded into this design • Creational patterns make this design more flexible • Allows you to remove explicit references to concrete classes COSC 340: Software Engineering 16 Factory Method Pattern • Intent ‒ Define an interface for creating an object, but let subclasses decide which class to instantiate • Motivation ‒ Frameworks with abstract classes often need to create objects when it is not known what kind of object to create ‒ The framework must instantiate classes, but it only knows about abstract classes, which it cannot instantiate • Solution ‒ Encapsulate the knowledge of the subclass to create and move this knowledge out of the framework COSC 340: Software Engineering 17 Factory Method Pattern: Structure COSC 340: Software Engineering 18 Factory Method Pattern: Implementation Two Major Variations • Creator is an abstract class ‒ Requires subclasses to define a factory method implementation • Creator is a concrete class with a default factory method implementation ‒ Factory method can be overridden for flexibility ‒ Follows the rule "create objects in a separate operation so that subclasses can override the way they're created." COSC 340: Software Engineering 19 Factory Method Pattern: MazeGame Example MazeGame Class and Maze Creation Code 20 Factory Method Pattern: MazeGame Example Potential Subclasses for MazeGame COSC 340: Software Engineering 21 Factory Method Pattern: Applicability • Use the Factory Method pattern when ‒ A class can't anticipate the class of objects it must create ‒ A class wants its subclasses to specify the objects it creates ‒ Classes delegate responsibility to one of several helper subclasses COSC 340: Software Engineering 22 Factory Method Pattern: Consequences Advantages and Disadvantages • Advantages ‒ Eliminate the need to bind concrete classes into your abstract code ‒ Provides hooks for subclasses ‒ Allows you to connect parallel class hierarchies (see next slide) • Disadvantage ‒ Might have to subclass the Creator just to create a particular type of object COSC 340: Software Engineering 23 Factory Method Pattern: Consequences Connecting Parallel Class Hierarchies • Consider a graphical program that manipulates figures interactively • Use a Manipulator class to implement interactions and keep of track of state • Factory Method enables the client code to create the Manipulator objects COSC 340: Software Engineering 24 Abstract Factory Pattern • Intent ‒ Provide an interface for creating families of related objects without specifying their concrete classes • Motivation ‒ It is often useful to define a portable interface for creating objects that can be reused in different environments or situations ‒ Example: creating widgets with different look-and-feel standards • Solution ‒ Use an abstract class to define an interface for creating each kind of object as well as abstract classes for each kind of object ‒ Define concrete subclasses to implement functionality specific to a particular situation or environment COSC 340: Software Engineering 25 Abstract Factory Pattern: Motivation Look-and-Feel Example • Desktop environment defines multiple look-and-feel standards ‒ Different look-and-feels change the way user-interface widgets (scroll bars, windows, buttons, etc.) are displayed ‒ Application code should not hard code widgets for a single look-and-feel • Abstract Factory design ‒ Application code interacts with abstract classes ‒ Use concrete subclasses to define the different look-and-feel standards COSC 340: Software Engineering 26 Abstract Factory Pattern: Motivation Look-and-Feel Example COSC 340: Software Engineering 27 Abstract Factory Pattern: Structure COSC 340: Software Engineering 28 Abstract Factory Pattern: Participants • AbstractFactory (WidgetFactory) ‒ Declares an interface for operations that create abstract product objects • ConcreteFactory (MotifWidgetFactory, PMWidgetFactory) ‒ Implements the operations to create concrete product objects • AbstractProduct (Window, ScrollBar) ‒ Declares an interface for a type of product object • ConcreteProduct (MotifWindow, MotifScrollBar) ‒ Defines a product object to be created by the corresponding concrete factory ‒ Implements the AbstractProduct interface • Client ‒ Uses only interfaces declared by AbstractFactory and AbstractProduct classes COSC 340: Software Engineering 29 Abstract Factory Pattern: Maze Example MazeFactory Implementation • Maze building programs take an instance of MazeFactory as an argument COSC 340: Software Engineering 30 Abstract Factory Pattern: Maze Example Parameterizing CreateMaze COSC 340: Software Engineering 31 Abstract Factory Pattern: Maze Example ConcreteFactory Implementations • Subclass of MazeFactory • Overrides member functions and returns different instances of rooms and doors COSC 340: Software Engineering 32 Abstract Factory Pattern: Maze Example ConcreteFactory Implementations • BombedMazeFactory ensures: • Walls are of class BombedWall • Rooms are of class RoomWithABomb • To build a simple maze with bombs, call CreateMaze with BombedMazeFactory COSC 340: Software Engineering 33 Abstract Factory Pattern: Maze Example MazeFactory Implementation • MazeFactory is a collection of factory methods • MazeFactory acts as both the AbstractFactory and a ConcreteFactory COSC 340: Software Engineering 34 Prototype Pattern • Intent ‒ Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype • Motivation ‒ Useful for when a system needs to be independent of how its objects are created, composed, and represented ‒ Enables you to avoid building a class hierarchy of factories that parallels the class hierarchy of products ‒ Example: graphical application for editing musical scores • Solution ‒ Parameterize object creation methods with prototype
Recommended publications
  • (GOF) Java Design Patterns Mock Exams
    Gang of Four (GOF) Java Design Patterns Mock Exams http://www.JavaChamp.com Open Certification Plattform Authors: N. Ibrahim, Y. Ibrahim Copyright (c) 2009-2010 Introducing JavaChamp.com Website JavaChamp.com is an Open Certification Platform. What does this mean? JavaChamp is the best place to learn, share, and certify your professional skills. We help you develop yourself in the field of computer science and programming Here are the most significant features offered by JavaChamp: Online Exams Start Online Certification Exams in SCJP, SCEA, EJB, JMS, JPA and more... Top quality mock exams for SCJP, SCEA, EJB, JMS, JPA. Start Express or topic-wise customized exam. * We offer you unlimited free mock exams * Exams cover subjects like SCJP, SCEA, EJB, JMS, JPA,.. * You can take as many exams as you want and at any time and for no charges * Each exam contains 20 multiple choice questions * You can save the exams taken in your exams history * Your exams history saves the exams you took, the scores you got, time took you to finish the exam, date of examination and also saves your answers to the questions for later revision * You can re-take the same exam to monitor your progress * Your exams history helps the system to offer you variant new questions every time you take a new exam, therefore we encourage you to register and maintain an exams history Network Find guidance through the maze, meet Study-Mates, Coaches or Trainees... Studying together is fun, productive and helps you in building your professional network and collecting leads Bookshelf JavaChamp Bookshelf full of PDF eBooks..
    [Show full text]
  • Design Pattern Interview Questions
    DDEESSIIGGNN PPAATTTTEERRNN -- IINNTTEERRVVIIEEWW QQUUEESSTTIIOONNSS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright © tutorialspoint.com Dear readers, these Design Pattern Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Design Pattern. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer: What are Design Patterns? Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial period of time. What is Gang of Four GOF? In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides published a book titled Design Patterns - Elements of Reusable Object-Oriented Software which initiated the concept of Design Pattern in Software development. These authors are collectively known as Gang of Four GOF. Name types of Design Patterns? Design patterns can be classified in three categories: Creational, Structural and Behavioral patterns. Creational Patterns - These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new opreator. This gives program more flexibility in deciding which objects need to be created for a given use case. Structural Patterns - These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
    [Show full text]
  • Learning Javascript Design Patterns
    Learning JavaScript Design Patterns Addy Osmani Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Learning JavaScript Design Patterns by Addy Osmani Copyright © 2012 Addy Osmani. All rights reserved. Revision History for the : 2012-05-01 Early release revision 1 See http://oreilly.com/catalog/errata.csp?isbn=9781449331818 for release details. ISBN: 978-1-449-33181-8 1335906805 Table of Contents Preface ..................................................................... ix 1. Introduction ........................................................... 1 2. What is a Pattern? ...................................................... 3 We already use patterns everyday 4 3. 'Pattern'-ity Testing, Proto-Patterns & The Rule Of Three ...................... 7 4. The Structure Of A Design Pattern ......................................... 9 5. Writing Design Patterns ................................................. 11 6. Anti-Patterns ......................................................... 13 7. Categories Of Design Pattern ............................................ 15 Creational Design Patterns 15 Structural Design Patterns 16 Behavioral Design Patterns 16 8. Design Pattern Categorization ........................................... 17 A brief note on classes 17 9. JavaScript Design Patterns .............................................. 21 The Creational Pattern 22 The Constructor Pattern 23 Basic Constructors 23 Constructors With Prototypes 24 The Singleton Pattern 24 The Module Pattern 27 iii Modules 27 Object Literals 27 The Module Pattern
    [Show full text]
  • JAVA CONCURRENCY ONLINE TRAINING – Java2aspire
    JAVA CONCURRENCY, JAVA PROFILING, THREAD POOLING, JAVA 8 Features, MAVEN and DESIGN PATTERNS ONLINE TRAINING By K.Ramesh Curriculum THREAD POOLING Day 01: Executor Framework 20 min Day 01: Java Profiling 10 min Day 01: Executor 10 min Day 01: ExecutorService 10 min Day 01: Executors 15 min Day 02: ThreadPoolExecutor 20 min Day 02: BlockingQueue 10 min Day 02: Callable vs Runnable 15 min Day 02: Future 15 min JAVA CONCURRENCY Day 03: ConcurrentHashMap 30 min Day 03: Producer Consumer 30 min Day 04: CountDownLatch 20 min Day 04: CyclicBarrier 20 min Day 04: Deadlock Condition 20 min Day 05: Race Condition 30 min Day 05: Semaphore 30 min JAVA 8 FEATURES Day 06: Lambda Expressions 40 min Day 06: Functional Interfaces 10 min Day 06: Functional Programming 10 min Day 07: Method References 10 min Day 07: Default Methods 40 min Day 07: Optional 10 min Day 08: Stream API 1 hour MAVEN Day 09: Project Object Model (POM) 20 min Day 09: Project Description 10 min Day 09: Public Repository 10 min Day 09: Dependency Management 10 min Day 09: Build Configuration 10 min Day 10: Installation 15 min Day 10: Dependency Scope 15 min Day 10: Proprietary Dependencies 15 min Day 10: Project Inheritance 15 min Day 11: Maven life cycle 20 min Day 11: Maven Directory Structure 20 min Day 11: Archetypes 20 min Day 12: Applications 1 hour DESIGN PATTERNS Day 13: Factory Pattern 20 min Day 13: Abstract Factory Pattern 10 min Day 13: Single Pattern 20 min Day 13: Prototype Pattern 10 min Day 14: Composite Pattern 10 min Day 14: Facade Pattern 15 min Day 14: DAO
    [Show full text]
  • Design Patterns in Ocaml
    Design Patterns in OCaml Antonio Vicente [email protected] Earl Wagner [email protected] Abstract The GOF Design Patterns book is an important piece of any professional programmer's library. These patterns are generally considered to be an indication of good design and development practices. By giving an implementation of these patterns in OCaml we expected to better understand the importance of OCaml's advanced language features and provide other developers with an implementation of these familiar concepts in order to reduce the effort required to learn this language. As in the case of Smalltalk and Scheme+GLOS, OCaml's higher order features allows for simple elegant implementation of some of the patterns while others were much harder due to the OCaml's restrictive type system. 1 Contents 1 Background and Motivation 3 2 Results and Evaluation 3 3 Lessons Learned and Conclusions 4 4 Creational Patterns 5 4.1 Abstract Factory . 5 4.2 Builder . 6 4.3 Factory Method . 6 4.4 Prototype . 7 4.5 Singleton . 8 5 Structural Patterns 8 5.1 Adapter . 8 5.2 Bridge . 8 5.3 Composite . 8 5.4 Decorator . 9 5.5 Facade . 10 5.6 Flyweight . 10 5.7 Proxy . 10 6 Behavior Patterns 11 6.1 Chain of Responsibility . 11 6.2 Command . 12 6.3 Interpreter . 13 6.4 Iterator . 13 6.5 Mediator . 13 6.6 Memento . 13 6.7 Observer . 13 6.8 State . 14 6.9 Strategy . 15 6.10 Template Method . 15 6.11 Visitor . 15 7 References 18 2 1 Background and Motivation Throughout this course we have seen many examples of methodologies and tools that can be used to reduce the burden of working in a software project.
    [Show full text]
  • A Survey of Design Pattern Based Web Applications
    JOURNAL OF OBJECT TECHNOLOGY Online at http://www.jot.fm. Published by ETH Zurich, Chair of Software Engineering ©JOT, 2009 Vol. 8, No. 2, March-April 2009 A Survey of Design Pattern Based Web Applications Sridaran R, Campus Head, ICFAI National College, Vellore-632 006 India. Padmavathi G, Professor and Head, Department of Computer Science, Avinashilingam University for Women, Coimbatore-641 043, India. Iyakutti K, Senior Professor, School of Physics, Madurai Kamaraj University, Madurai-625 019, India. Abstract Pattern-based web applications have become popular since they promote reusability and consistency. In few cases, patterns do not produce the desired effect because of lack of experience in applying them. This situation forces one to think of a suitable re- engineering solution for such applications. The objectives of the paper are three fold. It provides a survey of different pattern-based web applications that will be useful for the application designers. It highlights some of the web applications where patterns have been inappropriately handled. A few re-engineering initiatives for such cases are also analyzed. Key Words: Patterns, Web Applications, Re-engineering, Hypermedia, Semantic web, Partitioning. 1 INTRODUCTION Web application designers need to address many challenges during development in order to comply the quality of service requirements including speed, scalability and security. In recent years numerous non-web based applications have been re-written as web based because of the ever growing business needs. These migration activities are much more complicated and time consuming than a new software development. Most of these challenges are with data handling, organizing, or structuring of the web applications.
    [Show full text]
  • Course Title
    "Charting the Course ... ... to Your Success!" JavaScript Advanced Course Summary Description This course will review the basics of JavaScript and provide instruction on advanced topics such as advanced features of JavaScript functions, Object-Oriented programming in JavaScript (Inheritance, encapsulation) with prototypes, using closures, understanding JavaScript promises and advanced best practices. Objectives At the end of this course, students will be able to: Review Learn function expressions/function declarations/immediately executable functions Use JavaScript objects to implement Inheritance and encapsulation Understand JavaScript closures Learn JavaScript promises Discuss how to best use the advanced topics in this course in your JavaScript projects. Topics Basics Review Object-Oriented Programming Function Expressions Error Handling And Debugging Advanced Techniques Audience This course is intended for JavaScript programmers Prerequisites JavaScript introduction Duration Two days Due to the nature of this material, this document refers to numerous hardware and software products by their trade names. References to other companies and their products are for informational purposes only, and all trademarks are the properties of their respective companies. It is not the intent of ProTech Professional Technical Services, Inc. to use any of these names generically "Charting the Course ... ... to Your Success!" JavaScript Advanced Course Outline I. Basics Review IV. Error Handling And Debugging A. Browser Error Reporting II. Object-Oriented Programming B. Internet Explorer A. Understanding Objects C. Firefox B. Types of Properties D. Chrome C. Defining Multiple Properties E. Error Handling D. Reading Property Attributes F. The try-catch Statement E. Object Creation G. Throwing Errors F. The Factory Pattern H. The error Event G. The Constructor Pattern I.
    [Show full text]
  • Creational Patterns
    9. Creational Pattern Venkat Subramaniam CDP-1 Creational Patterns • Abstracts instantiation process • Makes system independent of how its objects are œ created œ composed œ represented • Encapsulates knowledge about which concrete classes the system uses • Hides how instances of these classes are created and put together Venkat Subramaniam CDP-2 Abstract Factory Provide an interface for creating families of related or dependent objects without specifying their concrete classes Venkat Subramaniam CDP-3 Example that would benefit from Abstract Factory ComputerModelA MemoryType A CPUTypeA ModemTypeA BuildComputer(ComputerModelA& comp) { comp.Add(new MemoryTypeA); comp.Add(new CPUTypeA); comp.Add(new ModemTypeA); } What if I want to build a Computer of Model B with Model B Memory,CPU and Modem? Venkat Subramaniam CDP-4 Using Abstract Factory ComputerFactory Client Computer createComputer() createMemory() createCPU() Computer Computer createModem() ModelA ModelB Memory CompFactoryB CompFactoryA createComputer() createComputer() Memory Memory createMemory() createMemory() ModelA ModelB createCPU() createCPU() createModem() createModem() Venkat Subramaniam CDP-5 Using Abstract Factory... BuildComputer(Computer& comp, ComputerFactory& compFactory) { comp.Add(compFactory.createMemory()) ; comp.Add(compFactory.createCPU()); comp.Add(compFactory.createModem()); } Venkat Subramaniam CDP-6 .hen to use Abstract Factory? • Use Abstract Factory when: œ system should be independent of how its products are created, composed and represented œ system should
    [Show full text]
  • Java Design Patterns I
    Java Design Patterns i Java Design Patterns Java Design Patterns ii Contents 1 Introduction to Design Patterns 1 1.1 Introduction......................................................1 1.2 What are Design Patterns...............................................1 1.3 Why use them.....................................................2 1.4 How to select and use one...............................................2 1.5 Categorization of patterns...............................................3 1.5.1 Creational patterns..............................................3 1.5.2 Structural patterns..............................................3 1.5.3 Behavior patterns...............................................3 2 Adapter Design Pattern 5 2.1 Adapter Pattern....................................................5 2.2 An Adapter to rescue.................................................6 2.3 Solution to the problem................................................7 2.4 Class Adapter..................................................... 11 2.5 When to use Adapter Pattern............................................. 12 2.6 Download the Source Code.............................................. 12 3 Facade Design Pattern 13 3.1 Introduction...................................................... 13 3.2 What is the Facade Pattern.............................................. 13 3.3 Solution to the problem................................................ 14 3.4 Use of the Facade Pattern............................................... 16 3.5 Download the Source Code.............................................
    [Show full text]
  • Table of Contents
    Table of Contents ± -—T^jTp^om Object-Oriented to Functional Programming 5 Chajava- an introduction 5 java programming paradigms 6 CO imperative programming CD Real-life imperative example Object-oriented paradigm 7 Objects and classes 7 Encapsulation 7 Abstraction 8 Inheritance 8 Polymorphism 9 Declarative programming 10 Functional programming 11 Working with collections versus working with streams 11 An introduction to Unified Modeling Language 12 Class relations 14 Generalization 15 Realization 15 Dependency 16 Association 16 Aggregation 16 Composition 17 Design patterns and principles 17 Single responsibility principle 18 Open/closed principle 20 Liskov Substitution Principle 20 Interface Segregation Principle 22 Dependency inversion principle 23 Summary 24 Chapter 2: Creational Patterns 27 Singleton pattern 27 Synchronized singletons 29 Synchronized singleton with double-checked locking mechanism 30 Lock-free thread-safe singleton 30 tu * y and lazy loacling 31 i he factory pattern 31 Simple factory pattern 32 Table of Contents Static factory 33 Simple factory with class registration using reflection 34 Simple factory with class registration using Product.newlnstance 35 Factory method pattern 36 Anonymous concrete factory 38 Abstract factory 38 Simple factory versus factory method versus abstract factory 40 Builder pattern 40 Car builder example 41 Simplified builder pattern 43 Anonymous builders with method chaining 44 Prototype pattern 45 Shallow clone versus deep clone Object pool pattern Summary аэоэсБ Chapter 3: Behavioral Patterns
    [Show full text]
  • Object-Oriented Design Patterns
    Object-Oriented Design Patterns David Janzen EECS 816 Object-Oriented Software Development University of Kansas Outline • Introduction – Design Patterns Overview – Strategy as an Early Example – Motivation for Creating and Using Design Patterns – History of Design Patterns • Gang of Four (GoF) Patterns – Creational Patterns – Structural Patterns – Behavioral Patterns Copyright © 2006 by David S. 2 Janzen. All rights reserved. What are Design Patterns? • In its simplest form, a pattern is a solution to a recurring problem in a given context • Patterns are not created, but discovered or identified • Some patterns will be familiar? – If you’ve been designing and programming for long, you’ve probably seen some of the patterns we will discuss – If you use Java Foundation Classes (Swing), Copyright © 2006 by David S. 3 you have certaJiannzleyn. Aulls rieghdts rsesoervmed.e design patterns Design Patterns Definition1 • Each pattern is a three-part rule, which expresses a relation between – a certain context, – a certain system of forces which occurs repeatedly in that context, and – a certain software configuration which allows these forces to resolve themselves 1. Dick Gabriel, http://hillside.net/patterns/definition.html Copyright © 2006 by David S. 4 Janzen. All rights reserved. A Good Pattern1 • Solves a problem: – Patterns capture solutions, not just abstract principles or strategies. • Is a proven concept: – Patterns capture solutions with a track record, not theories or speculation 1. James O. Coplien, http://hillside.net/patterns/definition.html Copyright © 2006 by David S. 5 Janzen. All rights reserved. A Good Pattern • The solution isn't obvious: – Many problem-solving techniques (such as software design paradigms or methods) try to derive solutions from first principles.
    [Show full text]
  • Non-Software Examples of Software Design Patterns Автор: Michael Duell
    Non-Software Examples of Software Design Patterns Автор: Michael Duell. Хорошая, хоть и старая (97 год) статья в которой приведены примеры применения паттернов в вещах, которые не имеют отношения к разработке. Такой подход отлично иллюстрирует паттерны и делает их более доступными для понимания. Например отлично показан паттерн Фасад: интерфейсы офисных устройств можно сильно упростить с помощью секретарши. Или например паттерн Бридж, который показан на примере выключателя которым можно управлять лампочкой, вентилятором или любым другим прибором. Non-Software Examples of Software Design Patterns by Michael Duell Abstract Software design patterns have roots in the architectural patterns of Christopher Alexander, and in the object movement. According to Alexander, patterns repeat themselves, since they are a generic solution to a given system of forces. The object movement looks to the real world for insights into modeling software relationships. With these dual roots, it seems reasonable that software design patterns should be repeated in real world objects. This paper presents a real world, non software instance of each design pattern from the book, Design Patterns - Elements of Reusable Object-Oriented Software [13]. The paper also discusses the implications of non-software examples on the communicative power of a pattern language, and on design pattern training. 1. Introduction Within the software industry, a growing community of patterns proponents exists. The roots of the patterns movement are found in the writings of architect Christopher Alexander, who describes a pattern as a generic solution to a given system of forces in the world [1]. Alexander's patterns can be observed in everyday structures. Each pattern in A Pattern Language[2] includes a picture of an archetypal example of the pattern.
    [Show full text]