A Survey of Three Approaches to the Automation of Design Patterns

Size: px
Start display at page:

Download "A Survey of Three Approaches to the Automation of Design Patterns"

Transcription

1 A Survey of Three Approaches to the Automation of Design Patterns Paul Pop Computer and Information Science Dept. Linköpings universitet Abstract Design patterns are a popular object-oriented technique used to describe common design problems, their context and their solutions. Although design patterns have proved very successful at organizing and building large systems, there are still problems associated with them. One of the main problems is that their informal, textual description is not suitable for tool support, and thus patterns have to be applied manually, which is time consuming and error prone. This paper surveys three approaches to the automation of design patterns that aim at simplifying the application of patterns through tool support. The methods are evaluated based on a set of requirements that measure how useful each approach is in supporting the application of patterns for large object-oriented systems. 1. Introduction Previous papers in this collection have provided a solid introduction to the object-oriented software development field in general, and to design patterns in particular. Several definitions have been proposed for design patterns (TODO: add here references to other papers in this compendium). Loosely speaking, a design pattern is a solution to a problem in a context. Patterns are expressed textually, in an informal manner, their description consisting of a name, a problem and its associated context, a discussion and a solution. The message so far has been that design patterns are a very promising approach of building and organizing large systems. Over the years, however, several weaknesses of design patterns have been identified. Some of the problems, together with the proposed solutions, are described in the papers of this compendium (TODO: add here references to other papers in this compendium, maybe detail the problems). A major problem, on which we will concentrate in this paper, is the lack of a systematic way to apply design patterns. The problem derives from the informal, textual description of design patterns, which is not suitable for tool support, and thus patterns have to be applied manually, which is time consuming and error prone (the lack of automation problem). According to (Schultz et al., 1998), there are two ways in which design patterns can be viewed: either as building blocks, as in (Buschmann, 1996), or as operators. The difference is that when viewed as building blocks, the design patterns focus on describing the target structure, which results after design patterns are applied. This is useful when new systems are constructed, but it makes difficult the process of modifying existing systems. On the other hand, if design patterns are viewed as operators, then they are described as a series of steps, which have to be performed in order to modify the existing system according to the design pattern. Today, designers very seldom start from scratch when building new systems; more likely is that legacy systems and components have to be reused. In this paper we survey three approaches to the automation of design patterns that aim at simplifying the application of patterns through tool support. In the first approach Schultz et al. consider design patterns to be operators that are applied to transform an existing design into a target design. The application of the design patterns is divided into five steps: identification of the problem structure, checking of pre-conditions, parameterized transformation of the problem structure into the target structure, reorganization of context and check of post-conditions. The second approach (Tatsubori et al., 2000) provides language constructs similar to macros, which are used by the programmer to streamline the application of design patterns. The last two approaches, COMPOST (Assmann et al., DATE?) and Recoder (Ludwig et al., DATE?), are discussed together. COMPOST 1

2 views the application of design patterns as a software composition problem, where the exiting system is modified into a target system, according to the design pattern, using an invasive composition technique. Recoder, based on COMPOST, uses a refactoring approach to the systematic modification of software systems aimed at automatically introducing design patterns into an existing design. The refactorings are supported by detailed information about the source code, contained in a special database called the program metamodel. The methods presented are evaluated based on a set of requirements that measure how useful each approach is in supporting the application of patterns for large object-oriented systems. We use the requirements from Schultz et al. which have identified the following proprieties that must be fulfilled by a reorganization methodology in order to be practically applicable for large object-oriented software systems: Language independence: The methodology should not rely on a specific object-oriented programming language. Level of abstraction: The methodology should aim at the design level rather than the implementation level, since most of the problems of an object-oriented system which can be solved by reorganization (e.g., lack of flexibility) concern the design of that system. Behavior preservation: The goal of reorganization is not to change the functionality of a given system, but to improve the structure of that system in order to make functionality changes easier. Therefore, a reorganization operation should not change the system's behavior. The methodology must be proven to preserve behavior. Tool support: The methodology should allow for tool support, since reorganizing a large system by hand is error-prone and time-consuming. The paper is organized in 5 sections. The next two sections detail the problems associated with the application of design patterns using an example: section 2 introduces the adapter pattern, and in section 3 we show how is the adapter pattern applied manually to adapt a class Vector to an interface Stack. Section 4 starts with the aim of a design pattern automation methodology and presents existing (i.e., Together) tool support for the automation of design patterns. Then, the three approaches to the automation of design patterns are outlined, and the adapter pattern is used to exemplify the application of the methods. (TODO: Remove the next sentence if you don t want section 5) Section 5 tries to extrapolate from the existing tool support for design patterns proposing a method of pattern automation that extends beyond software engineering. The last section presents a discussion and our conclusions. 2. Pattern Example: The Adapter Pattern Figure 1. The Adapter Pattern InStack.java this section, the problems related to the applicationveofcto design r.javapatterns and the proposed solutions, are public discussed using an example of a design pattern. The example has be simple enough to facilitate VectorStack.java interface public class VectorStack public implements class Vector Stack the { discussion, and complex enough to be useful in underlining the problems. { { boolean private isempty(); Vector v; boolean isempty(); Enumeration VectorStack(Vector elements(); v) { this.v = v; Enumeration elements(); Object boolean peek(); isempty() { return v.isempty(); Object lastelement() {...; void push(object Enumeration o); elements() { return v.elements(); void a ddele me nt(obje ct o) {..; Object Object pop(); peek() { return v.lastelement();... 2 void push(object o) { return v.addelement( o ); Object pop() {...

3 Figure 3. The VectorStack class which implements the adapter pattern Thus, we have decided to use the adapter pattern (figure 1). The adapter pattern is used to convert the interface of a class into another interface the clients expect. The adapter lets classes work together that couldn t otherwise because of incompatible interfaces (Gamma et al., 94). Figure 1 shows a structure of the adapter pattern. Let us suppose that a programmer has to adapt a class Vector to an interface Stack, which are defined as in figure Manual Implementation of Design Patterns The adapter pattern in figure 1 adapts an adaptee class to a target interface. In our case, the class Vector and an interface Stack correspond to the adaptee and the target, respectively. In order to implement the design pattern, a class called VectorStack which corresponds to the adapter -- has to be written. The purpose of the VectorStack class is to extend the class Vector to have the interface Stack. This has to be done such that the VectorStack class is not a subclass of the class Vector, otherwise a single adapter cannot work with several adaptees. To do this, programmers have to manually write the class VectorStack which plays the role of the Adapter, they are faced with some problems, identified in (Tatsubori et al., 2000): 1. Although the class VectorStack is written for the Adapter of the Adapter pattern, it is difficult to find out this fact from the source code. Which design pattern is used? What is the role of the class VectorStack? 2. The programmers must add a field that holds a reference to a Vector object and a constructor to accept it. Although isempty() and elements() are shared between the class Vector and the class VectorStack programmers must repeatedly write code for both of them. 3. In the body of the method peek(), only the method lastelement() is invoked on the Vector object and the value obtained by this invocation is returned intactly. Such a trivial operation of object also appears in the method push(). Describing those operations is a boring task and error prone. These problems are common to most of the design patterns, and they are well documented in the research literature (Bosch et al., 1996). Bosch calls the problems 1, 2 and 3, traceability loss, self problem, and implementation overhead, respectively. 4. Approaches to the Automation of Design Patterns It becomes clear now that tool support is needed in order to address the problems a designer faces when implementing design patterns manually. Such a tools should solve or address the problems of design patterns mentioned in the previous section: traceability loss, self problem, and implementation overhead. Moreover, such a tool, that provides support for the automation of design patterns, should fulfill as much as possible of the requirements of an reorganization methodology set out in the introduction: language independence, high level of abstraction, behavior preservation. There are a number of tools on the market, aimed at providing tool support for design patterns, in one form or another. The tools range from simple static analysis of Java programs, like the Barat or Recoder tools, more complex refactoring tools like the XPTools, to full blown integrated development environments, that offer extensive automation support for design patterns, like the Together environment, from TogetherSoft. There are basically three abstraction levels at which a user can interact with these tools: the pattern level, the design level, and the code level. At the pattern level the tools help designers introduce patterns into existing systems, link patterns together, replace or remove patterns. One abstraction level lower, at the design level, the designer sees the system as a set of classes, with their methods and relationships like association, inheritance etc, while at the code level all the operations are done by manipulating the static source code of programs. For more examples the reader is directed to (Florijn, 1997), which provides a list of tools for the automation of design patterns, as well as good starting points for further exploration. One of the more mature tools that offer support for design patterns is the Together tool from TogetherSoft (Together, 2001), presented in figure 4. Basically, Together is an IDE which supports several programming languages like Java as well as C++, C#, and Visual Basic, and provides support for common software engineering tasks. In figure 4 the user is presented with the design level and the 3

4 source code level of a Java project opened in Together 5.5. As can be seen from figure 4, the designer has implemented an interface Stack and a Vector class. Let us see how Together supports the automatic introduction of the adapter pattern, used to adapt the Vector class to the Stack interface. Using Together, the designer can select the Object -> Choose Pattern command, which brings up a dialog box, presented in figure 5, that allows the selection of a design pattern to be applied. Among the patterns presented to the left of the dialog, the designer will choose the Adapter pattern filed in the GoF patterns folder, which contains the patterns from the Gang of Four book [xx]. The pattern is described in a text area to the bottom of the dialog. To the right, there is a list of properties that have to be set before the adapter pattern can be applied. First, the adaptee and target classes have to be identified. This is done by pointing in the design, at the classes that will fulfill this role. Other properties, like Copy documentation or Create pattern links can also be set. Once all the properties are set to the desired valued, the designer presses Finish which leads to the automatic application of the adapter pattern, that modifies the system presented in figure 4 to the system in figure 6. The application of the design pattern has created a new class, called Adapter, depicted in figure 6. This class is the equivalent of the VectorStack class written manually by the designer in section 3. The class implements a Stack interface, and the cosntructor isempty(), and elements() methods have been created automatically, thus reducing the manual implementation overhead. Figure 6 also shows the relationships between the Stack interface, Vector class and the newly created Adapter class. Together has to approaches to the automation of design patterns: pattern templates and the pattern API (application programming interface). The first approach expresses the pattern as a name-replacement template, using a simple ASCII file. The disadvantages of this approach are that no instance-specific customization is possible, and there is no completeness or consistency checking applied. These disadvantages are addressed by the second approach, the pattern API, which expresses the pattern in Java using a special API provided by TogetherSoft. 4

5 We will now present the pattern API approach to pattern automation used in the Together tool. The Figure 6. Pattern Automation using Together fist thing to be determined, before using the API provided to write the pattern, is to decide the level if language dependence. The pattern can be written for only a single language, like Java or C++, or it can be a generic pattern, which can be used with any language. Then, the type of pattern has to be decided, and based on this decision different classes in the pattern API will be used to derive the new pattern. The pattern type can be either a class, a link, or a member. After the pattern has been written using the provided API, the.class files resulted from the compilation of the Java code have to be placed in a special directory structure that holds all the patterns which can be applied to transform the system. The Together user inferace then interogates the patterns, which respond apropriately if they adhere to the TogetherSoft s standard pattern API. This interaction is done through the SciPattern interface, which has the following properties and members: SciPatternProperty.PATTERN_CATEGORY property Indicates the kind of object this pattern is applicable to. prepare() Checks if it is possible at all to apply this pattern to the target objects and makes some start-up preparations for the pattern. canapply() Checks whether the pattern can be applied to the target objects with the current values of pattern's properties. apply() Makes the pattern perform desired actions. PropertyMap properties set Defines the behavior of a pattern. 5

6 This method fulfils all the requirements for a reorganization methodology, put forward in the introduction. However, programmers have to be careful when using the pattern API not to change the behavior of the system. Next sections will present four research approaches to the automation of design patterns, which are later evaluated based on the four criteria: language independence, high level of abstraction, behavior preservation, and tool support. 4.2 Schultz et al. (Schultz et al., 1998) consider design patterns to be operators that transform an existing design into a target design. They provide a systematic approach in which the process of applying design patterns is divided into five steps (adapted from Schultz et al., 1998): 1. Identification of the problem structure: The software engineer identifies the part of the existing design that should be reorganized. In our example, the application of operator Bridge aims at decoupling the abstraction (super-class Set) from its implementations. The problem structure comprises the class Set and its descendants. 2. Check of pre-conditions: All pre-conditions must hold in order to apply the design pattern operator. In our example, the implementations HashSet and ListSet must provide the same interface as the abstraction Set in order to be interchangeable. 3. Parameterized transformation of the problem structure into the target structure: In this step the design pattern application itself is put into place. The process is divided into generic aspects (depending on the design pattern) and application specific aspects (parameters). The user parameterizes the process by choosing an appropriate variant of the design pattern. Additional parameters are for example the set of methods which will be delegated or the decision whether the class of the implementation object shall be interchangeable at run-time or not. 4. Reorganization of context: The transformation of the problem structure often causes a change to its interface. The clients of this interface affected by the change have to be reorganized in order to provide the same functionality as before. 5. Check of post-conditions: Post-conditions must hold after the design pattern has been applied. It is often hard to formalize post-conditions as they usually depend on semantics. Therefore they are often described informally. The transformations applied to change the design are described in terms of operations on a meta model that contains classes, methods, parameters and attributes, and are captured using a language with three types of constructs: transformation operations, e.g., applydelegation( < from >, < to >, < Params > ) parameterizations by the user, e.g., < InputVar >?: < VarType > [ < InitList > ] miscellaneous operations, e.g., conditions and labels Thus, the automation process becomes an algorithm described with the formalisms outlined above. Such a transformational approach enables the use of design patterns as reorganization operators in order to reorganize existing systems by identifying the problem structure and transforming it into an improved target structure. (Schultz et al., 1998) mention that while design pattern operators fulfill the first two requirements, (i.e., they are language independent and deal with design aspects) they fail to fulfill the last one (tool support). Not only is the underlying model too abstract to be implemented in a tool, but the pattern operators also lack proof of behavior preservation. To address this problem, (Zimmer, 1997) propose a formalization of the operators, as well as their pre-conditions and post-conditions with the aid of refactorings. This means, replacing the meta-model and the operator-language defined in (Zimmer, 1997) with the model and language defined in (Opdyke, 1992). In (Opdyke, 1992) an approach for the support of the evolution of object-oriented systems is presented. This is achieved through refactorings which are implementable as a tool and showed that the application of these refactorings does not change the system behavior, refactorings being low level operators that preserve the semantics. In (Opdyke, 1992) 26 low-level refactorings (like create empty class, add function argument, etc.) and 3 high-level refactorings (converting an inheritance relation into an aggregation, etc.) are presented. We can now show how this combination of methods from (Schultz et al., 1998) and (Opdyke, 1992) we can be applied in practice. Thus, figure 6 depicts the third step of the application of the design 6

7 pattern operator Bridge as performed by the new approach. The intent of a bridge pattern is to decouple an abstraction from its implementation so that the two can vary independently. The sequence of necessary transformation steps is different from the sequence in (Zimmer, 1997), since the new approach requires behavior preservation at every step. In step 3a a new, unreferenced class AbstractSet is introduced. AbstractSet is assigned to the same super-class (not shown in the figure) as Set in step 3b. Figure 6. Pattern Automation using Together The introduction of a component relationship between Set and AbtractSet, the copying of the interface of Set to AbstractSet and the delegation of all methods of AbstractSet to its component Set is depicted in step 3c. Step 3d contains the most crucial refactoring. First the constructor method of AbstractSet is changed to include one parameter determining the actual implementation (e.g., HashSet or ListSet) of the set. Then every construction of a set (subclass of Set) is changed to use the new constructor of AbstractSet and every variable definition using Set or one of its subclasses as a type is changed to AbstractSet. Finally in step 3e a new method changeimpl can be introduced in the class Set to determine the actual implementation class of the set. 4.3 Open Java Another approach to the automation of design patterns is through the use of reflection, advocated by (Tatsubori et al., 2000). Reflection is a software engineering technique for changing the behaviour of a program according to another program. Reflection can be used for weaving several components, or aspects, like algorithms, distribution, resource allocation, user interfaces, etc., into a single executable program. Reflection is present in a simple form in macro systems, which are systems that manipulate programs at compile time. Macro systems perform textual substitution such that a particular aspect of a program is separated from the rest of a program. In the example below, 7

8 #define MAX 100 int array[max]; the C/C++ macro system has been used to separate the definition of a constant value from the rest of the program. The C/C++ macro system is based on the #define constructs which perform a simple token based substitution. VectorStack.oj public class VectorStack instantiates AdapterPattern adapts Ve ctor to S tack { Object peek() forwards la s tele ment; void push(object o) forwards addelement; Object pop() {... Figure 8. The OpenJava Language Constructs There are, however, more complex macro systems. For example Common Lisp macros are programable macros which receive an abstract syntax tree (AST) and substitutes it for the original expression. Such an approach is powerful: the object system of Common Lisp is actually implemented with this macro system. The common feature of such macro systems is that they use ASTs for representing a source program. However, several drawbacks related to macro systems have been reported which make their use for design pattern automation very difficult if not impossible. (Tatsubori et al., 2000) mentions several drawbacks related to the AST representation for macros, the main problem being that ASTs are a purely textual representation of the program. This means that no type information is captured by the ASTs, type information which is crucial for enabling automated support for complex design patterns. (TODO: It would be nice to have an example for the previous idea) Thus, (Open Java) proposes a macro system, called OpenJava, which is a compile time reflective system for both behavioural and structural reflection. The main advantage from the more traditional macro systems presented before is that the OpenJava macros use class metaobjects for representing the logical entities of a program instead of simple token sequencies or ASTs. Class metaobjects are a sofisticated source code representation that capture the logical structure of a calss definition and manage the expansion of the related class. All class metaobjects are derived from the OJClass, which provide methods that have to be customized in order to describe the exact macro expansion mechanism, see figure 9. Let us now see how the OpenJava approach can be used for the adapter pattern example introduced in section 2. Thus, from the viewpoint of the Adapter pattern, programmers have only to define which method of the class Vector corresponds to each methods of the interface Stack. This is because the Adapter only maps methods of the Target to methods of the Adaptee. In an extended language supporting the Adapter pattern, programmers should be able to directly handle such forwardings. According (OpenJava) an implementation in that extended language should enable programmers to: 1. declare that the program uses the Adapter pattern; 2. declare an Adapter class, a Target class, and an Adaptee class; 3. specify mapping between methods of the Adapter class and methods of the Adaptee class. OpenJava uses the following constructs to fulfill the three points above: 1. A declaration instantiates P specififies that a design pattern P is used. 2. A declaration adapts A to T specifies that this class is an Adapter adapting the class A to the interface T. 3. A declaration at the end of a method signature forwards M specifies that the method forwards to the method M of the Adaptee. An Adapter class has methods corresponding to all the methods of the Adaptee class. Even if they are not explicitly defined, they are automatically inserted in the Adapter class. They forward to the 8

