Back Home Up Next

Introduction to Design Patterns

1. What is a Design Pattern?
2. Design Patterns in Elisa

3.  From Object-Orientation to  Domain Definitions

4.  From Domain Definitions to  Elisa components

 

1  What is a Design Pattern?

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer must implement themselves in the application. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Many patterns imply object-orientation. 

Design patterns gained popularity in software engineering after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. The authors are often referred to as the "Gang of Four", which is frequently abbreviated as "GOF". The book has been highly influential to the field of software engineering and is regarded as an important source for object-oriented design theory and practice.

Because Elisa claims to integrate different programming paradigms into one linguistic framework, including object-orientation, it should also support design patterns as described in the book.  In following chapters we will use a number of design patterns and will illustrate how these patterns can be described by Elisa. 

2  Design Patterns in Elisa

The description of a design pattern comprises the following sections: 

  1. The first part of each design pattern description states its purpose.
  2. The second part of each design pattern is a problem description. The purpose and the problem description are both copied from the book. 
  3. The third part contains a translation of elements of the stated problem into a set of domain definitions. The domain definitions are bridging the gap between the problem description and the Elisa code. 
  4. The fourth part contains examples of Elisa components and definitions.

The description of the purpose in the first part and the problem description  in the second part are using the terminology and diagrams as used in object orientation such as objects, concrete classes, abstract classes, etc.  In the third part a new terminology is introduced based on domains and domain definitions which is used in the fourth part by Elisa components.

3  From Object-Orientation to  Domain Definitions

Classes in object-oriented design patterns are considered  to be domains in domain-orientation. See What is Domain Orientation?

 

Concrete classes in the design patterns are considered to be composite domains.

 

Abstract classes are expressed as selection domains. A selection domain specifies a number of alternative domains. 

4  From Domain Definitions to  Elisa components

Composite domains are represented in Elisa by means of descriptor types. The transformation of composite domains into descriptor types is described in Implementation of Composite Domains.

Selection domains are represented in Elisa by means of category types. The transformation of selection domains into category types is described in Implementation of Selection Domains. The implementation is based on Patterns for dynamic Type Matching.

 

Back Home Up Next

 

  Part 5: Design Patterns   Introduction

            
Introduction

Home | Highlights of Elisa | Integrating Different Paradigms | Getting Started with Elisa | Demo's  | What is Domain Orientation | Bibliography | Copyright | News | Contact | Contents

Language Description:

Lexical Elements | Basic Data Types and Expressions | Definitions | Streams | Backtracking | Statements and Special Expressions | Arrays | Lists | Descriptors | Components | Collections | Generic Components | Terms | Categories | Types | Built-in Definitions | Higher-order Definitions | External Interfaces | Index 

Data Structures: Sequences | Examples involving Lists | Trees | Graphs | Searching State Spaces | Language Processing | Knowledge Representations
Domain Modeling:

Domain Modeling | Concepts | Domain Definitions | Domain Operations | Domain Implementations | Systems | Case study: an Order processing system | Case study: an Airport Support system | Domain Orientation versus Object Orientation

Design Patterns:

Introduction | Abstract Factory | Builder | Factory Method | Prototype | Singleton | Adapter | Bridge | Composite | Decorator | Facade | Flyweight | Proxy | Chain of Responsibility | Command | Interpreter | Iterator | Mediator | Memento | Observer | State | Strategy | Template Method | Visitor 

 

click tracking

 

Send me your comments

 

This page was last modified on 08-12-2012 14:55:54   

free hit counter