8

People often claim that they are following a '3-tier (or n-tier) architecture', and sometimes they then claim to be switching to a Domain Model. But I really never have understood what this mythical '3-tier architecture' is. It seems to have no formal definition. Whereas there are numerous references and examples around that explain and demonstrate the Domain Model pattern, any reference to 3-tier simply suggests you should separate your code into UI, Business Logic and Data Access Layers. And that's all they seem to say.

What I find particularly strange is that to me, Domain Model is the perfect embodiment of this 3-tier paradigm. the ORM and mapping files are the Data Access Layer, the Domain is the Business Logic, and the UI is the, well, UI. So why do people talk as though it is something new and different, and something they should switch to?

Before I saw people implementing Domain Model, most applications were UIs accessing stored procedures with the logic split across the UI and the SPs. Sometimes there were a few assemblies called 'UI', 'BLL' and 'DLL' but usually these were just mediators between the UIs and SPs, leaving more places for the logic to be randomly spread across.

So what is this mythical '3-tier' architecture? Does it really even exist? and if so, where are some examples of it implemented well?

1 Answer 1

9

The definition of 3-tier architecture is a special case of the n-tier architecture. In an n-tier architecture, there are n components and each one only interacts with the component immediately "above" and "below" it. A three-tier architecture has three such components.

Typically, a three-tier architecture consists of a user interaction layer, the business rules layer, and data services (including databases) layer. The user interaction layer only issues requests to the business rules layer, which retrieves data from the various data services, processes it, and then returns it to the user through the user interaction layer.

The n-tier architecture is an example of an architectural pattern (or architectural style). It simply defines some constraints on the architecture of the system. By itself, it is not a complete view of the architecture of the system. Although I'm sure that there are systems that implement something like a three-tier architecture, it is just a pattern that's meant to set up a discussion for additional design and implementation of a system.

2
  • Basically, what you are saying is that a 3-tier architecture is an architecture which has 3 tiers ... which is exactly the right answer :-) Oct 17, 2011 at 10:10
  • @JörgWMittag Pretty much. But I'm also saying that it's just a pattern used to simplify communication between system architects, application designers, and programmers. In reality, it's a special case of the n-tier architecture which is a special case of the client-server architecture.
    – Thomas Owens
    Oct 17, 2011 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.