9 Adaptee s method with the same name and signature. These lanugage constructs simplify programs written according to the Adapter pattern. In OpenJava,the language extension shown above is implemented by a metaclass AdapterPattern, derived from OJClass. Once this metaclass is written, other programmers can benffit from the metaclass and thereby write programs involving extended language constructs. The source code of this metaclass given is figure 9. AdapterPatte rn.o j public class AdapterPattern extends OJClass { void init() { /* overrides for syntax extensions */ registerdeclarationsuffix( "adapts",.. ); registermethodsuffix( "forwards",.. ); /* overrides for translation */ void translate() throws MOPException { ParseTree sfx = this.getsuffix( "adapts" ); OJClass adaptee = OJClass.forName(..sfx.. ); OJClass target = OJClass.forName(..sfx.. );... /* adds a field to hold an Adaptee */ this.addfield(.."adaptee".. ); /* adds a constructor to accept an Adaptee */ this.addconstructor(.. ); /* adds an interface as a Target */ this.addinterface( target ); Figure 9. Adapter Pattern Implemented Using OpenJava s API According to this metaclass, the OpenJava system produces regular Java source code equivalent to the code in figure 3 from the code in figure COMPOST and Recoder In section 4.2 we have discussed the approach from (Schultz et al., 1998) which provides a systematic way of applying design patterns, based at its lowest level on refactorings. Another approach, besides refactoring, is to view the application of design patterns as software composition. Software composition aims at better reuse through information hiding, and standardized interfaces. One common aspect of software composition approaches was that they treated components as black boxes. However, recent approaches to software composition have opened up components, so that they can be merged during the composition, the result being an invasive software composition, see figure 10. The COMPOST system (Assmann, DATE?) combines the benefits of refactoring and componentbased engineering, offering a component based model that guarantees information hiding and type checking, and a set of transformations which can be applied to component interfaces for a more flexible composition. The application of design patterns can be viewed in this context as an invasive composition through which the existing classes are modified to cooperate with the design pattern (the component) introduced into the system. Such an approach, while elegant, might not be very intuitive for the designer which operates using design patterns. For a better support of incremental software development a new framework, called Recoder, has been built based on COMPOST. Recoder is a framework for static (source code) meta programming of Java program sources, which offers the following features: parsing and unparsing of Java sources, 9

10 name and type analysis for Java programs, transformation of Java sources, incremental analysis and transformation of Java sources. Thus, parsing and unparsing of Java sources could be used for constructing simple preprocessors, simple code generators, or source code beautification tools. Name and type analysis could be the basis for software visualization tools, software metrics, and design problem detection tools, while the transformation of Java sources could lead to preprocessors, semantic macros, aspect weavers, compilers, etc. The incremental analysis and transformation feature is the one that is the most suitable for design patterns, but also source code optimization, refactoring tools, etc. Compos er Invasively transformed code Figure 10. Invasive Composition using the COMPOST System The core of Recoder is a database that contains a model of the program, called program meta model, see figure 11a. The model contains semantic entities and relations as defined by the Java programming language, and well as other derived data inferenced from the language specification and source program. To be able to implement patterns, a designer has to write coresponding metaprograms using the Recoder API, see figure 11b. Such metaprograms query the model and the inferencer services. They change only the abstract syntax of the model, and have to report their changes to a change history object, which makes rollback possible. TypeDeclarationMutableList list = u.getdeclarations(); if (lis t == null) { list = new TypeDeclarationArrayList(); u.setdeclarations(list); lis t.add(d); a) b) Figure 11. a) Recoder s Program Model Database b) Using Recoder API 10

11 5. Conclusions While design patterns are a popular object-oriented technique used to describe common design problems, their context and their solutions, we have shown that one of the main problems is that their informal, textual description is not suitable for tool support. Thus, patterns have to be applied manually, which is time consuming and error prone. This paper has presented three approaches to the automation of design patterns: Schults et al, OpenJava and COMPOST/Recoder. In the first approach Zimmer et al. considers design patterns to be operators that are applied to transform an existing design into a target design, and provides a systematic technique, based at its lowest level on refactorings. The second approach (Open Java) provides language constructs similar to macros, which are used by the programmer to streamline the application of design patterns. Lastly, COMPOST views the application of design patterns as a software composition problem, and serves as a basis for Recoder, which provides a more complex API for other types of refactorings. The approaches to the automation of design patterns aim at simplifying the application of patterns through tool support. The methods were evaluated based on a set of requirements that measure how useful each approach is in supporting the application of patterns for large object-oriented systems. References E. Gamma, R. Helm, R. Johnson, and J Vlissides. Design Patterns: Elements of Reusable Object- Oriented Software. Addison-Wesley, F. Busschmann, R. Meunier, H. Rohnert, P. Sommerland, M. Stal. Patter-Oriented Software Architecture A System of Patterns B. Schulz, T. Genssler, B. Mohr, and W. Zimmer. Design pattern as reorganisation operators. Technical report, FZI, 1998a. Together, B. Schulz, T. Genssler, B. Mohr, W. Zimmer. On the Computer Aided Introduction of Design Patterns into Object-Oriented Systems. Proceedings of Technology of Object-Oriented Languages, , 1998b. Frameworks und Entwurfsmuster W. Zimmer, PhD thesis, FZI, 1997 U. Assmann, T. Genssler, D. Heuzeroth, A. Ludwig, R. Neumann. Refactoring and Beyond, (TODO: add publication place and date) COMPOST s web page: W. Opdyke. Refactoring Object-Oriented Frameworks. PhD thesis, University of Illinois at Urbana- Champaign, Michiaki Tatsubori, Shigeru Chiba, Marc-Olivier Killijian and Kozo Itano. OpenJava: A Class-Based Macro System for Java. Lecture Notes in Computer Science 1826, Reflection and Software Engineering,, Walter Cazzola, Robert J. Stroud, Francesco Tisato (Eds.), Springer-Verlag, pp , OpenJava s web page: 11

