Design Patterns as Language Constructs
نویسنده
چکیده
Design patterns have proven to be very useful for the design of object-oriented systems. The power of design patterns stems from their ability to provide generic solutions to reappearing problems that can be specialised for particular situations. The implementation of design patterns, however, has received only little attention and we have identified four problems associated with the implementation of design patterns using conventional object-oriented languages. First, the traceability of a design pattern in the implementation is often insufficient; often the design pattern is ‘lost’. Second, since several patterns require an object to forward messages to other objects to increase flexibility, the self problem often occurs. Thirdly, since the pattern implementation is mixed with the domain class, the reusability of pattern implementations is often limited. Finally, implementing design patterns may present significant implementation overhead for the software engineer. Often, a, potentially large, number of simple methods has to be implemented with trivial behaviour, e.g. forwarding a message to another object. In this paper, a solution to these problems is presented in the context of the layered object model (LayOM). LayOM provides language support for the explicit representation of design patterns in the programming language. LayOM is an extended object-oriented language in that it contains several components that are not part of the conventional object model, such as states, categories and layers. Layers are used to represent design patterns at the level of the programming language and example layer types for eight design patterns are presented, i.e. Adapter, Bridge, Composite, Facade, State, Observer, Strategy and Mediator. Since LayOM is an extensible language, the software engineer may extend the language model with abstractions for other design patterns.
منابع مشابه
On the Interaction of Object-Oriented Design Patterns and Programming Languages
Design patterns are distilled from many feal systems to catalog common programming practice. \Ve have analyzed several published design patterns and looked for patterns of working around constraints of the implementation language. Some object-oriented design patterns arc distorted or overly complicated because of the lack of supporting language constructs or mechanisms. We lay a groundwork of g...
متن کاملA Formal Language for Design Patterns
This article sets forth a rigorous approach to the concept of a ‘design pattern language’. We present a method of using a programming language to manipulate constructs of ordinary OOP language (such as classes and relations). We show that the specification of many design patterns can phrased as algorithms in this metaprogramming environment. The advantage is in delivering a precise method of de...
متن کاملA Concept-Based Approach to Software Design
The initial design of software systems is modelled using conceptual design language elements. When a refined version of the design is made, each of the original (conceptual) elements is replaced by the refined element(s). Other feasible refinements are eliminated prematurely. This paper presents a software design approach, called CoCompose, that allows for defining several, layered, alternative...
متن کاملProgramming Support of Design Patterns with Compile-time Reflection
This paper presents that compile-time MOPs can provide a general framework resolving implementation problems of design patterns. The problems come from the fact that some programs written according to design patterns are too complicated and errorprone and that their overall structure is not easy to understand. This problem can be resolved by syntax extensions and extended language constructs th...
متن کاملProgramming Support of Design Patterns with Compile-time Re ection
This paper presents that compile-time MOPs can provide a general framework resolving implementation problems of design patterns. The problems come from the fact that some programs written according to design patterns are too complicated and errorprone and that their overall structure is not easy to understand. This problem can be resolved by syntax extensions and extended language constructs th...
متن کاملDesign Patterns as Language Constructs ( To appear in the Journal of Object - Oriented Programming ) Jan
Design patterns have proven to be very useful for the design of object-oriented systems. The power of design patterns stems from their ability to provide generic solutions to reappearing problems that can be specialised for particular situations. The implementation of design patterns, however, has received only little attention and we have identified four problems associated with the implementa...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- JOOP
دوره 11 شماره
صفحات -
تاریخ انتشار 1998