I wrote several programs to check my portfolio – to load the latest data, to see how my asset allocation is holding up, to look at the funds over time, and so on.
When I went to improve the programs, I discovered chaos. I used different names for the same thing in different programs. Sometimes I summarized the data immediately from the database, sometimes I did it later. Same with filtering data. I’d fix it one way for one program then a different program would break.
I decided to make the effort to convert my standalone programs into a three-tier architecture (Figure 1).
- Presentation Tier.
- 1st action. Presents the initial screen to the user (me) from which I choose the action to do.
- 4th action. After the other tiers do their work, this tier will display the result.
- Database Tier.
- 2nd action. The presentation tier sends my chosen action to the database which gathers the raw data required.
- Application Tier.
- 3rd action. Using the data sent from the Database tier, the application tier selects, summarizes, and formats the data. It then sends it to the presentation tier for display to the user.
Gain for the Effort
It does take work to smooth out the differences and to segment