12 A. Ludwig, D. Heuzeroth. Recoder. J. Bosch. Language Support for Design Patterns. TOOLS Europe 96, G. Florijn, M. Meijers, P. Winsen. Tool support in design patterns. Proceedings of the European Conference on Object-Oriented Programming June M. OCinneide and P. Nixon. A methodology for the automated introduction of design patterns. Hongji Yang and Lee White, editors, Proceedings of the International Conference on Software Maintenance pages , Tool support for object-oriented design patterns W. Zimmer. Relationships between design patterns. In J. Coplien and D.C. Schmidt, editors, Pattern Languages of Program Design. Addison-Wesley,

Programming Support of Design Patterns with Compile-time Reflection

Programming Support of Design Patterns with Compile-time Reflection Programming Support of Design Patterns with Compile-time Reflection Michiaki Tatsubori and Shigeru Chiba Institute of Information Sciences and Electronics, University of Tsukuba, Japan mt,chiba@is.tsukuba.ac.jp

More information

Shigeru Chiba Michiaki Tatsubori. University of Tsukuba. The Java language already has the ability for reection [2, 4]. java.lang.

Shigeru Chiba Michiaki Tatsubori. University of Tsukuba. The Java language already has the ability for reection [2, 4]. java.lang. A Yet Another java.lang.class Shigeru Chiba Michiaki Tatsubori Institute of Information Science and Electronics University of Tsukuba 1-1-1 Tennodai, Tsukuba, Ibaraki 305-8573, Japan. Phone: +81-298-53-5349

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

Towards Better Support for Pattern-Oriented Software Development

Towards Better Support for Pattern-Oriented Software Development Towards Better Support for Pattern-Oriented Software Development Dietrich Travkin Software Engineering Research Group, Heinz Nixdorf Institute & Department of Computer Science, University of Paderborn,

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011 Design Patterns Lecture 1 Manuel Mastrofini Systems Engineering and Web Services University of Rome Tor Vergata June 2011 Definition A pattern is a reusable solution to a commonly occurring problem within

More information

Martin P. Robillard and Gail C. Murphy. University of British Columbia. November, 1999

Martin P. Robillard and Gail C. Murphy. University of British Columbia. November, 1999 Migrating a Static Analysis Tool to AspectJ TM Martin P. Robillard and Gail C. Murphy Department of Computer Science University of British Columbia 201-2366 Main Mall Vancouver BC Canada V6T 1Z4 fmrobilla,murphyg@cs.ubc.ca

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 10 - Object-Oriented Programming Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages

More information

Pattern-Oriented Development with Rational Rose

Pattern-Oriented Development with Rational Rose Pattern-Oriented Development with Rational Rose Professor Peter Forbrig, Department of Computer Science, University of Rostock, Germany; Dr. Ralf Laemmel, Department of Information Management and Software

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 20 GoF Design Patterns Behavioral Department of Computer Engineering Sharif University of Technology 1 GoF Behavioral Patterns Class Class Interpreter: Given a language,

More information

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth

More information

Software Architecture (Lesson 2) Object-Oriented Paradigm (1)

Software Architecture (Lesson 2) Object-Oriented Paradigm (1) Software Architecture (Lesson 2) Object-Oriented Paradigm (1) Table of Contents Introduction... 2 1.1 Basic Concepts... 2 1.1.1 Objects... 2 1.1.2 Messages... 3 1.1.3 Encapsulation... 4 1.1.4 Classes...

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

Topics in Object-Oriented Design Patterns

Topics in Object-Oriented Design Patterns Software design Topics in Object-Oriented Design Patterns Material mainly from the book Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; slides originally by Spiros Mancoridis;

More information

Evolution of Collective Object Behavior in Presence of Simultaneous Client-Specific Views

Evolution of Collective Object Behavior in Presence of Simultaneous Client-Specific Views Evolution of Collective Object Behavior in Presence of Simultaneous Client-Specific Views Bo Nørregaard Jørgensen, Eddy Truyen The Maersk Mc-Kinney Moller Institute for Production Technology, University

More information

Reflective Design Patterns to Implement Fault Tolerance

Reflective Design Patterns to Implement Fault Tolerance Reflective Design Patterns to Implement Fault Tolerance Luciane Lamour Ferreira Cecília Mary Fischer Rubira Institute of Computing - IC State University of Campinas UNICAMP P.O. Box 676, Campinas, SP 3083-970

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

Coordination Patterns

Coordination Patterns Coordination Patterns 1. Coordination Patterns Design Patterns and their relevance for Coordination Oscar Nierstrasz Software Composition Group Institut für Informatik (IAM) Universität Bern oscar@iam.unibe.ch

More information

Pattern-Based Architectural Design Process Model

Pattern-Based Architectural Design Process Model Pattern-Based Architectural Design Process Model N. Lévy, F. Losavio Abstract: The identification of quality requirements is crucial to develop modern software systems, especially when their underlying

More information

RECODER - The Architecture of a Refactoring System

RECODER - The Architecture of a Refactoring System RECODER - The Architecture of a Refactoring System Andreas Ludwig Prof. U. Aßmann http://recoder.sf.net Overview ➊Programming in the Large Problems, Concepts, The Approach ➋The Architecture of RECODER

More information

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc. Chapter 13 Object Oriented Programming Contents 13.1 Prelude: Abstract Data Types 13.2 The Object Model 13.4 Java 13.1 Prelude: Abstract Data Types Imperative programming paradigm Algorithms + Data Structures

More information

Behavioral Design Patterns Used in Data Structures Implementation

Behavioral Design Patterns Used in Data Structures Implementation Behavioral Design Patterns Used in Data Structures Implementation Niculescu Virginia Department of Computer Science Babeş-Bolyai University, Cluj-Napoca email address: vniculescu@cs.ubbcluj.ro November,

More information

Lecture 13: Design Patterns

Lecture 13: Design Patterns 1 Lecture 13: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Pattern Resources Pattern Languages of Programming Technical conference on Patterns

More information

Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97

Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97 Frameworks Representations & Perspectives Position Paper Workshop on Language Support for Design Patterns and Frameworks, ECOOP 97 Palle Nowack Department of Computer Science, Aalborg University Fredrik

More information

Configuration Provider: A Pattern for Configuring Threaded Applications

