Two-Tier Or Three-Tier?


N by !Raimyu on deviantART

The N-Tier pattern, when used in software development, is one step above my usual topic of design patterns. They are commonly called architectural patterns which are concerned with the software at a macro level (eg. ‘the big picture’).

Some time ago, I was tasked before of maintaining a line-of-business sales system from a fairly large company.Their technical design spec was quite clear that the “…architecture is divided into three (3) main layers…” which, in theory, should make my job easier. As I browsed through the code though, one thing became apparent: It was not a 3-Tier Arch like the docs said, but a more traditional server-client setup~ Now, what is the difference exactly?

A Server-Client architecture (which is, technically, a 2-Tier Arch) is concerned primarily with the centralization of data and sometimes the balancing of process load to either the server or the client. The data and the business rules (stored procs) are stored at the server, with a thin client app to present the results (forms, grids & reports)- which is exactly how the LoB app above works.

S+C’s Advantages over 3-Tier Arch

  • Faster Development (less design, less code)
  • Can offload processes to the server to accommodate for weaker client workstations, or vice versa if the server is the performance bottleneck
  • Can change business logic without re-deploying new software to the user

Three-tier applications on the other hand, is focused on the separation of responsibility to facilitate control and change. The Data Access Layer is usually separated physically such as a Database Server, but is mostly kept “dumb” except for very few performance functions. The Business Logic Layer on the other hand is a more robust collection of libraries and maybe a few dynamic scripts that enforces the rules of the application. This ranges from who can access which data, data validation, up to caching, etc. Lastly, the topmost Presentation Layer is the combination of UI Rendering (Windows Forms, ASP.Net, WPF, etc.) and UI Logic (Parallel processes, Sessions, States, anything that is not business-related logic).

3-Tier’s Advantages over S+C Arch:

  • Modular, and thus easier to maintain. You can replace one layer with another completely with very minimal code changes (switch from Windows Forms to WPF or ASP.Net with zero impact on business logic or database schema)
  • can perform Unit Testing very easily. Since all of the business logic is contained on libraries, you can hook the DLLs easily on a controlled testing environment.

We have to consider both sets of factors above in order to decide which architecture to use when designing our software~

Job @ Honda/Isuzu

At exactly 8:00am GMT+8 tomorrow (10619), I’ll officially be an employee of Ayala Motors under their Honda/Isuzu team :D It’s nice to have a permanent job instead of just jumping around with freelance and open-source development stuff~

Fun Facts: I was without a permanent job for approximately…

  • 2 Months and 6 Days or
  • 9 Weeks (rounded down) or
  • 67 Days or
  • 1,608 Hours or
  • 96,480 Minutes or
  • 5,788,800 Seconds o.0;

Of course I will still try to contribute to the Open Community, but in the meantime (at least while I’m still on probationary status) I will probably limit my posts here. I still have a lot to talk about, in fact: I have a post about the Difference between CS and the IT courses and another post about Careers and How to Make/Break one. I will post both of them ASAP, but I guess its sayonara for now~ See ya :P

Hadou 91: Senjyu Kouten Taihou

Hadou91

Limit of the thousand hands
Respectful hand, unable to touch the darkness
Shooting hand, unable to reflect the blue sky

The road that basks in light
The wind that ignites the embers
Time that gathers when both are together
There is no need to be hesitant, Obey my order

Light bullet -
Eight bodies -
Nine items -
Book of heavens -
Diseased treasure -
Great wheel -
Grey fortress tower

Aim far away,
Scatter brightly and cleanly when fired

Thousand Hands Bright Sky Cannon

~Urahara Kisuke, Bleach 402