Register or log in at GRIN

Your e-mail-address or password is wrong
Register now
For new authors: free, easy and fast
This will be used as your user name, please specify a valid e-mail address

Lost password

Your e-mail-address or password is wrong

Request a new password
Formalization of Design Patterns by Means of Ontologies close

Please wait

Please install the Adobe Flash Player if no e-book is displayed.

Formalization of Design Patterns by Means of Ontologies

Diploma Thesis, 2007, 105 Pages
Author: Holger Kampffmeyer
Subject: Computer Science - Software

Details

Category: Diploma Thesis
Year: 2007
Pages: 105
Grade: 1.0
Bibliography: ~ 57  Entries
Language: English
Archive No.: V70194
ISBN (E-book): 978-3-638-61508-2

File size: 564 KB


Excerpt (computer-generated)

Technische Universität Dresden
Software und Multimediatechnik

Formalization of Design Patterns by Means of Ontologies

Holger Kampffmeyer

 

Table of Contents


1 Introduction ... 1

2 Related Work ... 3

2.1 Classification of Design Patterns ... 3
2.2 Ontological and Other Formal Approaches ... 7

3 Design Patterns ... 9

3.1 The GOF Pattern Catalogue ... 9
3.1.1 Abstract Factory ... 10
3.1.2 Builder ... 10
3.1.3 Factory Method ... 10
3.1.4 Prototype ... 11
3.1.5 Singleton ... 11
3.1.6 Adapter ... 11
3.1.7 Bridge ... 11
3.1.8 Composite ... 12
3.1.9 Decorator ... 12
3.1.10 Facade ... 12
3.1.11 Flyweight ... 13
3.1.12 Proxy ... 13
3.1.13 Chain of Responsibility ... 13
3.1.14 Command ... 14
3.1.15 Interpreter ... 14
3.1.16 Iterator ... 14
3.1.17 Mediator ... 15
3.1.18 Memento ... 15
3.1.19 Observer ... 15
3.1.20 State ... 16
3.1.21 Strategy ... 16
3.1.22 Template Method ... 16
3.1.23 Visitor ... 17

4 Ontologies ... 19

4.1 The Web Ontology Language OWL ... 21
4.1.1 Classes ... 21
4.1.2 Properties ... 22
4.1.3 Individuals ... 23
4.1.4 The Manchester OWL Syntax ... 24
4.2 Other Ontology Languages ... 25
4.2.1 RDF and XML ... 25
4.2.2 RDFS ... 26
4.2.3 DAML+OIL ... 26
4.3 Conclusions ... 26

5 Ontology Engineering Tools ... 29

5.1 Prot´eg´e ... 30
5.2 Querying and Inference Approaches ... 31
5.2.1 SPARQL and the Jena Framework ... 31
5.2.2 The Pellet DIG Reasoner ... 33
5.2.3 RacerPro ... 33
5.2.4 The nRQL Query Language ... 34
5.3 Conclusions ... 36

6 Developing the DPIO ... 39

6.1 Knowledge-Engineering Methodology ... 39
6.2 Domain and Scope of the Ontology ... 40
6.3 Competency Questions ... 41
6.3.1 Meta Questions ... 41
6.3.2 Questions in the Domain of Design Patterns ... 41
6.4 Initial Vocabulary ... 43
6.4.1 Intent Classification ... 43
6.5 Modeling the Ontology ... 43
6.5.1 Classes ... 44
6.5.2 Properties ... 45
6.5.3 Instances ... 46
6.5.4 Examples of Modeled Design Problems ... 46
6.6 Completeness of the Ontology ... 51
6.7 Conclusions ... 52

7 Evaluation ... 61

7.1 Formalization of Competency Questions ... 61
7.1.1 Meta Questions ... 61
7.1.2 Questions in the Domain of Design Patterns ... 63
7.2 Test of the Ontology ... 66
7.3 Conclusions ... 67

8 The Design Pattern Wizard ... 69

8.1 Requirements ... 69
8.2 Architecture ... 70
8.3 The Wizard User Interface ... 76
8.4 Conclusions ... 79

9 Conclusions and Future Work ... 81

Bibliography ... 89

 

 

Chapter 1 - Introduction

Since the publication of “Design Patterns: Elements of Reusable Object- Oriented Software” [27] 1, design patterns have proven to be important building blocks and means of reuse in software design. A design pattern “systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems” [27]. While the GOF-book “only” contains 23 design patterns, the authors state that “it might be hard to find the one (design pattern) that addresses a particular design problem especially if the catalogue is new and unfamiliar to you.” [27]. This statement has become particularly significant with the emergence of new design patterns since the publication of the GOF-book in 1995. Current design patterns have appeared in specific application domains (J2EE patterns [10, 11, 25], User-Interface patterns [39]), as language dependent patterns (also called idioms), as patterns at different abstraction levels (analysis, architectural patterns), or simply as large collections of design patterns in pattern catalogues [17, 50]. The mere number of available design patterns complicates the decision-making which design pattern to choose and demands tools assisting in this process. In addition, the structure of design pattern representations in pattern catalogues as narrative text serves as documentations to be read by humans. It is not a suitable representation to be used by tools. For this reason, a knowledge-based formal representation of design patterns is needed, a representation that is accessible by tools.