Configuration Provider: A Pattern for Configuring Threaded Applications Configuration Provider: A Pattern for Configuring Threaded Applications Klaus Meffert 1 and Ilka Philippow 2 Technical University Ilmenau plop@klaus-meffert.de 1, ilka.philippow@tu-ilmena.de 2 Abstract

More information

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository Pattern Resources Lecture 25: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Pattern Languages of Programming Technical conference on Patterns

More information

Tuesday, October 4. Announcements

Tuesday, October 4. Announcements Tuesday, October 4 Announcements www.singularsource.net Donate to my short story contest UCI Delta Sigma Pi Accepts business and ICS students See Facebook page for details Slide 2 1 Design Patterns Design

More information

Motivation. ! Stop reinventing the wheel, try to reuse code! ! How do you organize code reuse? History: " Copy & Paste. " Collect useful files

Motivation. ! Stop reinventing the wheel, try to reuse code! ! How do you organize code reuse? History:  Copy & Paste.  Collect useful files Motivation 08 - Object-Oriented Libraries and Extensions! When you several systems, you notice that much of their code is similar.! Stop reinventing the wheel, try to reuse code!! How do you organize code

More information

INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM

INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM Charles S. Saxon, Eastern Michigan University, charles.saxon@emich.edu ABSTRACT Incorporating advanced programming

More information

Universal Communication Component on Symbian Series60 Platform

Universal Communication Component on Symbian Series60 Platform Universal Communication Component on Symbian Series60 Platform Róbert Kereskényi, Bertalan Forstner, Hassan Charaf Department of Automation and Applied Informatics Budapest University of Technology and

More information

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya ADAPTER Presented By: Mallampati Bhava Chaitanya Topics Intent Motivation Applicability Structure Participants & Collaborations Consequences Sample Code Known Uses Related Patterns Intent Convert the interface

More information

Design Patterns IV. Alexei Khorev. 1 Structural Patterns. Structural Patterns. 2 Adapter Design Patterns IV. Alexei Khorev. Structural Patterns

Design Patterns IV. Alexei Khorev. 1 Structural Patterns. Structural Patterns. 2 Adapter Design Patterns IV. Alexei Khorev. Structural Patterns Structural Design Patterns, 1 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 2 3 Department of Computer Science The Australian National University 4 18.1 18.2 GoF Structural

More information

Jarcler: Aspect-Oriented Middleware for Distributed Software in Java

Jarcler: Aspect-Oriented Middleware for Distributed Software in Java Jarcler: Aspect-Oriented Middleware for Distributed Software in Java Muga Nishizawa Shigeru Chiba Dept. of Mathematical and Computing Sciences Tokyo Institute of Technology Email: {muga,chiba@csg.is.titech.ac.jp

More information

Design Patterns IV Structural Design Patterns, 1

Design Patterns IV Structural Design Patterns, 1 Structural Design Patterns, 1 COMP2110/2510 Software Design Software Design for SE September 17, 2008 Class Object Department of Computer Science The Australian National University 18.1 1 2 Class Object

More information

DESIGN PATTERN MATCHING

DESIGN PATTERN MATCHING PERIODICA POLYTECHNICA SER. EL. ENG. VOL. 47, NO. 3 4, PP. 205 212 (2003) DESIGN PATTERN MATCHING Dániel PETRI and György CSERTÁN Department of Measurement and Information Systems Budapest University of

More information

Idioms for Building Software Frameworks in AspectJ

Idioms for Building Software Frameworks in AspectJ Idioms for Building Software Frameworks in AspectJ Stefan Hanenberg 1 and Arno Schmidmeier 2 1 Institute for Computer Science University of Essen, 45117 Essen, Germany shanenbe@cs.uni-essen.de 2 AspectSoft,

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

Object-Oriented Concepts and Design Principles

Object-Oriented Concepts and Design Principles Object-Oriented Concepts and Design Principles Signature Specifying an object operation or method involves declaring its name, the objects it takes as parameters and its return value. Known as an operation

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

A System of Patterns for Web Navigation

A System of Patterns for Web Navigation A System of Patterns for Web Navigation Mohammed Abul Khayes Akanda and Daniel M. German Department of Computer Science, University of Victoria, Canada maka@alumni.uvic.ca, dmgerman@uvic.ca Abstract. In

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D. Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice

More information

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns EPL 603 TOPICS IN SOFTWARE ENGINEERING Lab 6: Design Patterns Links to Design Pattern Material 1 http://www.oodesign.com/ http://www.vincehuston.org/dp/patterns_quiz.html Types of Design Patterns 2 Creational

More information

Tool Support for Refactoring Duplicated OO Code

Tool Support for Refactoring Duplicated OO Code Tool Support for Refactoring Duplicated OO Code Stéphane Ducasse and Matthias Rieger and Georges Golomingi Software Composition Group, Institut für Informatik (IAM) Universität Bern, Neubrückstrasse 10,

More information

A Type Graph Model for Java Programs

A Type Graph Model for Java Programs A Type Graph Model for Java Programs Arend Rensink and Eduardo Zambon Formal Methods and Tools Group, EWI-INF, University of Twente PO Box 217, 7500 AE, Enschede, The Netherlands {rensink,zambon}@cs.utwente.nl

More information

A Meta-Model for Composition Techniques in Object-Oriented Software Development

A Meta-Model for Composition Techniques in Object-Oriented Software Development A Meta-Model for Composition Techniques in Object-Oriented Software Development Bedir Tekinerdogan Department of Computer Science University of Twente P.O. Box 217, 7500 AE Enschede, The Netherlands E-Mail:

More information

Programming Languages 2nd edition Tucker and Noonan"

Programming Languages 2nd edition Tucker and Noonan Programming Languages 2nd edition Tucker and Noonan" Chapter 13 Object-Oriented Programming I am surprised that ancient and Modern writers have not attributed greater importance to the laws of inheritance..."

More information

Design Patterns Design patterns advantages:

Design Patterns Design patterns advantages: Design Patterns Designing object-oriented software is hard, and designing reusable object oriented software is even harder. You must find pertinent objects factor them into classes at the right granularity

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

Introduction to Design Patterns

Introduction to Design Patterns Introduction to Design Patterns First, what s a design pattern? a general reusable solution to a commonly occurring problem within a given context in software design It s not a finished design that can

More information

L23.1 Introduction... 2

L23.1 Introduction... 2 Department of Computer Science COS121 Lecture Notes: L23 Adapter Design Pattern 23 & 26 September 2014 Copyright c 2014 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents L23.1 Introduction.................................

More information

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) Design Pattern CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) A. Design Pattern Design patterns represent the best practices used by experienced

