Structured Matcher: A Case Study in Object-Oriented Redesign

Masters Project
Summer, 1999
Lonnie Heinke

 

Background, Outline, Appendices (Example)

 

CHAPTER I

INTRODUCTION

Purpose

The purpose of this project is to redesign an object-oriented program called Structured Matcher to refine it and make it extendible. This program implements the artificial intelligence task of hypothesis testing. The previous design, which will be referred to as the prototype design, was developed to handle a fixed number of variable types. The prototype design did allow for additional of new variable types, so the design integrated the variable types directly within the code of various objects. As such it had the advantage of reducing the number of objects needed, but added unrelated responsibilities to the objects containing and managing these variable types. The goal of this project was to redesign the Structured Matcher prototype program to separate the variable types out of the other objects, to produce cleaner code with more cohesive objects. Design patterns were used to facilitate this reassignment of responsibilities among the objects.

This project is significant because it looks at redesigning an existing program, which is more complex than designing a new program. The context of redesigning an existing programs is a common scenario, but is not often addressed.

 

Project Scope

This project was a redesign of an existing program. The outward functionality of the Structured Matcher program will remain the same from the prototype design to the redesigned program, so when references are made to the Structured Matcher program, this will be referring to the unchanging outward functionality. As stated earlier, references to the previous design will be called the prototype design, and the redesigned design will be referred to as the improved design.

The Structured Matcher program was written in Java, which is an object-oriented language, so much of the discussion will use terminology associated with this paradigm.

Design patterns will be one of the main tools used in the redesign. A brief introduction of design patterns is included. This project assumes the reader has a general knowledge of design patterns [Gamma94].

The Structured Matcher program utilizes the structured matching technique, from the field of artificial intelligence, to accomplish hypothesis testing. An overview of the hypothesis testing task and structure matching technique is given so the reader can have a better understanding of what the program is to accomplish [Bylander91].

Unified Modeling Language (UML) will be used in diagrams to model the project, but an explanation of UML itself, is beyond the scope of the project There are many books on UML, so if the reader wishes to become more familiar they might try The Unified Modeling Language User Guide published by Addison-Wesley [Booch98] [Fowler97]. The object models shown in this write up have been restricted to show only the objects relevant to the particular issue, due to the large number of objects in the program. In this project a variation from the standard UML was used in the modeling due to a limitation of the modeling tool used. When representing an aggregation of many objects of the same type, a double arrow will be used at the end of the line nearest the contained object, instead of an arrow and a dot.

The intended audience of this project is software engineers who desire a case study of the redesigning of an existing program.

To help distinguish special items in the text of the project, some special typography was used. The italic typeface was used to represent objects or methods of the Structured Matcher program or design. Bold typeface was used to indicate a parameter name used in conjunction with a Structured Matching (column headers), or a menu item in the program.

Outline

This project consists of five chapters, and three appendices. Chapter I provides an introduction and overview.

Chapter II consists of a general definition and background of the hypothesis testing and the Structured Matcher program. The Structured Matcher program is explained including a small walk through demonstration. Design patterns are introduced and discussed to show what role they play in the design process. A basic overview of the main objects is given to explain the framework of the program.

Chapter III gives an overview of the design problems within Structured Matchers. It then lays out the methodology used to solve the problems. This chapter presents the problem and solution in general terms.

Chapter IV consists of four sections following a consistent format. Each section details a specific problem in the prototype design of the Structured Matcher program. Then the solution achieved by implementing a design dictated by a design pattern is discussed. If there are consequences of applying the design pattern, these are also covered.

Chapter V concludes the project by discussing the results achieved through the redesign process. A section will look at challenges encountered in the project. The chapter concludes with recommendations for future work and refinements to this project.

Appendix A gives an overview of how to add a new parameter type to the Structured Matcher program. Appendix B is a collection of system models, and Appendix C is a glossary of terms used in the project.

 

 

REFERENCES

 

[Alexander77] C. Alexander, S. Ishikawa, M. Silverstein, M. Jacobson, I. Fiksdahl-King, S. Angel, A Pattern Language. Oxford University Press, New York, NY, 1977

 

[Alhir98] S. Alhir, UML in a Nutshell: A Desktop Quick Reference. O'Reilly and Associates, Sebastopol, CA, 1998

 

[Booch98] G. Booch, J. Rumbaugh, I. Jacobson, The Unified Modeling Language User Guide. Addison-Wesley, Reading, MA, 1998

 

[Bylander91] T. Bylander, T. Johnson, A. Goel, Structured Matching: A Task Specific Technique for Making Decisions. Knowledge Acquisition, 3(1), 1-20, 1991

 

[Flanagan97] D. Flanagan, Java in a Nutshell. 2nd ed. O’Reilly and Associates, Sebastopol, CA, 1997

 

[Fowler97] M. Fowler, K. Scott, UML Distilled: Applying the Standard Object Modeling Language. Addison-Wesley, Reading, MA, 1997

 

[Gamma94] E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of Reusabel Object-Oriented Software. Addison-Wesley, Reading, MA, 1994

 

[Geary97] D. Geary, Graphic Java 1.1: Mastering the AWT. 2nd ed. Prentice Hall, Upper Saddle River, NJ, 1997

 

[Geary99] D. Geary, Graphic Java 2: Mastering the JFC. 3rd ed. Prentice Hall, Upper Saddle River, NJ, 1997

 

[Grand98] M. Grand, Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML. John Wiley & Sons, New York, NY, 1998

 

[Grand99] M. Grand, Patterns in Java, Volume 2: A Catalog of Reusable Design Patterns. John Wiley & Sons, New York, NY, 1999

 

[Larman97] C. Larman, Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design. Prentice Hall, Upper Saddle River, NJ, 1997

 

[Vernnes98] B. Vernners, Inside the Java Virtual Machine. McGraw Hill, New York, NY, 1998

 

[Vlissides98] J. Vlissides, Pattern Hatching: Design Patterns Applied. Addison-Wesley, Reading, MA, 1998

 

Appendices