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 .................................................................................27 Systematic Refactoring ....................................................................................32
Refactoring to clean up codes ..............................................................................32 Refactoring Creation of Quiz: refactoring to factory pattern ..........................................37 Refactoring the Problem-Quiz-Portfolio hierarchy