More information

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar Design Patterns MSc in Communications Software Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Inheritance (Chapter 7)

Inheritance (Chapter 7) Inheritance (Chapter 7) Prof. Dr. Wolfgang Pree Department of Computer Science University of Salzburg cs.uni-salzburg.at Inheritance the soup of the day?! Inheritance combines three aspects: inheritance

More information

A Metric for Measuring the Abstraction Level of Design Patterns

A Metric for Measuring the Abstraction Level of Design Patterns A Metric for Measuring the Abstraction Level of Design Patterns Atsuto Kubo 1, Hironori Washizaki 2, and Yoshiaki Fukazawa 1 1 Department of Computer Science, Waseda University, 3-4-1 Okubo, Shinjuku-ku,

More information

A Primer on Design Patterns

A Primer on Design Patterns A Primer on Design Patterns First Edition Rahul Batra This book is for sale at http://leanpub.com/aprimerondesignpatterns This version was published on 2016-03-23 This is a Leanpub book. Leanpub empowers

More information

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004 Facade and Adapter Comp-303 : Programming Techniques Lecture 19 Alexandre Denault Computer Science McGill University Winter 2004 March 23, 2004 Lecture 19 Comp 303 : Facade and Adapter Page 1 Last lecture...

More information

Cover Page. The handle holds various files of this Leiden University dissertation

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D

Slide 1. Design Patterns. Prof. Mirco Tribastone, Ph.D Slide 1 Design Patterns Prof. Mirco Tribastone, Ph.D. 22.11.2011 Introduction Slide 2 Basic Idea The same (well-established) schema can be reused as a solution to similar problems. Muster Abstraktion Anwendung

More information

A Metric of the Relative Abstraction Level of Software Patterns

A Metric of the Relative Abstraction Level of Software Patterns A Metric of the Relative Abstraction Level of Software Patterns Atsuto Kubo 1, Hironori Washizaki 2, and Yoshiaki Fukazawa 1 1 Department of Computer Science, Waseda University, 3-4-1 Okubo, Shinjuku-ku,

More information

Implementing Object Equivalence in Java Using the Template Method Design Pattern

Implementing Object Equivalence in Java Using the Template Method Design Pattern Implementing Object Equivalence in Java Using the Template Method Design Pattern Daniel E. Stevenson and Andrew T. Phillips Computer Science Department University of Wisconsin-Eau Claire Eau Claire, WI

More information

Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns

Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns Lectures 24 and 25 Introduction to Architectural Styles and Design Patterns Software Engineering ITCS 3155 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte

More information

Towards a Java Framework for Knowledge Representation and Inference

Towards a Java Framework for Knowledge Representation and Inference Towards a Java Framework for Knowledge Representation and Inference Adrian GIURCA University of Craiova, Faculty of Mathematics and Computer Science Email: giurca@inf.ucv.ro Abstract. The Knowledge Representation

More information

On the correctness of template metaprograms

On the correctness of template metaprograms Proceedings of the 7 th International Conference on Applied Informatics Eger, Hungary, January 28 31, 2007 Vol 2 pp 301 308 On the correctness of template metaprograms Ádám Sipos, István Zólyomi, Zoltán

More information

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN

NOTES ON OBJECT-ORIENTED MODELING AND DESIGN NOTES ON OBJECT-ORIENTED MODELING AND DESIGN Stephen W. Clyde Brigham Young University Provo, UT 86402 Abstract: A review of the Object Modeling Technique (OMT) is presented. OMT is an object-oriented

More information

Introduction to Design Patterns

Introduction to Design Patterns Dr. Michael Eichberg Software Engineering Department of Computer Science Technische Universität Darmstadt Software Engineering Introduction to Design Patterns (Design) Patterns A pattern describes... Patterns

More information

Reflective Java and A Reflective Component-Based Transaction Architecture

Reflective Java and A Reflective Component-Based Transaction Architecture Reflective Java and A Reflective Component-Based Transaction Architecture Zhixue Wu APM Ltd., Poseidon House, Castle Park, Cambridge CB3 0RD UK +44 1223 568930 zhixue.wu@citrix.com ABSTRACT In this paper,

More information

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8 Object Oriented Methods with UML Introduction to Design Patterns- Lecture 8 Topics(03/05/16) Design Patterns Design Pattern In software engineering, a design pattern is a general repeatable solution to

More information

DAT159 Refactoring (Introduction)

DAT159 Refactoring (Introduction) DAT159 Refactoring (Introduction) Volker Stolz 1, with contributions by: Larissa Braz 2, Anna M. Eilertsen 3, Fernando Macías 1, Rohit Gheyi 2 Western Norway University of Applied Sciences, Universidade

More information

Exam in TDDB84: Design Patterns,

Exam in TDDB84: Design Patterns, Exam in TDDB84: Design Patterns, 2014-10-24 14-18 Information Observe the following, or risk subtraction of points: 1) Write only the answer to one task on one sheet. Use only the front side of the sheets

More information

Introduction to Design Patterns

Introduction to Design Patterns Dr. Michael Eichberg Software Technology Group Department of Computer Science Technische Universität Darmstadt Introduction to Software Engineering Introduction to Design Patterns Patterns 2 PATTERNS A

More information

Dynamic Instantiation-Checking Components

Dynamic Instantiation-Checking Components Dynamic Instantiation-Checking Components Nigamanth Sridhar Electrical and Computer Engineering Cleveland State University 318 Stilwell Hall, 2121 Euclid Ave Cleveland OH 44113 n.sridhar1@csuohio.edu ABSTRACT

More information

Control Message. Abstract. Microthread pattern?, Protocol pattern?, Rendezvous pattern? [maybe not applicable yet?]

