posted on Sunday, September 18, 2005 1:38 PM by scotts

Applications and Solutions* 1: Intimate relationships and soulless mutants

Intro:

A few months back, Ralf asked, and IMO answered the question “What is an Application.” He started the topic somewhere around here and then went on with a series of blogs about his new abstract, the Software Cell. If you like thinking about this kind of stuff, I highly recommend reading this series of blogs.

While the blog series went on with a number of real good reads, and a journey into some new abstracts, the basic answer to “what is an application” was answered like this: “A software application consists of exactly one host assembly (exe) and one or many custom made assemblies (DLLs) developed for a specific purpose.” Additionally, “A software solution then, is whatever we create to solve some customer or business requirement and it consists of 1 to n software applications.”

I loved this series of blogs, and I realize that I’m a bit late following up on this (we all have our reasons for falling behind on blogging; mine involved spending most of the summer being sick for the first time in about 20 years, and at the same time trying to stay heads down in large project at work). I think Ralf’s technically got the “what is an application” pretty well covered. The rest of this blog isn’t going to be an attempt to comment on, polish or refute anything about this series. However, it may help to at least read the first two entries in his series to understand a few references, concepts and pictures that I mention. The first two are pretty quick reads, and can be found here and here.

Applications and Solutions* 1: Intimate relationships and soulless mutants

Despite what is force-fed in tons of articles, blogs, MSDN best practices, etc., “Presentation Tier + Business Tier + Data Tier” is actually a dangerous and slippery architectural slope. No, I’m not going off the deep end. I’m still just as convinced as ever of the importance of proper layering and grouping of code responsibility. So, how can I say that “Presentation Tier + Business Tier + Data Tier” is a dangerous and very slippery slope? Namely misunderstandings. Sadly, misunderstandings combined with SOA hype, are really making a mess of a lot of applications today.

As I covered in Layer and Tiers and Bears, we often get all tangled up in terms; especially terms like Layers and Tiers, and Applications and Solutions. Generally when I say “Presentation Tier + Business Tier + Data Tier”, I’m really saying Presentation Layer, Business Layer and Data Layer. As in a simple application consisting of a UI project, a Business Application project, and maybe a separate Data Layer project (or at least clear division of responsibility of Business and Data Access within the Business application project.) And these projects all tied together make a simple application.

But, this is a very simple concept of an application. An overall solution can be made of many of these things all connected together. The Presentation Layer gets replaced with a Portal layer, which allows other applications to gain value from what it is that an application offers. Also, the Data Layer gets replaced with some other Adapter like layer so that our application can get at whatever resources it needs; data, files, documents, or other application services, etc. When I hear “Presentation Tier + Business Tier + Data Tier”, I assume others are really just oversimplifying things too, and really meaning the same thing. Which is a grouping of code layers to provide some value. And generally these code layers involve at least 3; a layer for people or other applications to get at the value added stuff, a layer that provides the value added stuff, and a layer that allows the value added stuff layer to get at resource it may need (like data or xml).

However, I’ve tried to stay away from saying Presentation Tier, and Business Tier because the word Tier has a whole other meaning to me. Ralf helped me realize that the reason I’ve had trouble saying Tier in these circumstances, is because when I say Tier, what I really mean is Software Cell; which is a triangle. And a triangle is really an application. And generally Presentation, Business, and Data Access (or Portal, Core, Adapter) are all part of an application, not separate applications. So, the reason I’ve always hesitated saying Presentation Tier and have instead chosen Presentation Layer, is because a Presentation itself cannot be an application; at least in a business application sense.

A Presentation Tier alone does not an application make. A Presentation Tier is really a portal designed for people to interface with an application. Similarly, a Web Service Tier is a portal designed for other applications to interface. In a SOA world, we have a lot of applications with portals for one another to interface. But in all of these cases: the Presentation Tier, the Web Service Tier, and the SOA portals, by themselves are not applications. By themselves, they are not triangles. Ralf informed me in one of his blog comments that in the German language, the word Tier and Layer really don’t have separate translations, and sort of both translate to the word “Schicht”. Perhaps this lack of true delineation between the two words is really at the root of the problem. When some people say Tier, others hear Layer, and we end up all twisted.

