I'm looking at a Delphi form that is typical of a 1995-2000 development when RAD style development using data aware controls was all-the-rage. At the time, there was a lot to be said for this technology: fast turnaround, prototyping, etc. However, ease of future enhancement and automated testing suffered as a result.
So, the object of this exercise is to refactor this form so that it no longer uses the data aware controls. Instead it will have a 3-tier architecture where the concerns of View (the form itself), Controller (the logic that controls the form and access to the data) and Model (the data module and the associated object model mappings) have been separated.
Why refactor if it's not broken?: I'm going to need to add some advanced features to this form such as a batch insert. This could be done with the current data-aware set-up but it would become rather messy with the extra logic tied up in the OnPost handlers (and all the flickering!). I'm also going to want some DUnit tests in there for this new feature.
I'll try to give a daily update on what I've done, and any problems that I've encountered and solutions to these. I wont be able to provide screen-shots or samples of code, but will describe the processes that I'm using.
Technical: I'll be using Delphi 6 (mmm retro!) and the database is Oracle 8i.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment