Legacy Refactoring Series (part 1)
Legacy Refactoring Series (part 1)
Submitted by webmaster@testdriven.com (Links) on Thu, 14/04/2005 - 17:06. refactoringIn its current state, the codebase is not as healthy as it could be. There are three classes in this system. The first class is the GUI, which is pretty simple and self contained. There might be some logic in it that could be refactored out into a Controller-type class, but I havent looked at it closely enough yet to know. In the same file as the GUI is the worker method for the thread where all the work happens. Not sure if I like this or not yet, but Ill visit it at some point. There is a class called Assembly2UML which is the main worker class for this tool. This class is responsible for finding all the types and their relationships, and it has one real method in it, Serialize, and its 200 lines long. Well revisit this Serialize method shortly, as it is our original target for refactoring. Finally, there is another file called XMIServices, which houses both the interface IUMLFormatter and its derived type XMIFormatter. It is the responsibility of this XMIFormatter to be called occasionally from the Serializer to output the growing XMI model as it forms.
Thats the basic architecture. As it is, it would be very difficult to test, so Id like to make few minor modifications to let us get it under some very simple tests.
Author: Brian Button
Published: March 30, 2005
Thats the basic architecture. As it is, it would be very difficult to test, so Id like to make few minor modifications to let us get it under some very simple tests.
Author: Brian Button
Published: March 30, 2005
