The Scalable Adapter Design Pattern: Enabling Interoperability Between Educational Software Tools

Total Page:16

File Type:pdf, Size:1020Kb

The Scalable Adapter Design Pattern: Enabling Interoperability Between Educational Software Tools The Scalable Adapter Design Pattern: Enabling Interoperability Between Educational Software Tools Andreas Harrer, Catholic University Eichstatt-Ingolstadt,¨ Germany, Niels Pinkwart, Clausthal University of Technology, Germany, Bruce M. McLaren, Carnegie Mellon University, Pittsburgh PA, U.S.A., and DFKI, Saarbrucken,¨ Germany, and Oliver Scheuer, DFKI, Saarbrucken,¨ Germany Abstract For many practical learning scenarios, the integrated use of more than one learning tool is educationally beneficial. In these cases, interoperability between learning tools - getting the pieces to talk to one another in a coherent, well-founded manner - is a crucial requirement that is often hard to achieve. This paper describes a re-usable software design that aims at the integration of independent learning tools into one collaborative learning scenario. We motivate the usefulness and expressiveness of combining several learning tools into one integrated learning experience. Based on this we sketch software design principles that integrate several existing components into a joint technical framework. The feasibility of the approach, which we name the “Scalable Adapter” design pattern, is shown with several implementation examples from different educational technology domains, including Intelligent Tutoring Systems and collaborative learning environments. IEEE keywords: J.m Computer applications, H.5.3 Group and Organization interfaces, K.3.m Computers in Education A short version of this paper appeared in the Proceedings of the Conference on Intelligent Tutoring Systems 2008 1 The Scalable Adapter Design Pattern: Enabling Interoperability Between Educational Software Tools1 I. INTRODUCTION hypothesis and plans. In order to help the student or student In the field of educational technology, there have been groups during the different steps of this inquiry procedure, it numerous attempts in recent years to connect differently makes sense to enable them to have hypotheses, experimenta- targeted learning environments to one another. The desire to tion data, and reflections at hand to generate reports or essays, do so is understandable – a variety of “micro level” tools i.e., the availability of the outputs of experiment phases as a that teach students specific skills – e.g., Intelligent Tutoring learning resource in different phases is highly desirable for Systems (ITSs) that help a student solve algebra equations rich learning scenarios. (e.g., [1]) or collaborative technology that helps students learn Such a smooth flow of learning phases, called “educational to solve problems in a cooperative manner (e.g., [2]) – have interoperability” by Jansen et al. [4], can only be achieved been developed and shown to be successful in targeted edu- if the underlying technology allows for an exchange of ed- cational scenarios. Yet, the support of longer-term educational ucational data objects between differently-targeted systems. learning goals, relevant to everyday teaching practice, requires However, this kind of interoperability is not readily available in educational technologists to think more broadly, beyond the today’s learning environments. Why is this so? A short answer use of a single tool. is that achieving this kind of interoperability is difficult since For example, a realistic educational scenario is that a teacher many of the highly effective learning environments are not may want to start his course with individual student sessions designed with interoperability in mind as a primary design with an ITS, followed by plenum discussions about the topic concern. Almost a decade ago, challenges for making educa- (face to face or via a web-forum), then some small-group work tional systems more interoperable through good computational with simulation tools like Netlogo 3 , and finally followed by design were identified [5], [6]. The vision of “educational individual sessions in which students write essays about their software components” that can be connected as easy as copy work. For each of these sessions, there is likely to be a different & paste, expressed in these papers, led to the idea that design tool which is suitable to support the activity, such as Cognitive patterns and programming conventions should be used to Tutors, discussion support tools, and educational simulation attract developers to re-use systems, and to facilitate this re-use tools, yet these individual tools do not usually interoperate or on the code level [5]. Other attempts to achieve such inter- exchange data, resulting in scattered artifacts that are hard to operability between educational technology components, but integrate with one another. focused primarily on making Cognitive Tutors interoperable Another use case where interoperability between heteroge- with other components, were [7], [8]. neous educational tools is an essential requirement is moni- Especially in the field of collaborative learning, tool inter- toring and assessement. If students use single, isolated tools operability and data exchange between heterogeneous learning in different learning phases (such as described above), this environments is a crucial requirement. This is so because may well be helpful for their learning processes. Yet, in a the data flows in group learning tend to be more complex classroom context, it is also important to inform teachers and require a data exchange between a greater variety of about the progress of their students. Provided that educational tools (such as discussion and graphical mapping tools) and technology systems are able to exchange data, this can be more instances of such tools (e.g., one per student) than automated by sending data to monitoring and reporting tools in individual learning scenarios. Many collaborative software for teachers (and researchers), resulting in a unified view and tools need to externalize their data anyhow to allow users representation of student activities. to exchange data with peers (i.e., they transfer this data The interaction between tools and the exchange of data between applications anyway). This fact should facilitate inter- between them makes a lot of sense also in scientific inquiry tool data exchange – yet, practice shows that in the field of learning scenarios [3] where several phases of activities are educational technology, not many collaborative learning tools usually required to allow the students to gain scientific insight are interoperable. Recent initiatives towards interoperability into the phenomenon under investigation. The preparation and for collaborative tools include the CIEL (Collaborative Inquiry planning of the research typically requires different tools than and Experiential Learning) project and the SAIL (Scalable the experimentation (in real or in a computer-simulation); the Architecture for Interactive Learning) architecture. In CIEL, same holds for the documentation and experiment reflection the conceptual integration of collaborative inquiry scenarios and potentially for the definition and refinement of the initial was implemented by means of a technical broker architecture [9] and standardized data formats for the exchange between 3http://ccl.northwestern.edu/netlogo/ different learning tools. The SAIL approach [10] provides 2 a technical framework that can be used to realize learning pattern solves the problem. In the tradition of design pattern scenarios based on different learning tools, including the well- descriptions, these sections (solution and structure) are kept known WISE (Web-based Inquiry Science Environment) tools on an abstract, re-usable level and in a format that describes [11] that have been refactored into SAIL components. the arrangement of elements (code classes and objects) that A key focus of our research and development during the past solve the problem. Finally, we illustrate other known software few years has been the investigation of collaborative modeling design patterns that are closely related to the Scalable Adapter. tools as learning environments. In this line of work, we have Problem context: There are existing learning environments frequently encountered the need to make our tools – such as (such as discussion tools, simulation tools, or ITS systems) Cool Modes [2] or FreeStyler [12] – interoperable with other that each provide specific functionality and data. Parts of tools, either to investigate new research ideas, to implement this data can be used to enrich one anothers’ features within the research results in school practice, or to implement longer- an integrated learning scenario. The individual tools offer term learning flows. Usually, the requirements included that some kind of API that provides access to their their data (1) the usage of the individual tools in their original contexts (e.g., through a publish-subscribe-like mechanism, via network should not be affected, (2) the solution has to be inexpensive to messages, or based on files). If such an API does not exist for implement, and (3) the approach to establish interoperability the individual tools, then it typically can be added without a should be applicable to a wide range of tools. large effort: for collaborative systems, a communication API A recurring approach we have adopted based on these to exchange data with other tools exists anyway. For non- main objectives is to employ a generic data storage and collaborative systems which store their application data at exchange mechanism for data, and use this to achieve seamless a central place (e.g., the database), the API can usually be communication at a customizable
Recommended publications
  • APPLYING MODEL-VIEW-CONTROLLER (MVC) in DESIGN and DEVELOPMENT of INFORMATION SYSTEMS an Example of Smart Assistive Script Breakdown in an E-Business Application
    APPLYING MODEL-VIEW-CONTROLLER (MVC) IN DESIGN AND DEVELOPMENT OF INFORMATION SYSTEMS An Example of Smart Assistive Script Breakdown in an e-Business Application Andreas Holzinger, Karl Heinz Struggl Institute of Information Systems and Computer Media (IICM), TU Graz, Graz, Austria Matjaž Debevc Faculty of Electrical Engineering and Computer Science, University of Maribor, Maribor, Slovenia Keywords: Information Systems, Software Design Patterns, Model-view-controller (MVC), Script Breakdown, Film Production. Abstract: Information systems are supporting professionals in all areas of e-Business. In this paper we concentrate on our experiences in the design and development of information systems for the use in film production processes. Professionals working in this area are neither computer experts, nor interested in spending much time for information systems. Consequently, to provide a useful, useable and enjoyable application the system must be extremely suited to the requirements and demands of those professionals. One of the most important tasks at the beginning of a film production is to break down the movie script into its elements and aspects, and create a solid estimate of production costs based on the resulting breakdown data. Several film production software applications provide interfaces to support this task. However, most attempts suffer from numerous usability deficiencies. As a result, many film producers still use script printouts and textmarkers to highlight script elements, and transfer the data manually into their film management software. This paper presents a novel approach for unobtrusive and efficient script breakdown using a new way of breaking down text into its relevant elements. We demonstrate how the implementation of this interface benefits from employing the Model-View-Controller (MVC) as underlying software design paradigm in terms of both software development confidence and user satisfaction.
    [Show full text]
  • A Mathematical Approach to Object Oriented Design Patterns
    06.2006 J.Natn.Sci.FoundationObject oriented design Sripatterns Lanka 2008 36 (3):219-227 219 RESEARCH ARTICLE A mathematical approach to object oriented design patterns Saluka R. Kodituwakku1*and Peter Bertok2 1 Department of Statistics and Computer Science, Faculty of Science, University of Peradeniya, Peradeniya. 2 Department of Computer Science, RMIT University, Melbourne, Australia. Revised: 27 May 2008 ; Accepted: 18 July 2008 Abstract: Although design patterns are reusable design the distribution of responsibilities. For ease of learning elements, existing pattern descriptions focus on specific and reference, in1, design patterns are organized into a solutions that are not easily reusable in new designs. This paper catalogue. introduces a new pattern description method for object oriented design patterns. The description method aims at providing a The catalogue is formed by two criteria: purpose more general description of patterns so that patterns can be and scope. According to their purpose, design patterns readily reusable. This method also helps a programmer to are classified into creational, structural and behavioural, analyze, compare patterns, and detect patterns from existing software programmes. whereas the scope divides patterns into class patterns and object patterns. Class patterns capture relationships This method differs from the existing pattern description between classes and their subclasses; object patterns deal methods in that it captures both static and dynamic properties with relationships between objects. of patterns. It describes them in terms of mathematical entities rather than natural language narratives, incomplete graphical Software patterns provide reusable solutions to notations or programme fragments. It also helps users to recurring design problems. Even if we have reusable understand the patterns and relationships between them; and solutions they may not be effectively reused, because select appropriate patterns to the problem at hand.
    [Show full text]
  • The Role of Model-View Controller in Object Oriented Software Development
    Nepal Journal of Multidisciplinary Research (NJMR) ISSN: 2645-8470 Vol 2, No. 2 June 2019 The Role of Model-View Controller in Object Oriented Software Development Ram Naresh Thakur1 and U S Pandey2 1PhD Scholar, Mewar University, Chittorgarh, Rajasthan, India 2Professor, University of Delhi, India. Corresponding Author Ram Naresh Thakur Email: [email protected] Abstract Object Oriented Software Development (OOSD) is a design technique that is used before the development and design of a software. This design method makes the system appears as a collection of objects to communicate with other objects by passing messages. The Model-View- Controller (MVC) has been inherited from Object-Oriented Programming (OOP) with the integration of Graphical User Interface (GUI) and interactive program execution. The MVC is very useful for developing Interactive and Dynamic Web Applications and iOS. With MVC, developers can trust on design patterns that are widely accepted as solutions for recurring problems. MVC can be used to develop flexible, reusable and modular Software. Applying the MVC design pattern in object-oriented Software development a flexible, reliable, modular and scalable website can be built. So, it’s necessary for every developer to have the knowledge of software development using MVC design pattern. Keywords: OOSD, MVC, OOP, GUI, Dynamic, Web Application, iOS, Design Pattern. 1 Introduction In today’s era, it is very essential to develop and design a working software in an effective and efficient manner. As we know that Object Oriented software development is a designing technique that is used before the development and design of a software. Through this method the system appears as a collection of objects which communicate with other objects by passing messages.
    [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 Study Focused on Web Application Development Using MVC Design Pattern
    International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 06 Issue: 08 | Aug 2019 www.irjet.net p-ISSN: 2395-0072 A Study Focused on Web Application Development using MVC Design Pattern Ram Naresh Thakur1, Dr. U.S. Pandey2 1Research Scholar, Mewar University, Rajasthan, India 2Professor, University of Delhi ---------------------------------------------------------------------***---------------------------------------------------------------------- Abstract - The Model-View-Controller (MVC) is very useful for developing Interactive and Dynamic Web Applications. It has become the most powerful and dominant Programming Paradigm for developing large scale and Dynamic Web Applications. With MVC, developers can trust on design patterns that are widely accepted as solutions for recurring problems and used to develop flexible, reusable and modular Software. Applying the MVC design pattern to Web Applications is therefore complicated by the fact that current technologies encourage developers to partition the application as early as in the design phase. In this work we have developed a web-based application using MVC framework using Java Web Architecture. Key Words: MVC, Dynamic, Web Application, Programming Paradigm, Developers, Design Phase, Java Web Architecture. 1. INTRODUCTION 1.1 Web Application A Web Application is a distributed application that runs on more than one Computer and communicates through a Network or a Server. Specifically, a Web Application is accessed with a Web Browser as a client and provides the facility to update and manage a program without deploying and installing Application on client Computers. Web Applications are used for Email, Online Retail Purchase/Sales, Online Banking, among others. The advantage of Web Application is that can be access and used by millions of people at the same time [1].
    [Show full text]
  • From Sequential to Parallel Programming with Patterns
    From sequential to parallel programming with patterns Inverted CERN School of Computing 2018 Plácido Fernández [email protected] 07 Mar 2018 Table of Contents Introduction Sequential vs Parallel patterns Patterns Data parallel vs streaming patterns Control patterns (sequential and parallel Streaming parallel patterns Composing parallel patterns Using the patterns Real world use case GrPPI with NUMA Conclusions Acknowledgements and references 07 Mar 2018 3 Table of Contents Introduction Sequential vs Parallel patterns Patterns Data parallel vs streaming patterns Control patterns (sequential and parallel Streaming parallel patterns Composing parallel patterns Using the patterns Real world use case GrPPI with NUMA Conclusions Acknowledgements and references 07 Mar 2018 4 Source: Herb Sutter in Dr. Dobb’s Journal Parallel hardware history I Before ~2005, processor manufacturers increased clock speed. I Then we hit the power and memory wall, which limits the frequency at which processors can run (without melting). I Manufacturers response was to continue improving their chips performance by adding more parallelism. To fully exploit modern processors capabilities, programmers need to put effort into the source code. 07 Mar 2018 6 Parallel Hardware Processors are naturally parallel: Programmers have plenty of options: I Caches I Multi-threading I Different processing units (floating I SIMD / Vectorization (Single point, arithmetic logic...) Instruction Multiple Data) I Integrated GPU I Heterogeneous hardware 07 Mar 2018 7 Source: top500.org Source: Intel Source: CERN Parallel hardware Xeon Xeon 5100 Xeon 5500 Sandy Bridge Haswell Broadwell Skylake Year 2005 2006 2009 2012 2015 2016 2017 Cores 1 2 4 8 18 24 28 Threads 2 2 8 16 36 48 56 SIMD Width 128 128 128 256 256 256 512 Figure: Intel Xeon processors evolution 0Source: ark.intel.com 07 Mar 2018 11 Parallel considerations When designing parallel algorithms where are interested in speedup.
    [Show full text]
  • A Pattern Language for Designing Application-Level Communication Protocols and the Improvement of Computer Science Education Through Cloud Computing
    Utah State University DigitalCommons@USU All Graduate Theses and Dissertations Graduate Studies 5-2017 A Pattern Language for Designing Application-Level Communication Protocols and the Improvement of Computer Science Education through Cloud Computing Jorge Edison Lascano Utah State University Follow this and additional works at: https://digitalcommons.usu.edu/etd Part of the Computer Sciences Commons Recommended Citation Lascano, Jorge Edison, "A Pattern Language for Designing Application-Level Communication Protocols and the Improvement of Computer Science Education through Cloud Computing" (2017). All Graduate Theses and Dissertations. 6547. https://digitalcommons.usu.edu/etd/6547 This Dissertation is brought to you for free and open access by the Graduate Studies at DigitalCommons@USU. It has been accepted for inclusion in All Graduate Theses and Dissertations by an authorized administrator of DigitalCommons@USU. For more information, please contact [email protected]. A PATTERN LANGUAGE FOR DESIGNING APPLICATION-LEVEL COMMUNICATION PROTOCOLS AND THE IMPROVEMENT OF COMPUTER SCIENCE EDUCATION THROUGH CLOUD COMPUTING by Jorge Edison Lascano A dissertation submitted in partial fulfillment of the requirements for the degree of DOCTOR OF PHILOSOPHY in Computer Science Approved: ______________________ ____________________ Stephen W. Clyde, Ph.D. Curtis Dyreson, Ph.D. Major Professor Committee Member ______________________ ____________________ Haitao Wang, Ph.D. Young-Woo Kwon, Ph.D. Committee Member Committee Member ______________________ ____________________ Luis Gordillo, Ph.D. Mark R. McLellan, Ph.D. Committee Member Vice President for Research and Dean of the School of Graduate Studies UTAH STATE UNIVERSITY Logan, Utah 2017 ii Copyright © Jorge Edison Lascano 2017 All Rights Reserved iii ABSTRACT A Pattern Language for Designing Application-Level Communication Protocols and the Improvement of Computer Science Education through Cloud Computing by Jorge Edison Lascano, Doctor of Philosophy Utah State University, 2017 Major Professor: Stephen W.
    [Show full text]
  • A Design Pattern Generation Tool
    Project Number: GFP 0801 A DESIGN PATTERN GEN ERATION TOOL A MAJOR QUALIFYING P ROJECT REPORT SUBMITTED TO THE FAC ULTY OF WORCESTER POLYTECHNIC INSTITUTE IN PARTIAL FULFILLME NT OF THE REQUIREMEN TS FOR THE DEGREE OF BACHELOR O F SCIENCE BY CAITLIN VANDYKE APRIL 23, 2009 APPROVED: PROFESSOR GARY POLLICE, ADVISOR 1 ABSTRACT This project determines the feasibility of a tool that, given code, can convert it into equivalent code (e.g. code that performs the same task) in the form of a specified design pattern. The goal is to produce an Eclipse plugin that performs this task with minimal input, such as special tags.. The final edition of this plugin will be released to the Eclipse community. ACKNOWLEGEMENTS This project was completed by Caitlin Vandyke with gratitude to Gary Pollice for his advice and assistance, as well as reference materials and troubleshooting. 2 TABLE OF CONTENTS Abstract ....................................................................................................................................................................................... 2 Acknowlegements ................................................................................................................................................................... 2 Table of Contents ..................................................................................................................................................................... 3 Table of Illustrations .............................................................................................................................................................
    [Show full text]
  • Additional Design Pattern Examples Design Patterns--Factory Method
    Additional Design Pattern Examples • Creational – Factory method – Abstract factory • Structural – Decorator – Adapter • Behavioral – Observer Design Patterns--Factory Method • Intent--Permit a class to be reuseable with arbitrary data types. Specifically, allow the class to be independent of the classes it instantiates – Define an interface for object creation. – Let subclasses decide which class to instantiate. • Motivation – Useful for development of frameworks 1 Factory Method--Continued • Consider a document-processing framework – High-level support for creating, opening, saving documents – Consistent method calls for these commands, regardless of document type (word-processor, spreadsheet, etc.) – Logic to implement these commands delegated to specific types of document objects. – May be some operations common to all document types. Factory Method--Continued Document Processing Example-General Framework: Document Application getTitle( ) * Edits 1 newDocument( ) newDocument( ) openDocument( ) openDocument( ) ... ... MyDocument Problem: How can an Application object newDocument( ) create instances of specific document classes openDocument( ) without being application-specific itself. ... 2 Factory Method--Continued Use of a document creation “factory”: Document Application getTitle( ) * Edits 1 newDocument( ) newDocument( ) openDocument( ) openDocument( ) ... ... 1 requestor * Requests-creation creator 1 <<interface>> MyDocument DocumentFactoryIF newDocument( ) createDocument(type:String):Document openDocument( ) ... DocumentFactory
    [Show full text]
  • Application Design Patterns Catalogue
    Design Patterns Catalogue AUTOSAR Release 4.2.2 Document Title Design Patterns Catalogue Document Owner AUTOSAR Document Responsibility AUTOSAR Document Identification No 672 Document Classification Auxiliary Document Status Final Part of AUTOSAR Release 4.2.2 Document Change History Release Changed by Description • reconsideration of signal definitions and tailored AUTOSAR pattern for smart actuators and actuators with no 4.2.2 Release feedback loop Management • specification items added • minor changes • First Release of document. Patterns covered: AUTOSAR – Sensor and Actuator Pattern 4.2.1 Release – Arbitration of Several Set-point Requester Management Pattern • Previously published as part of EXP_AIPowertrain 1 of 46 Document ID 672: AUTOSAR_TR_AIDesignPatternsCatalogue — AUTOSAR CONFIDENTIAL — Design Patterns Catalogue AUTOSAR Release 4.2.2 Disclaimer This specification and the material contained in it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the companies that have contributed to it shall not be liable for any use of the specification. The material contained in this specification is protected by copyright and other types of Intellectual Property Rights. The commercial exploitation of the material contained in this specification requires a license to such Intellectual Property Rights. This specification may be utilized or reproduced without any modification, in any form or by any means, for informational purposes only. For any other purpose, no part of the specification may be utilized or reproduced, in any form or by any means, without permission in writing from the publisher. The AUTOSAR specifications have been developed for automotive applications only. They have neither been developed, nor tested for non-automotive applications.
    [Show full text]
  • Design Patterns Adapter Pattern
    DDEESSIIGGNN PPAATTTTEERRNNSS -- AADDAAPPTTEERR PPAATTTTEERRNN http://www.tutorialspoint.com/design_pattern/adapter_pattern.htm Copyright © tutorialspoint.com Adapter pattern works as a bridge between two incompatible interfaces. This type of design pattern comes under structural pattern as this pattern combines the capability of two independent interfaces. This pattern involves a single class which is responsible to join functionalities of independent or incompatible interfaces. A real life example could be a case of card reader which acts as an adapter between memory card and a laptop. You plugin the memory card into card reader and card reader into the laptop so that memory card can be read via laptop. We are demonstrating use of Adapter pattern via following example in which an audio player device can play mp3 files only and wants to use an advanced audio player capable of playing vlc and mp4 files. Implementation We have a MediaPlayer interface and a concrete class AudioPlayer implementing the MediaPlayer interface. AudioPlayer can play mp3 format audio files by default. We are having another interface AdvancedMediaPlayer and concrete classes implementing the AdvancedMediaPlayer interface. These classes can play vlc and mp4 format files. We want to make AudioPlayer to play other formats as well. To attain this, we have created an adapter class MediaAdapter which implements the MediaPlayer interface and uses AdvancedMediaPlayer objects to play the required format. AudioPlayer uses the adapter class MediaAdapter passing it the desired audio type without knowing the actual class which can play the desired format. AdapterPatternDemo, our demo class will use AudioPlayer class to play various formats. Step 1 Create interfaces for Media Player and Advanced Media Player.
    [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]