Refactoring software using design patterns

Disponível somente no TrabalhosFeitos
  • Páginas : 42 (10268 palavras )
  • Download(s) : 0
  • Publicado : 15 de abril de 2013
Ler documento completo
Amostra do texto
Refactoring Software Using Design Patterns

Masatomo Noborikawa
Under the direction of Dr. Eugene Wallingford Research Project for Masters of Science in Computer Science University of Northern Iowa

May 5, 2003

Table of Contents

1. Introduction..............................................................................................................3 2. Overview of Tools...................................................................................................5 2.1 2.1
What are design patterns? ..................................................................................5 What is Refactoring? ...........................................................................................7

3. Basic Facts...............................................................................................................9 4. Initial Prototype .....................................................................................................11 4.1 4.2
First Design Attempt........................................................................................11 First Refactoring.............................................................................................16

5. Development Episode ............................................................................................25 6. Modified Prototype ................................................................................................27 6.1 6.2 6.2.1 6.2.2 6.2.3
Modified Design Attempt .................................................................................27Systematic Refactoring ....................................................................................32
Refactoring to clean up codes ..............................................................................32 Refactoring Creation of Quiz: refactoring to factory pattern ..........................................37 Refactoring the Problem-Quiz-Portfolio hierarchy.....................................................42

7. Conclusion .............................................................................................................52 References....................................................................................................................54

2

Chapter 1

Introduction
Designing a software system prior to implementation often results in designsthat are incomplete or incorrect. Creating a good design is difficult because designers do not always know everything they need to know about the solution before writing the program. Often, the programmer must correct mistakes in the design as he comes to understand the problem and come up with better solution while writing the program. Even when the programmer comes to know that something is notright in the design, he might not often be able to come up with the correct solution right away. The process of "refactoring" guides the programmer as he identifies weaknesses in the design and code and provides methods to improve them. This research project investigated the use of design patterns and the application of various refactoring techniques as a means to trigger modifications to designsand programs that preserve the functionality of the system while improving the quality of the software. This approach offers a powerful set of tools for programmers to use as they evolve their designs throughout the writing of a program. In this research project software called Basic Facts was developed from scratch. Varieties of refactoring techniques and design patterns were applied to enhance itsfunctionality. The details of the sequences of these developments are illustrated throughout the paper which is sub-sectioned in the form of chapters. Chapter two provides an overview of what design patterns and refactoring are, and what are their advantages and disadvantages. They are essential tools for this development. Chapter three explains the fundamentals of Basic Facts and its very...
tracking img