Existing approaches to formalizing design patterns generally cover solely the formal description of the structure of design patterns. However, an important part of a design pattern description is the intent section. It is a short statement describing what the design pattern does and which design problems it addresses. Therefore, this is the first section a developer reads when deciding which design pattern to choose for a given design problem. To the best of our knowledge, no work exists trying to formalize the intent of design patterns. Software tools based on such a formalization could enable users to describe their design problems using terminology defined in a knowledge-base. The knowledge-base could be developed using ontologies, specifications of conceptualizations that have been proven to be suitable means for providing knowledge of an area of interest. A tool using such a knowledge-base would simplify the usage of ontology query languages by providing an easy-to-use front-end for visually formulating design problems. Furthermore, the tool would suggest matching design patterns given the user’s design problem description.

The goals of this work are:

  • to classify the 23 GOF design patterns with respect to their intent,
  • to derive an ontology formalizing the developed classification,
  • to build a prototypical tool using the ontology that suggests design patterns for given design problems.

The main contribution of this work is an ontology formalizing the intent of design patterns, which we call Design Pattern Intent Ontology (DPIO).

The rest of this work is organized as follows: Chapter 2 describes related work. This work either presents approaches of classifying design patterns according to different criteria or it presents approaches of formalizing the structure of design patterns by means of ontologies and other formal languages. Chapter 3 introduces the concept of design patterns. We furthermore present the intent and the applicability of the 23 GOF design patterns. Chapter 4 introduces ontologies. We give a definition and present some of the established ontology languages. Chapter 5 presents tools that are used in ontology engineering. This includes the ontology editor Prot´eg´e, reasoners and query languages for querying the ontology. In Chapter 6 we describe the development of the Design Pattern Intent Ontology. Domain and scope of the ontology are confined, the methodology of the development process is introduced and important concepts of the ontology are enumerated. Chapter 7 presents the evaluation of the developed ontology. In Chapter 8 we introduce the idea of the Design Pattern Wizard, a tool utilizing the developed ontology. We describe the architecture, design decisions and some features of the user interface. Finally, Chapter 9 discusses the results of this work and presents ideas and prospects on future work.


Chapter 2 - Related Work

Our survey of current work in design pattern formalization indicates that no other work before has tried to classify design patterns according to their intent by using ontologies. However, interesting work exists both in the area of design pattern categorization and in the area of design pattern formalization. In the following sections we categorize related work as work that describes approaches to classify design patterns and work that uses ontological or other formal or semi-formal approaches to describe design patterns.


2.1 Classification of Design Patterns

Christopher Alexander [9], who developed the first design pattern language for town planning and architectural design in 1977, provided a hierarchical structure to catalogue different patterns. In 1995, the idea of design patterns was applied to software engineering by Gamma et al. [27] in their design pattern catalogue, consisting of 23 general purpose patterns for object oriented design (depicted in Table 2.1). The Gang-Of-Four structures the patterns by two criteria: purpose and scope. The purpose of a design pattern can be creational, structural or behavioral. The scope criterion, on the other hand, divides patterns into class and object patterns. Class patterns contain patterns that deal with relationships between classes and their subclasses. In contrast, object patterns mainly deal with relationships between objects, which can be changed at run-time and are more dynamic.

Creational class patterns defer a part of object creation to subclasses, whereas creational object patterns defer it to another object. Structural class patterns use inheritance to build a structure whilst structural object patterns use object reference for the same purpose. Behavioral class patterns distribute responsibility using inheritance to describe control flow and the handling of algorithms whereas behavioral object patterns use cooperating objects to carry out a task that no single object can carry out alone.

 

[...]


1 This book has become known as the GOF-book. The four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides are known as the Gang-of-Four, or simply GOF.


Comments

No comments yet

Add Comment
Your comment is reviewed before being published

Other users also were interested in the following titles:

Erstellen einer schriftlichen Hausarbeit

Author: Claudia Nickel
Presentations, Models, Tutorials, Instructions, 2006 Download as PDF-file for 4,99 EUR

Grundtechniken wissenschaftlichen Arbeitens

Author: Maik Philipp
Presentations, Models, Tutorials, Instructions, 2004 Download as PDF-file for 5,99 EUR

This text can be quoted and accessed from this url:

http://www.grin.com/e-book/70194/formalization-of-design-patterns-by-means-of-ontologies
please wait Please wait