So, Presentation Tier might have different meanings to different people. A Presentation Tier as a portal that allows people to interact with an application makes sense to me. This is what I would traditionally have called the Presentation Layer. However if your description of a Presentation Tier means more of a SoftwareCell Triangle thing, then I have trouble understanding how this makes sense; especially if you are thinking that a Business Tier is another SoftwareCell Triangle of its own. Unfortunately, this becomes even more confusing because usually (thanks to the way we create and build projects within the VS IDE) we think of the Presentation project as providing 2 aspects of a SoftwareCell Triangle; host and portal. For example, a Windows Forms project alone provides both the host .exe for the overall application, and the user interface forms. Similarly, a .net Web Project automatically creates the host and portal relationship. You create a web project, and create some web forms, and you end up with a hosted web portal within IIS. So you get the Triangle and a user Portal to access to it. But if this alone is what you are calling a Presentation Tier, then this alone is not a complete application. It’s missing the most important part of a SoftwareCell Triangle; the black circle. I say the most important part, because this is really the core, the soul of what the application is all about. Everything else is just there to support and provide access to the soul.

Merriam-Webster Online Thesaurus describes “application” as the following: “the act or practice of employing something for a particular purpose” Presentation Tiers and Web Services can provide “the act or practice of employing”, but without the “something for a particular purpose”, I’m afraid we don’t have an application. And it’s the “something for a particular purpose” that is what it is really all about. In Ralfs’s Software Cell world, this “something for a particular purpose” is the black circle in the middle of the triangle. Additionally, I would suggest that this overall “act or practice of employing something for a particular purpose” is a very intimate relationship. In other words, the host, along with its portals and adapters, as well as the “something for a particular purpose” have a very close personal relationship, with familiarity about things that no one on the outside of the relationship should know about.

When we get the concepts of “Presentation Tier + Business Tier + Data Tier” definition all mixed up with the SOA craze, we begin loosing site of the application. We neglect the importance of this intimate relationship between “the act or practice of employing” and the “something for a particular purpose”. IMO, the importance of this intimacy in the overall definition of an application cannot be overstated. The architecture slope starts getting real slippery when assumptions are made that a “single application definition” is comprised of a Business Tier exposed as web services and a separate Presentation Tier application, which just uses these service. Now where is the application? Well, first of all it’s no longer an application; it’s maybe 2. But, its not 2 complete applications. It’s possibly 1 application, and 1 mutant application. I think a corollary in Ralf’s SoftwareCell world might be two triangles, one of which doesn’t have a black circle in the middle; it has no soul.

It’s possible that the Business Tier in this example is an application. It could indeed be a portal and host (i.e. Web Services on IIS) providing the “act or practice of employing” and then some stuff inside that makes up the “something for a particular purpose”; i.e. the core black circle.

But what about the Presentation Tier? Maybe we have a Web Project providing the portal and host (i.e. Web Forms running on IIS) which define the “act or practice of employing”, but where is the core “something for a particular purpose”, where is the soul? There are many assuming that the “something for a particular purpose” is simply the Business Tier app that we just describe above. However, by the definition constraints we are placing on ourselves, and the SOA misunderstandings, we only have access to speak to the web service portal part of the Business Tier application. And we’ve already described the Portal and IIS parts as only being the “act or practice of employing”. So, in a sense we are defining our Presentation Tier as providing the “act or practice of employing the act or practice of employing”. This doesn’t make an application. I’m not sure what this makes.

So now our overall solution* is comprised of possibly 1 application, the Business Tier, and 1 mutant called the Presentation Tier. Unfortunately it is the mutant thing that the users are going to interact with. So, what do we do?

