Design Pattern Implementation in Java and Aspectj

Total Page:16

File Type:pdf, Size:1020Kb

Design Pattern Implementation in Java and Aspectj Design Pattern Implementation in Java and AspectJ Jan Hannemann Gregor Kiczales University of British Columbia University of British Columbia 201-2366 Main Mall 201-2366 Main Mall Vancouver B.C. V6T 1Z4 Vancouver B.C. V6T 1Z4 jan [at] cs.ubc.ca gregor [at] cs.ubc.ca ABSTRACT successor in the chain. The event handling mechanism crosscuts the Handlers. AspectJ implementations of the GoF design patterns show modularity improvements in 17 of 23 cases. These improvements When the GoF patterns were first identified, the sample are manifested in terms of better code locality, reusability, implementations were geared to the current state of the art in composability, and (un)pluggability. object-oriented languages. Other work [19, 22] has shown that implementation language affects pattern implementation, so it seems The degree of improvement in implementation modularity varies, natural to explore the effect of aspect-oriented programming with the greatest improvement coming when the pattern solution techniques [11] on the implementation of the GoF patterns. structure involves crosscutting of some form, including one object As an initial experiment we chose to develop and compare Java playing multiple roles, many objects playing one role, or an object [27] and AspectJ [25] implementations of the 23 GoF patterns. playing roles in multiple pattern instances. AspectJ is a seamless aspect-oriented extension to Java, which means that programming in AspectJ is effectively programming in Categories and Subject Descriptors Java plus aspects. D.2.11 [Software Engineering]: Software Architectures – By focusing on the GoF patterns, we are keeping the purpose, patterns, information hiding, and languages; D.3.3 intent, and applicability of 23 well-known patterns, and only allowing [Programming Languages]: Language Constructs and Features – the solution structure and solution implementation to change. So we patterns, classes and objects are not discovering new patterns, but simply working out how implementations of the GoF patterns can be handled using a new General Terms implementation tool. Design, Languages. Our results show that using AspectJ improves the implementation of many GoF patterns. In some cases this is reflected in a new solution Keywords structure with fewer or different participants, in other cases, the Design patterns, aspect-oriented programming. structure remains the same, only the implementation changes. Patterns assign roles to their participants, for example Subject and 1. INTRODUCTION Observer for the Observer pattern. These roles define the The Gang-of-Four (GoF) design patterns [9] offer flexible solutions functionality of the participants in the pattern context. We found that to common software development problems. Each pattern is patterns with crosscutting structure between roles and participant comprised of a number of parts, including purpose/intent, classes see the most improvement. applicability, solution structure, and sample implementations. The improvement comes primarily from modularizing the A number of GoF patterns involve crosscutting structures in the implementation of the pattern. This is directly reflected in the relationship between roles in the pattern and classes in each implementation being textually localized. An integral part of instance of the pattern [6]. In the Observer pattern, an operation achieving this is to remove code-level dependencies from the that changes any Subject must trigger notifications of its Observers participant classes to the implementation of the pattern. – in other words the act of notification crosscuts one or more The implementation of 17 of the patterns is modularized in this way. operations in each Subject in the pattern. In the Chain Of For 12 of the patterns, the modularity enables a core part of the Responsibility pattern, all Handlers need to be able to accept implementation to be abstracted into reusable code. For 14, it requests or events and to either handle them or forward them to the enables transparent composition of pattern instances, so that multiple patterns can have shared participants. For the 17 Permission to make digital or hard copies of all or part of this work for modularized patterns, all pattern code from some or all participants personal or classroom use is granted without fee provided that copies are is moved into the pattern aspect, allowing those participants to be not made or distributed for profit or commercial advantage and that (un)pluggable with respect to the pattern. copies bear this notice and the full citation on the first page. To copy These results – 74% of GoF patterns implemented in a more otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. modular way, and 52% reusable – suggest it would be worthwhile to OOPSLA ’02, November 4-8, 2002, Seattle, Washington, USA. undertake the experiments of applying AspectJ to more patterns Copyright 2002 ACM 1-58113-471-1/02/0011…$5.00. and/or applying other aspect-oriented techniques to pattern Screen: Observer implementations. The rest of the paper is organized as follows. Section 2 surveys update() previously identified problems in design pattern implementation. display(String) Section 3 introduces the study format. In section 4, we present our AspectJ implementations and categorize the improvements we observed. Section 5 shows an analysis of our findings and 1 * observations. Related work is discussed in section 6, and Section 7 Figure FigureElement summarizes our work. addObserver(Observer) 2. ESTABLISHED CHALLENGES removeObserver(Observer) Numerous authors have identified challenges that arise when notify() patterns are concretized in a particular software system. The three most important challenges are related to implementation, documentation, and composition. Design pattern implementation usually has a number of undesirable Point: Subject Line: Subject related effects. Because patterns influence the system structure and their implementations are influenced by it [7], pattern getX():int getP1():Point getY():int getP2():Point implementations are often tailored to the instance of use. This can getColor():Color getColor():Color lead to them “disappearing into the code” [7] and losing their addObserver(Observer) addObserver(Observer) modularity [21]. This makes it hard to distinguish between the removeObserver(Observer) removeObserver(Observer) pattern, the concrete instance and the object model involved [15]. notify() notify() Adding or removing a pattern to/from a system is often an invasive, setX(int) setP1(Point) difficult to reverse change [4]. Consequently, while the design setY(int) setP2(Point) pattern is reusable, its implementations usually are not [21]. setColor(Color) setColor(Color) The invasive nature of pattern code, and its scattering and tangling with other code creates documentation problems [21]. If multiple Figure 1. A simple Graphical Figure Element System that patterns are used in a system, it can become difficult to trace uses the Observer pattern in Java. The underlined methods particular instances of a design pattern, especially if classes are contain code necessary to implement this instance of the involved in more than one pattern (i.e. if there is pattern Observer pattern. overlay/composition) [1]. usually with varying tradeoffs. Our goal was to fully investigate the Pattern composition causes more than just documentation problems. design space of clearly defined implementations of each pattern. It is inherently difficult to reason about systems with multiple We ended up creating a total of 57 different implementations, which patterns involving the same classes, because the composition ranged from 1 to 7 per pattern. Some of the tradeoffs and design creates large clusters of mutually dependent classes [21]. This is an decisions are discussed in Section 4. important topic because some design patterns explicitly use others patterns in their solution. 4. RESULTS This section presents a comparison of the AspectJ and Java 3. STUDY FORMAT implementations of concrete instances of the GoF design patterns. The findings presented in this paper are based on a comparative Section 4.1 is a detailed discussion of the Observer pattern. We use analysis of Java and AspectJ implementations of the GoF design this discussion to present properties common to most of the AspectJ patterns. solutions. The remaining patterns are presented by building on the For each of the 23 GoF patterns we created a small example that concepts developed in Section 4.1. makes use of the pattern, and implemented the example in both Java 1 4.1 Example: the Observer pattern and AspectJ. The Java implementations correspond to the sample The intent of the Observer pattern is to “define a one-to-many C++ implementations in the GoF book, with minor adjustments to dependency between objects so that when one object changes state, account for the differences between C++ and Java (lack of multiple all its dependents are notified and updated automatically”[9]. inheritance, etc.). Most patterns have a number of implementation Object-oriented implementations of the Observer pattern, such as variants and alternatives. If a pattern offered more than one the sample code in the GoF book (p. 300-303), usually add a field to possible implementation, we picked the one that appeared to be the all potential Subjects that stores a list of Observers interested in that most generally applicable. particular Subject. When a Subject wants to report a state change
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]
  • The Future of Embedded Software
    The Future of Embedded Software Edward A. Lee Professor, Chair of EE, and Associate Chair of EECS UC Berkeley ARTEMIS 2006 Annual Conference Graz, Austria May 22-24, 2006 Why Embedded Software? Why Now? “Information technology (IT) is on the verge of another revolution. Driven by the increasing capabilities and ever declining costs of computing and communications devices, IT is being embedded into a growing range of physical devices linked together through networks and will become ever more pervasive as the component technologies become smaller, faster, and cheaper... These networked systems of embedded computers ... have the potential to change radically the way people interact with their environment by linking together a range of devices and sensors that will allow information to be collected, shared, and processed in unprecedented ways. ... The use of [these embedded computers] throughout society could well dwarf previous milestones in the information revolution.” National Research Council Report Embedded Everywhere Lee, Berkeley 2 The Key Obstacle to Progress: Gap Between Systems and Computing | Traditional dynamic systems theory needs to adapt to better account for the behavior of software and networks. | Traditional computer science needs to adapt to embrace time, concurrency, and the continuum of physical processes. Lee, Berkeley 3 The Next Systems Theory: Simultaneously Physical and Computational The standard model: Embedded software is software on small computers. The technical problem is one of optimization (coping with limited resources). The Berkeley model: Embedded software is software integrated with physical processes. The technical problem is managing time and concurrency in computational systems. Lee, Berkeley 4 Obstacles in Today’s Technology: Consider Real Time Electronics Technology Delivers Timeliness… … and the overlaying software abstractions discard it.
    [Show full text]
  • Emery Berger Curriculum Vitae
    College of Information and Computer Sciences Emery Berger University of Massachusetts Amherst [email protected] Amherst, MA 01003 http://www.emeryberger.com RESEARCH INTERESTS Design and implementation of programming languages, with a focus on automatically improving reliability, security, and performance. EDUCATION Ph.D., Computer Science, UNIVERSITY OF TEXAS AT AUSTIN, August 2002 Thesis: Memory Management for High-Performance Applications Advisor: Kathryn S. McKinley M.S., Computer Science, UNIVERSITY OF TEXAS AT AUSTIN, December 1991 B.S., Computer Science, UNIVERSITY OF MIAMI, May 1988 ACADEMIC EXPERIENCE Professor, UNIVERSITY OF MASSACHUSETTS AMHERST, 2014–present Visiting Researcher, UNIVERSITY OF WASHINGTON, 2018–9 Visiting Researcher, MICROSOFT RESEARCH, 2005, 2006, 2011, 2013, 2015, 2016, 2018–9 Associate Professor, UNIVERSITY OF MASSACHUSETTS AMHERST, 2008–2014 Associate Researcher, BARCELONA SUPERCOMPUTING CENTER, 2010–2013 Visiting Professor, UNIVERSITAT POLITÈCNICA DE CATALUNYA, 2008–2009 Assistant Professor, UNIVERSITY OF MASSACHUSETTS AMHERST, 2002–2008 Research Intern, MICROSOFT RESEARCH, Summer 2000 & 2001 Graduate Research Assistant, UNIVERSITY OF TEXAS AT AUSTIN, 1997–2002 PROFESSIONAL EXPERIENCE Systems Analyst, UNIVERSITY OF TEXAS AT AUSTIN, 1995–2000 Teacher, BENJAMIN FRANKLIN INTERNATIONAL SCHOOL, Barcelona, Spain, 1992–1994 Systems Analyst, APPLIED RESEARCH LABORATORIES: UT-AUSTIN, 1990–1992 Instructor, THE PRINCETON REVIEW, Austin, Texas, 1989–1990 Teaching Assistant, UNIVERSITY OF TEXAS AT AUSTIN, 1989–1990
    [Show full text]
  • Smart Execution of Distributed Application by Balancing Resources in Mobile Devices
    ALMA MATER STUDIORUM - UNIVERSITÀ DI BOLOGNA SCUOLA DI INGEGNERIA E ARCHITETTURA DISI INGEGNERIA INFORMATICA TESI DI LAUREA in Reti di Calcolatori M Smart execution of distributed application by balancing resources in mobile devices and cloud-based avatars CANDIDATO: RELATORE: Giacomo Gezzi Chiar.mo Prof. Ing. Antonio Corradi CORRELATORE: Chiar.mo Prof. Cristian Borcea Anno Accademico 2014/2015 Sessione III 2 Abstract L’obiettivo del progetto di tesi svolto e` quello di realizzare un servizio di livello middleware dedicato ai dispositivi mobili che sia in grado di fornire il supporto per l’offloading di codice verso una infrastruttura cloud. In particolare il progetto si concentra sulla migrazione di codice verso macchine virtuali dedicate al singolo utente. Il sistema operativo delle VMs e` lo stesso utilizzato dal device mobile. Come i precedenti lavori sul computation offloading, il progetto di tesi deve garantire migliori per- formance in termini di tempo di esecuzione e utilizzo della batteria del dispositivo. In particolare l’obiettivo piu` ampio e` quello di adattare il principio di computation offloading a un contesto di sistemi distribuiti mobili, miglio- rando non solo le performance del singolo device, ma l’esecuzione stessa dell’applicazione distribuita. Questo viene fatto tramite una gestione di- namica delle decisioni di offloading basata, non solo, sullo stato del de- vice, ma anche sulla volonta` e/o sullo stato degli altri utenti appartenenti allo stesso gruppo. Per esempio, un primo utente potrebbe influenzare le decisioni degli altri membri del gruppo specificando una determinata richiesta, come alta qualita` delle informazioni, risposta rapida o basata su altre informazioni di alto livello.
    [Show full text]
  • Andrew W. Appel, Curriculum Vitae
    Case 1:17-cv-02989-AT Document 855-3 *SEALED* Filed 09/01/20 Page 1 of 56 IN THE UNITED STATES DISTRICT COURT FOR THE NORTHERN DISTRICT OF GEORGIA ATLANTA DIVISION DONNA CURLING, ET AL., Plaintiffs, v. Civil Action No. 1:17-CV-2989-AT BRAD RAFFENSPERGER, ET AL., Defendants. DECLARATION OF ANDREW W. APPEL IN SUPPORT OF MOTION FOR PRELIMINARY INJUNCTION ANDREW W. APPEL, declares, under penalty of perjury, pursuant to 28 U.S.C. § 1746, that the following is true and correct: 1. My name is Andrew W. Appel. 2. I am the Eugene Higgins Professor of Computer Science at Princeton University, where I have been on the faculty since 1986 and served as Department Chair from 2009-2015. I have also served as Director of Undergraduate Studies, Director of Graduate Studies, and Associate Chair in that department. I have served as Editor in Chief of ACM Transactions on Programming Languages and Systems, the leading journal in my field. In 1998 I was elected a Fellow of the 1 ny-1984930 v3 Case 1:17-cv-02989-AT Document 855-3 *SEALED* Filed 09/01/20 Page 2 of 56 Association for Computing Machinery, the leading scientific and professional society in Computer Science. 3. I previously provided a Declaration in support of the Curling Plaintiffs’ Reply in Support of their Motion for Preliminary Injunction on December 13, 2019 (Dkt. No. 681-3). My 2019 Declaration is attached as Exhibit A. I have reviewed my 2019 Declaration and my previous findings and analyses remain the same; accordingly, I incorporate by reference my prior Declaration in its entirety, subject to the additional opinions I offer here.
    [Show full text]
  • The Command Dispatcher Pattern Benoit Dupire and Eduardo B Fernandez {[email protected], [email protected]}
    The Command Dispatcher Pattern Benoit Dupire and Eduardo B Fernandez {[email protected], [email protected]} Department of Computer Science and Engineering. Florida Atlantic University Boca Raton, FL 33431 Can also be called: Command Evaluator Pattern. Intent This pattern increases the flexibility of applications by enabling their services to be changed, by adding, replacing or removing any command handlers at any point in time without having to modify, recompile or statically relink the application. By simulating the command-evaluation feature common in interpreted languages, this pattern supports the need for continual, incremental evolution of applications. Example Autonomous Underwater Vehicles (AUVs) are small, unmanned, untethered submersibles. There are numerous applications for AUVs, such as oceanographic surveys, operations in hazardous environments, underwater structure inspection and military operations. We implement the high level controller of this AUV as a Hierarchical Finite State Machine (Figure 1). A state of the Finite State Machine (FSM) represents a mode of the system, in which some tasks have to be executed, as described in the mission plan. The system takes transitions based on the results of these actions and the progression of the AUV. The system is programmed with high-level commands of the style "set depth 3" state1 state2 action 1.1 action 2.1 Figure 1: Simplified Finite State Machine for the AUV. The FSM must be able to fire any type of actions, without knowing anything about them. This problem is addressed by the Command Pattern [GOF95], which encapsulates an action as an object, thereby letting you parameterize clients with different actions.
    [Show full text]
  • Design Case Study: Java Swing
    Principles of Software Construction: Objects, Design, and Concurrency Part 2: Design case studies Design case study: Java Swing Charlie Garrod Chris Timperley 17-214 1 Administrivia • Reading due today: UML and Patterns 26.1 and 26.4 • Homework 4b due Thursday, October 17th https://commons.wikimedia.org/wiki/File:1_carcassonne_aerial_2016.jpg 17-214 2 Key concepts from Thursday • Observer design pattern • Introduction to concurrency – Not enough synchronization: safety failure – Too much synchronization: liveness failure • Event-based programming • Introduction to GUIs 17-214 3 GUI programming is inherently multi-threaded • Swing event dispatch thread (EDT) handles all GUI events – Mouse events, keyboard events, timer events, etc. • No other time-consuming activity allowed on the EDT – Violating this rule can cause liveness failures 17-214 4 Swing has many event listener interfaces • ActionListener • MouseListener • AdjustmentListener • TreeExpansionListener • FocusListener • TextListener • ItemListener • WindowListener • KeyListener • … class ActionEvent { int when; String actionCommand; int modifiers; Object source(); int id; … interface ActionListener { } void actionPerformed(ActionEvent e); } 17-214 5 Aside: lambdas vs. explicit class declarations? //static public void main… JFrame window = … JPanel panel = new JPanel(); window.setContentPane(panel); panel to hold the button JButton button = new JButton(“Click me”); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println(“Button
    [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]
  • Design Patterns in PHP and Laravel — Kelt Dockins Design Patterns in PHP and Laravel
    Design Patterns in PHP and Laravel — Kelt Dockins Design Patterns in PHP and Laravel Kelt Dockins [email protected] Design Patterns in PHP and Laravel Kelt Dockins Dolph, Arkansas USA ISBN-13 (pbk): 978-1-4842-2450-2 ISBN-13 (electronic): 978-1-4842-2451-9 DOI 10.1007/978-1-4842-2451-9 Library of Congress Control Number: 2016961807 Copyright © 2017 by Kelt Dockins This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made.
    [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]
  • Lecture 1 for Chapter 8, Object Design: Reusing Pattern Solutions
    Object-Oriented Software Engineering Using UML, Patterns, and Java Chapter 8, Object Design: 8, Object Chapter Reuse and Patterns I and Patterns Reuse Object Design Object design is the process of adding details to the requirements analysis and making implementation decisions The object designer must choose among different ways to implement the analysis model with the goal to minimize execution time, memory and other measures of cost Requirements Analysis: Use cases, functional and dynamic model deliver operations for object model Object Design: Iterates on the models, in particular the object model and refine the models Object Design serves as the basis of implementation System Development as a Set of Activities System Problem Application objects Analysis Solution objects Design Custom objects - Object Design Off-the-Shelf Components - System Design Existing Machine Examples of Object Design Activities Identification of existing components Full definition of associations Full definition of classes (System Design => Service, Object Design => Subsystem interfaces/API) Choosing algorithms and data structures Identifying possibilities of reuse Detection of solution-domain classes Optimization Increase of inheritance Decision on control …… A More Detailed View of Object Design Activities Select Subsystem Specification Reuse Identifying missing Identifying components attributes & operations Specifying visibility Adjusting components Specifying types & signatures Identifying patterns Specifying constraints Specifying exceptions
    [Show full text]