Control Message. Abstract. Microthread pattern?, Protocol pattern?, Rendezvous pattern? [maybe not applicable yet?] Control Message An Object Behavioral Pattern for Managing Protocol Interactions Joe Hoffert and Kenneth Goldman {joeh,kjg@cs.wustl.edu Distributed Programing Environments Group Department of Computer Science,

More information

AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz

AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz Results obtained by researchers in the aspect-oriented programming are promoting the aim to export these ideas to whole software development

More information

CISC 322 Software Architecture

CISC 322 Software Architecture CISC 322 Software Architecture Lecture 14: Design Patterns Emad Shihab Material drawn from [Gamma95, Coplien95] Slides adapted from Spiros Mancoridis and Ahmed E. Hassan Motivation Good designers know

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Today s lecture. CS 314 fall 01 C++ 1, page 1

Today s lecture. CS 314 fall 01 C++ 1, page 1 Today s lecture Midterm Thursday, October 25, 6:10-7:30pm general information, conflicts Object oriented programming Abstract data types (ADT) Object oriented design C++ classes CS 314 fall 01 C++ 1, page

More information

Chapter 7. Modular Refactoring. 7.1 Introduction to Modular Refactoring

Chapter 7. Modular Refactoring. 7.1 Introduction to Modular Refactoring Chapter 7 Modular Refactoring I n this chapter, the role of Unified Modeling Language (UML) diagrams and Object Constraint Language (OCL) expressions in modular refactoring have been explained. It has

More information

Coordinator. Example. Prashant Jain Corporate Technology, Siemens AG Munich, Germany

Coordinator. Example. Prashant Jain Corporate Technology, Siemens AG Munich, Germany Coordinator Prashant Jain pjain@gmx.net Corporate Technology, Siemens AG Munich, Germany The Coordinator design pattern describes how to maintain system consistency by coordinating completion of tasks

More information

Specification and Automated Detection of Code Smells using OCL

Specification and Automated Detection of Code Smells using OCL Specification and Automated Detection of Code Smells using OCL Tae-Woong Kim 1, Tae-Gong Kim 2 and Jai-Hyun Seu 3 School of Computer Engineering, Inje University, Obang-dong 607, Gimhae, Gyeong-Nam, Korea

More information

junit RV Adding Runtime Verification to junit

junit RV Adding Runtime Verification to junit junit RV Adding Runtime Verification to junit Normann Decker, Martin Leucker, and Daniel Thoma Institute for Software Engineering and Programming Languages Universität zu Lübeck, Germany {decker, leucker,

More information

Implementing Software Connectors through First-Class Methods

Implementing Software Connectors through First-Class Methods Implementing Software Connectors through First-Class Methods Cheoljoo Jeong and Sangduck Lee Computer & Software Technology Laboratory Electronics and Telecommunications Research Institute Taejon, 305-350,

More information

Software Engineering

Software Engineering Software Engineering CSC 331/631 - Spring 2018 Object-Oriented Design Principles Paul Pauca April 10 Design Principles DP1. Identify aspects of the application that vary and separate them from what stays

More information

COFFEESTRAINER - Statically Checking Structural Constraints on Java Programs

COFFEESTRAINER - Statically Checking Structural Constraints on Java Programs COFFEESTRAINER - Statically Checking Structural Constraints on Java Programs Boris Bokowski bokowski@inf.fu-berlin.de Technical Report B-98-14 December 1998 Abstract It is generally desirable to detect

More information

SUMMARY: MODEL DRIVEN SECURITY

SUMMARY: MODEL DRIVEN SECURITY SUMMARY: MODEL DRIVEN SECURITY JAN-FILIP ZAGALAK, JZAGALAK@STUDENT.ETHZ.CH Model Driven Security: From UML Models to Access Control Infrastructres David Basin, Juergen Doser, ETH Zuerich Torsten lodderstedt,

More information

Dr. Tom Hicks. Computer Science Department Trinity University

Dr. Tom Hicks. Computer Science Department Trinity University Dr. Tom Hicks Computer Science Department Trinity University 1 1 About Design With Reuse 2 Software Reuse Why Do We Care About Reuse? Historically: In Most Engineering Disciplines, Systems are Designed

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design

More information

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23 Contents Chapter 1 Overview of the JavaScript C Engine...1 Supported Versions of JavaScript...1 How Do You Use the Engine?...2 How Does the Engine Relate to Applications?...2 Building the Engine...6 What

More information

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich CSCD01 Engineering Large Software Systems Design Patterns Joe Bettridge Winter 2018 With thanks to Anya Tafliovich Design Patterns Design patterns take the problems consistently found in software, and

More information

Design Patterns: Part 2

Design Patterns: Part 2 Design Patterns: Part 2 ENGI 5895: Software Design Andrew Vardy with code samples from Dr. Rodrigue Byrne and [Martin(2003)] Faculty of Engineering & Applied Science Memorial University of Newfoundland

More information

CPSC 427: Object-Oriented Programming

CPSC 427: Object-Oriented Programming CPSC 427: Object-Oriented Programming Michael J. Fischer Lecture 22 November 28, 2016 CPSC 427, Lecture 22 1/43 Exceptions (continued) Code Reuse Linear Containers Ordered Containers Multiple Inheritance

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Chapter 1: Object-Oriented Programming Using C++

Chapter 1: Object-Oriented Programming Using C++ Chapter 1: Object-Oriented Programming Using C++ Objectives Looking ahead in this chapter, we ll consider: Abstract Data Types Encapsulation Inheritance Pointers Polymorphism Data Structures and Algorithms

More information

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate UNIT 4 GRASP GRASP: Designing objects with responsibilities Creator Information expert Low Coupling Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter, singleton,

More information

Design Patterns. "Gang of Four"* Design Patterns. "Gang of Four" Design Patterns. Design Pattern. CS 247: Software Engineering Principles

Design Patterns. Gang of Four* Design Patterns. Gang of Four Design Patterns. Design Pattern. CS 247: Software Engineering Principles CS 247: Software Engineering Principles Design Patterns Reading: Freeman, Robson, Bates, Sierra, Head First Design Patterns, O'Reilly Media, Inc. 2004 Ch Strategy Pattern Ch 7 Adapter and Facade patterns

More information

The Contract Pattern. Design by contract

The Contract Pattern. Design by contract The Contract Pattern Copyright 1997, Michel de Champlain Permission granted to copy for PLoP 97 Conference. All other rights reserved. Michel de Champlain Department of Computer Science University of Canterbury,

More information

Capturing JUnit Behavior into Static Programs

Capturing JUnit Behavior into Static Programs Degree Project Capturing JUnit Behavior into Static Programs Asher Siddiqui 2010-05-11 Subject: Computer Science Level: Master Course code: DA4004 Abstract In this research paper, it evaluates the benefits

More information