Ohh, too much code.

Posted on July 14, 2007

I decided to practice and wrote a simple GUI application. It is a simple contact list manager with persistent contact list. With test driven development to design the application, Presenter First pattern as a variant of MVP pattern, and Mocks for testing.

files.png

I like the result: program structure is elegant, classes are small and cohesive, and easily tested. However I had to write 9 classes, 7 test fixtures and 7 interfaces just for a simple contact list manager.

I can modify view and it wouldn’t require a lot of changed in the other classes. Because application is developed on top of interfaces and events I can replace GUI view with Web or command-line interface and it would still work. I can change storage from file to database and it will not affect any other parts of the application.

The design of the view and presenter classes is simple but design and testing of object interactions take a lot of time.

I did not have to do any problem solving for my models, they are simple and I did not spend a lot of time on them. However on a realistic project that will be different.

What I don’t like is the amount of code I had to write, there must be a better way! With less code and with same confidence in the behaviour.
I also think that if I increase the complexity 10 times, I would have difficuly keeping the whole program design in my head. The must be a way to document the design without spending too much time on writing and drawing stuff.

Filed Under Uncategorized |

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name

Email

Website

Comments

For spam detection purposes, please copy the number 7456 to the field below:

© Copyright 0xDEADBEEFCAFE • Powered by Wordpress • Design by Sebastin.

free web hit counter