First, we have to resolve to make the thing that the user is going to interact with be a first class application and not a mutant. This means that we need to provide both the “act or practice of employing” and the “something for a particular purpose” in one tight knit intimate relationship. In other words, the web application should host and provide a user interface (portal) directly into it’s own “something for a particular purpose” that it has a very close, friendly, and private relationship with. In developer terms, it needs to directly reference a dll (or group of dll’s), which provide the core “something for a particular purpose”. It also makes all the sense in the world to assume that this application will need adapters to other resources; i.e. other applications and natural resources (files, data, etc.)

If we are in an environment where it is necessary to provide this Business Tier as a separate application service with a portal for other applications to access (i.e. web services) then what do we do? First, is it possible that the same “something for a particular purpose” could also be used by the Presentation Tier? Can it reference the same set of “something for a particular purpose” dll(s) that the Business Tier portal references? And can it do this within the same host? If so, the Business Tier could really be a portal used to provide application level “act or practice of employing [something for a particular purpose]” and the Presentation Tier could just be looked at as another portal providing people level “act or practice of employing [something for a particular purpose]”, all to the same core application? In other words, can we look at this as a single SoftwareCell Triangle, with 2 portals; one for applications and one for people?

If this is an unreasonable expectation, based on your environment, then we’ll need to build some new “something for a particular purpose” dll(s) that will become the core black circle, the soul, of this thing we are calling the Presentation Tier application. These new dll(s) will provide the Presentation Tier with its close intimate companion, which will provide the overall “something for a particular purpose” part of the Presentation’s application. The Presentation Tier application can have an adapter that allows it to use the services of the Business Tier application; i.e. web reference, and some associated pre and post processing code. However, the newly created “something for a particular purpose” dll(s) will undoubtedly end up duplicating a lot of the efforts already built into the “something for a particular purpose” dll(s) used by the Business Tier application.

I think this is the most overlooked and understated aspect of this type of architecture. This thing we are calling the Presentation Tier in this example, is an application. And as such, it has to have it’s own core “something for a particular purpose”; it has to have it’s own soul. Without a soul it’s a mutant. The services of this thing called the Business Tier can definitely be used, or adapted to by the Presentation tier application. But they are just that, services that are adapted to by this new Presentation tier application. These adapted services cannot alone be the soul for the Presentation Tier application. The Presentation Tier won’t be able to have the same intimate relationship with the Business Tier Portal, as the Business tier Portal would with it’s own internal core. It won’t be able to know all the little things about this relationship, and will need to duplicate what it doesn’t know.

As soon as we start looking at “Presentation Tier + Business Tier + Data Tier” as completely independent applications; i.e. seperate SoftwareCell Triangles, we can loose sight of what and where the real application is. It’s a slippery slope that only gets slipperier with glazed over SOA hype. The SOA hype gravitates us to assume the Business Tier must be a service, and a web service at that, which then forces the Presentation Tier to be a separate application with an adapter to that service’s portal. All of that, in and of it’s self is fine, if that is what you want or need to do. But, remember that you now must also create a core soul for this Presentation Tier. And undoubtedly, this core sole will have to duplicate quite a bit of the core soul functionality provided by the Business Tier’s core soul. It will just happen.

I’m not suggesting that all business process will be capable, or best suited to be simple in process components (any business process core will need to use resources, and these resources should be acquired via adapters, and they may consist of other applications and services, or simply data, files, etc.) I am suggesting that the good ole’ “Presentation Tier + Business Tier + Data Tier’ approach towards application development is actually a dangerous, slippery slope. And this danger is only complicated with SOA hype. Be careful.

Note:

I am by no means inferring that Ralf’s SoftwareCell abstractions make the assumptions about “Presentation Tier + Business Tier + Data Tier” suggested here. Just the opposite, abstractions like SoftwareCells can help break the need to constantly describe things in terms of “Presentation Tier + Business Tier + Data Tier”

* Solutions – I am not referring to a visual studio .sln thing here. I am referring to some 1 to n number of software applications cooperating together to create some new additional value to a business, customer, robot, or whatever.

Comments