Information River: A business technology blog

November 19, 2008

n-Tier Development: Something I Learned in School

One of the reasons I have returned to college is that most of my programming skills are self taught which means I had developed bad habits I was hoping to correct. The worst offense I was guilty of was mixing up all of the different elements of the applications. Part of this is the fact that I learned to program where the user interface was a text only command line so design was not much of a consideration and part of it that in past jobs I was the whole shooting match so I was in charge of all of the elements. Now I am a hardcore n-tier development believer. My classmates are probably going nuts with my insistence that we keep all of the layers as separate as possible but I remember some of my past projects and can see with hindsight how such disciple would have saved me hours of headaches. For those of you who are not in the development field n-tier is the principle that program functions should be separated into layers or tiers to keep the elements of the program flexible. The base layer is the actual data which underlies the system. The middle layer is usually called the business logic where the data is manipulated and, ideally, is turned into useful information. The top layer is the user interface which is where you the user interact with the system. The idea has gone from 3-tier to n-tier in the past few years as the options for devices people may be using increases. Some of my fellow students have a difficult time grasping the concept since we are working on projects where we are writing all of the functions ourselves. One of the ways of understanding the importance of keeping the layers separate is the idea of the blackbox. If I am developing the business logic I may have the program call a stored data procedure which returns the data the program needs. I may not know anything about how that set of data came to be, what form the SQL statement took or how the tables are structured, and I should not have to since that is a function of the data layer. To the application developer the data functions are blackboxes which perform their duties without the application developer having to know the details. I had read about n-tier before I went back to school but short of coming back I doubt I would have developed the discipline to do it right.

Comments: getComments update error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5