Session 7: Introduction to Design and Architectural Patterns

Total Page:16

File Type:pdf, Size:1020Kb

Session 7: Introduction to Design and Architectural Patterns Software Engineering G22.2440-001 Session 7 – Sub-Topic 5 Introduction to Design and Architectural Patterns Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences 1 First Example A Dice Game A Player rolls 10x 2 dices If result = 7, score=score + 10 points At the end, score of the player is registred in the highscore table. 2 Activity Diagram menu [highscore] [start] [exit] view Start Highscore turn=0 Roll Dice turn++ [true] Turn<10 [false] Update highscore 3 Analysis Diagram… 4 Design Stage Manage User Interface Manage Persistence of highscore in a file or in relational database Realize a layered architecture : Apply the Layer Architectural Pattern 5 Layer Helps structure an application that can be decomposed into groups of subtasks in which each group of subtasks is at a particular level of abstraction. 6 Layer: examples 7 Layer :Structure 8 Layer: Structure 9 Layer and components… 10 Layers : Variants Relaxed Layered System: – A layer « j » can use service of j-1, j-2… – A layer can be partially opaque • Some service to layer j+1, others to all upper services… Layering through inheritance: – Lower layers are implemented as base classes – Higher level can override lower level… 11 Layers : Known Uses • Virtual machines: JVM and binary code format • API : Layer that encapsulates lower layers • Information System – Presentation, Application logic, Domain Layer, Database • Windows NT (relaxed for: kernel and IO and hardware) – System services, – Resource management (Object manager, security monitor, process manager, I/O manager, VM manager, LPC), – Kernel (exception handling, interrupt, multipro synchro, threads), – HAL (Hardware Abstraction Level) – Hardware 12 Layers: benefits Reuse of layers Support for standardization (POSIX) Dependencies are kept local Exchangeabilities : – Replacement of old implementation with Adapter Pattern – Dynamic exchange with Bridge Pattern 13 Layers: Liabilities Cascades of changing behavior Lower efficiency Unnecessary work: functions of a layer called many times for one service Difficulty of establishing correct granularity of layers: Too few layers -> less benefits, too many layers -> complexity and overhead… 14 Applying Layer Architecture UI Core Play View High Score Persistence Fichier ou BDD 15 Package decomposition <<layer>> UI <<layer>> <<subsystem>> Core Util <<layer>> Persist 16 Layer « core » Contain business logic classes… Adapt analysis classes for implementation Use of singleton Idiom… 17 Singleton (Idiom) Ensure a class only has one instance, and provide a global point of access to it. 18 Singleton Structure 19 Core « Layer »:First diagram Design Analysis 20 Util « subsystem » • Need for random numbers • Use java.util « random » functionality… • The random number generator is shared by the die… • Another singleton... Subsystem « util » Package decomposition <<layer>> UI <<layer>> <<subsystem>> Core Util <<layer>> Persist 23 Observer One-to-many dependency between objects: change of one object will automatically notify observers 24 Observer: Applicability A change to one object requires changing an unknown set of other objects Object should be able to notify other objects that may not be known at the beginning 25 Observer: Structure 26 Observer: Consequences Abstract coupling between subject and observer Support for broadcast communication Hard to maintain 27 Applying Observer Pattern 28 Observer View 29 Views are graphical objects 30 Setting up Observer : RollForm : : PlayerView : Die : DieView Playe 1: display( ) 2: PlayerView(Player) 3: addObserver(Observer) 4: return component 5: display() 6: DieView(Die) 7: addObserver(Observer) 8: return component 31 Observer : Change Propagation : Die : Randomizer : DieView : JLabel 1: getValue( ) 2: setValue(int) 3: notifyObservers( ) 4: update(Observable, Object) 5: getState() 3 6: setText(3) 32 UI/Core Separation... Layered Architecture... UI Decoupling classes and interfaces Core 34 MVC • Java AWT Java: Delegation Model – Event propagation from user interface to core application classes • MVC: – State change propagation to graphical objects Package decomposition <<layer>> UI <<layer>> <<subsystem>> Core Util <<layer>> Persist 36 Pattern Factory Method Intent – Define an interface for creating an object, but let sub-classes decide which class to instantiate – let a class defer instantiation to subclasses – Also known as Virtual Constructor 37 Factory Method Applicability : Use when – a class cannot 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, and you want to localize the knowledge of which helper subclass to delegate. 38 Structure 39 Factory method Consequences – Provide hooks for subclasses – connects parallel class hierarchies Known uses – MacApp, ET++ – ClassView in smalltalk80 MVC (controller creation) – Orbix ORB for generating PROXY object 40 « Persist » Layer Persistence technical classes Ensure independence of Core/Persist – Be able to switch « persistent engine » For example: – Persistence via « Serialization » – Persistence via a relational database (JDBC). 41 Applying Factory Abstract produc Concrete product Concrete Factory Abstract Factory 42 Applying Factory : DiceGame : SrKit : HighScoreSr : RealPlayer 1: SrKit( ) Attention! DiceGame voit SrKit comme un PersistKit et HighScoreSr 2: getInstance( ) comme un HighScore 3: DiceGame( ) 4: makeKit( ) 5: HighScoreSr( ) Seul le Realplayer sait qu'il utilise un SrKit ! DiceGame 6: load( ) non ! 7: quit( ) 8: getInstance( ) 9: save( ) 43 Using Serialization e1 : Entry • Persistence propagation... : High e2 : Entry Score e3 : Entry e4 : Entry A little bit of code…that’s all folks class HighScoreSr extends HighScore implements Serializable { ... public void save() throws Exception { FileOutputStream ostream = new FileOutputStream(filename); ObjectOutputStream p = new ObjectOutputStream(ostream); p.writeObject(this); // Write the tree to the stream. p.flush(); ostream.close(); // close the file. } public void load() throws Exception { FileInputStream istream = new FileInputStream(filename); ObjectInputStream q = new ObjectInputStream(istream); HighScoreSr hsr = (HighScoreSr)q.readObject(); } } JdbPersist... Dynamic Model • A table must be created in a relational DBMS • Upon creation of HighScoreJDBC: Connection to DBMS via JDBC • save: – Perform « inserts » for each « entry » • load: – Select * from ..., – Follow the result, – create « entry » objects A little bit of code... public class HighScoreJDBC extends HighScore { public static final String url="jdbc:odbc:dice"; Connection con=null; public HighScoreJDBC() { try { //loads the driver Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection(url, "molli",""); } catch (Exception e) { e.printStackTrace(); new Error("Cannot access Database at"+url); } hs=this; // register unique instance ! this.load(); } Jdbc Load public void load() { try { Statement select=con.createStatement(); ResultSet result=select.executeQuery ("SELECT Name,Score FROM HighScore"); while (result.next()) { this.add(new Entry(result.getString(1), result.getInt(2))); } } catch (Exception e) { e.printStackTrace(); } } Jdbc Save public void save() { try { for (Enumeration e = this.elements() ; e.hasMoreElements() ;) { Entry entry=(Entry)e.nextElement(); Statement s=con.createStatement(); s.executeUpdate( "INSERT INTO HighScore (Name,Score)"+ "VALUES('"+entry.getName()+"',"+ entry.getScore()+")"); } } catch (Exception e) { e.printStackTrace(); } } Summary • 1 Architectural pattern : Layer • 2 Design Patterns : Observer, Factory • 1 Idiom : Singleton • Pb: – Combining pattern to combine their forces… 50 51 Bank example… A basic bank system: – 1 bank, n Account. – Each account belong to 1 client. – Each account is credited by an amount a money. Bank functions – Withdrawal on an account, Credit an account, Transfer money from one account to another… 52 Naive solution 53 Naive Solution : c li e n t : B a n k 1 : Account 2 : Account transfer( 1,2,100 ) w ithdraw al(1,100 ) getAccount(1 ) w ithdraw( 100) deposit(2,100 ) getAccount(2 ) deposit( 100) 54 Applying Command Pattern… Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations. 55 Command Example 56 Command Example 57 Command Structure 58 Command Structure 59 Command Consequences n Command decouples the object that invokes the operation from the one that knows how to perform it. n Commands are first-class objects. They can be manipulated and extended like any other object. n It's easy to add new Commands, because you don't have to change existing classes. 60 Applying Command Pattern 61 Applying Command Pattern : client t : Transfer : Bank 1 : Account 2 : Account Transfer(1,2,100 ) Execute(t ) do( ) getAccount( 1) withdraw( 100) getAccount( 2) deposit( ) 62 Composite Pattern Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. 63 Composite Example 64 Composite Example 65 Composite Structure 66 Applying Composite on Command 67 Applying Composite 68 : client w : Withdrawal d : Deposit m : Macrocom : Bank 1 : Account 2 : Account Withdrawal(b, 1,100 ) Deposit(b,2,100 ) Macrocom(b ) add( w) add(d ) Execute(m ) do( ) do( ) getAccount( 1) withdraw( 100) do( ) getAccount(
Recommended publications
  • 1 Design Pattern for Open Class (DRAFT) 2 Abstract Factory
    1 Design Pattern for Open Class (DRAFT) Tanaka Akira <[email protected]> A design pattern describes a software architecture which is reusable and exten- sible. [GoF] is the book containing 23 design patterns for OOP languages like C++ and Java. [GoF] describes several trade offs of the patterns. In C++ and Java, a class is defined by only one module. However, there are languages which can define a class by two or more modules: Cecil, MultiJava, AspectJ, MixJuice, CLOS, Ruby, etc. Such class is called "open class" because it is extensible by modules implemented later [Chambers]. For languages with open class, more extensible and/or simpler design patterns exists. We studied design patterns with open class for each GoF design patterns. In this paper, we describe two patterns: the Abstract Factory pattern and the Visitor pattern. 2 Abstract Factory The Abstract Factory pattern is a design pattern for separating class names from the code which generates the object group of related classes for making them configurable. Following figure is the class diagram of the Abstract Factory pattern. Since the example described in [GoF] uses only one concrete factory for each binaries, the required concrete factory is selected statically. The example builds two binaries for Motif and Presentation Manager from a single source code. Two concrete factories are exist for Motif and Presentation Manager. When a binary is built, it is selected which concrete factory is linked. Such static selection can be implemented with the fewer number of classes by open class as following modules. • The module which defines Window and ScrollBar class and their methods which is independent to window systems.
    [Show full text]
  • 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]
  • Capturing Interactions in Architectural Patterns
    Capturing Interactions in Architectural Patterns Dharmendra K Yadav Rushikesh K Joshi Department of Computer Science and Engineering Department of Computer Science and Engineering Indian Institute of Technology Bombay Indian Institute of Technology Bombay Powai, Mumbai 400076, India Powai, Mumbai 400076, India Email: [email protected] Email: [email protected] TABLE I Abstract—Patterns of software architecture help in describing ASUMMARY OF CCS COMBINATORS structural and functional properties of the system in terms of smaller components. The emphasis of this work is on capturing P rimitives & Descriptions Architectural the aspects of pattern descriptions and the properties of inter- Examples Significance component interactions including non-deterministic behavior. Prefix (.) Action sequence intra-component Through these descriptions we capture structural and behavioral p1.p2 sequential flow specifications as well as properties against which the specifications Summation (+) Nondeterminism choice within a component are verified. The patterns covered in this paper are variants of A1 + A2 Proxy, Chain, MVC, Acceptor-Connector, Publisher-Subscriber Composition (|) Connect matching multiple connected and Dinning Philosopher patterns. While the machines are CCS- A1 | A2 i/o ports in assembly components based, the properties have been described in Modal µ-Calculus. Restriction (\) Hiding ports from Internal The approach serves as a framework for precise architectural A\{p1, k1, ..} further composition features descriptions. Relabeling ([]) Renaming of ports syntactic renaming A[new/old, ..] I. INTRODUCTION In component/connector based architectural descriptions [6], [13], components are primary entities having identities in the represents interface points as ports uses a subset of CSP for system and connectors provide the means for communication it’s formal semantics.
    [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]
  • Automatic Verification of Java Design Patterns
    Automatic Verification of Java Design Patterns Alex Blewitt, Alan Bundy, Ian Stark Division of Informatics, University of Edinburgh 80 South Bridge, Edinburgh EH1 1HN, UK [email protected] [email protected] [email protected] Abstract 2. Design patterns There are a number of books which catalogue and de- Design patterns are widely used by object oriented de- scribe design patterns [4, 1, 6] including an informal de- signers and developers for building complex systems in ob- scription of the key features and examples of their use. ject oriented programming languages such as Java. How- However, at the moment there are no books which attempt ever, systems evolve over time, increasing the chance that to formalise these descriptions, possibly for the following the pattern in its original form will be broken. reasons: We attempt to show that many patterns (implemented in Java) can be verified automatically. Patterns are defined 1. The implementation (and description) of the pattern is in terms of variants, mini-patterns, and constraints in a language-specific. pattern description language called SPINE. These specifi- 2. There are often several ways to implement a pattern cations are then processed by HEDGEHOG, an automated within the same language. proof tool that attempts to prove that Java source code 3. Formal language descriptions are not common within meets these specifications. the object oriented development community. Instead, each pattern is presented as a brief description, and an example of its implementation and use. Designers and developers are then expected to learn the ‘feel’ of a pat- 1.
    [Show full text]
  • Enterprise Integration Patterns Introduction
    Enterprise Integration Patterns Gregor Hohpe Sr. Architect, ThoughtWorks [email protected] July 23, 2002 Introduction Integration of applications and business processes is a top priority for many enterprises today. Requirements for improved customer service or self-service, rapidly changing business environments and support for mergers and acquisitions are major drivers for increased integration between existing “stovepipe” systems. Very few new business applications are being developed or deployed without a major focus on integration, essentially making integratability a defining quality of enterprise applications. Many different tools and technologies are available in the marketplace to address the inevitable complexities of integrating disparate systems. Enterprise Application Integration (EAI) tool suites offer proprietary messaging mechanisms, enriched with powerful tools for metadata management, visual editing of data transformations and a series of adapters for various popular business applications. Newer technologies such as the JMS specification and Web Services standards have intensified the focus on integration technologies and best practices. Architecting an integration solution is a complex task. There are many conflicting drivers and even more possible ‘right’ solutions. Whether the architecture was in fact a good choice usually is not known until many months or even years later, when inevitable changes and additions put the original architecture to test. There is no cookbook for enterprise integration solutions. Most integration vendors provide methodologies and best practices, but these instructions tend to be very much geared towards the vendor-provided tool set and often lack treatment of the bigger picture, including underlying guidelines and principles. As a result, successful enterprise integration architects tend to be few and far in between and have usually acquired their knowledge the hard way.
    [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]
  • Tree Visitors in Clojure Update the Java Visitor Pattern with Functional Zippers
    Tree visitors in Clojure Update the Java Visitor pattern with functional zippers Skill Level: Intermediate Alex Miller ([email protected]) Senior Engineer Revelytix 20 Sep 2011 JVM language explorer Alex Miller has recently discovered the benefits of implementing the Visitor pattern using Clojure, a functional Lisp variant for the Java Virtual Machine. In this article, he revisits the Visitor pattern, first demonstrating its use in traversing tree data in Java programs, then rewriting it with the addition of Clojure's functional zippers. I’ve used trees of domain objects in my Java applications for many years. More recently, I’ve been using them in Clojure. In each case, I've found that the Visitor pattern is a reliable tool for manipulating trees of data. But there are differences in how the pattern works in a functional versus object-oriented language, and in the results it yields. About Clojure Clojure is a dynamic and functional programming language variant of Lisp, written specifically for the JVM. Learn more about Clojure on developerWorks: •"The Clojure programming language" •"Clojure and concurrency" •"Solving the Expression Problem with Clojure 1.2" •"Using CouchDB with Clojure" In this article, I revisit domain trees and the Visitor pattern for the Java language, Tree visitors in Clojure Trademarks © Copyright IBM Corporation 2011 Page 1 of 27 developerWorks® ibm.com/developerWorks then walk through several visitor implementations using Clojure. Being a functional language, Clojure brings new tricks to data query and manipulation. In particular, I've found that integrating functional zippers into the Visitor pattern yields efficiency benefits, which I explore.
    [Show full text]
  • Addison Wesley, 2000, Pp
    ------==Proudly Presented by MODELER==------ preface.fm Page xv Wednesday, June 6, 2001 4:18 PM Preface Design patterns and object-oriented programming. They hold such promise to make your life as a software designer and developer eas- ier. Their terminology is bandied about every day in the technical and even the popular press. But it can be hard to learn them, to become proficient with them, to understand what is really going on. Perhaps you have been using an object-oriented or object-based language for years. Have you learned that the true power of objects is not inheritance but is in “encapsulating behaviors”? Perhaps you are curious about design patterns and have found the literature a bit too esoteric and high-falutin. If so, this book is for you. It is based on years of teaching this material to software developers, both experienced and new to object orientation. It is based upon the belief—and our experience—that once you understand the basic principles and motivations that underlie these concepts, why they are doing what they do, your learning curve will be incredibly shorter. And in our discussion of design patterns, you will under- stand the true mindset of object orientation, which is a necessity before you can become proficient. As you read this book, you will gain a solid understanding of the ten most essential design patterns. You will learn that design pat- terns do not exist on their own, but are supposed to work in con- cert with other design patterns to help you create more robust applications.
    [Show full text]
  • Object-Oriented Analysis, Design and Implementation
    Undergraduate Topics in Computer Science Brahma Dathan Sarnath Ramnath Object-Oriented Analysis, Design and Implementation An Integrated Approach Second Edition Undergraduate Topics in Computer Science Undergraduate Topics in Computer Science (UTiCS) delivers high-quality instruc- tional content for undergraduates studying in all areas of computing and information science. From core foundational and theoretical material to final-year topics and applications, UTiCS books take a fresh, concise, and modern approach and are ideal for self-study or for a one- or two-semester course. The texts are all authored by established experts in their fields, reviewed by an international advisory board, and contain numerous examples and problems. Many include fully worked solutions. More information about this series at http://www.springer.com/series/7592 Brahma Dathan • Sarnath Ramnath Object-Oriented Analysis, Design and Implementation An Integrated Approach Second Edition 123 Brahma Dathan Sarnath Ramnath Department of Information and Computer Department of Computer Science Science and Information Technology Metropolitan State University St. Cloud State University St. Paul, MN St. Cloud, MN USA USA Series editor Ian Mackie Advisory Board Samson Abramsky, University of Oxford, Oxford, UK Karin Breitman, Pontifical Catholic University of Rio de Janeiro, Rio de Janeiro, Brazil Chris Hankin, Imperial College London, London, UK Dexter Kozen, Cornell University, Ithaca, USA Andrew Pitts, University of Cambridge, Cambridge, UK Hanne Riis Nielson, Technical University of Denmark, Kongens Lyngby, Denmark Steven Skiena, Stony Brook University, Stony Brook, USA Iain Stewart, University of Durham, Durham, UK A co-publication with the Universities Press (India) Private Ltd., licensed for sale in all countries outside of India, Pakistan, Bhutan, Bangladesh, Sri Lanka, Nepal, The Maldives, Middle East, Malaysia, Indonesia and Singapore.
    [Show full text]
  • Co-Occurrence of Design Patterns and Bad Smells in Software Systems
    XI Brazilian Symposium on Information System, Goi^ania,GO, May 26-29, 2015. Co-Occurrence of Design Patterns and Bad Smells in Software Systems: An Exploratory Study Bruno Cardoso Eduardo Figueiredo Software Engineering Lab (LabSoft) Software Engineering Lab (LabSoft) Federal University of Minas Gerais (UFMG) Federal University of Minas Gerais (UFMG) Belo Horizonte, MG - Brazil Belo Horizonte, MG - Brazil [email protected] [email protected] ABSTRACT In a previous work [1], we performed a systematic literature A design pattern is a general reusable solution to a recurring review in order to understand how studies investigate these two problem in software design. Bad smells are symptoms that may topics, design patterns and bad smells, together. Our results indicate something wrong in the system design or code. showed that, in general, studies have a narrow view concerning Therefore, design patterns and bad smells represent antagonistic the relation between these concepts. Most of them focus on structures. They are subject of recurring research and typically refactoring opportunities. Among these, some tools [3][7][15][17] appear in software systems. Although design patterns represent have been proposed to identify code fragments that can be good design, their use is often inadequate because their refactored to patterns. Other studies [2][6] establish a structural implementation is not always trivial or they may be unnecessarily relationship between the terms design pattern and bad smell. In employed. The inadequate use of design patterns may lead to a addition, there are reported cases in the literature where the use of bad smell. Therefore, this paper performs an exploratory study in design patterns may not always be the best option and the wrong order to identify instances of co-occurrences of design patterns use of a design pattern can even introduce bad smells in code [19] and bad smells.
    [Show full text]
  • Enterprise Development with Flex
    Enterprise Development with Flex Enterprise Development with Flex Yakov Fain, Victor Rasputnis, and Anatole Tartakovsky Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo Enterprise Development with Flex by Yakov Fain, Victor Rasputnis, and Anatole Tartakovsky Copyright © 2010 Yakov Fain, Victor Rasputnis, and Anatole Tartakovsky.. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Mary E. Treseler Indexer: Ellen Troutman Development Editor: Linda Laflamme Cover Designer: Karen Montgomery Production Editor: Adam Zaremba Interior Designer: David Futato Copyeditor: Nancy Kotary Illustrator: Robert Romano Proofreader: Sada Preisch Printing History: March 2010: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Enterprise Development with Flex, the image of red-crested wood-quails, and related trade dress are trademarks of O’Reilly Media, Inc. 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 O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein.
    [Show full text]