About Marco Di Stefano

Marco is a software engineer specialized in software architecture and process automation. He has been involved in all the software v-cycle phases and actually he works for the railway industry.

Multilayered Architecture (3) – The Application Layer

Introduction

As Business Documents are considered the input for the Domain Layer, System Requirement Specifications are the main input document for the Application Layer. Scope of this layer is to provide an implementation of the defined requirements for the system. So it is easy to understand that most of the logic contained is process oriented and so linked to a specific system implementation.

What is a Business Process?

In a general view, a Business Process (or simply Process) can be considered as a composition of several tasks, that composed together following a certain flow responds to the goal of automate a specific functional requirement. A process is generally mapped to a specific requirement, so it does not have a good chance to be reused by other process (except when a parent process composes several smaller processes), but a single task instead will probably have. What are the different types of tasks a process can compose? We could think to identify 3 main types: Business Tasks, Utility Tasks and Application Task.

Business Tasks

As discussed in a previous post The Domain Layer, a Business Task is considered to be agnostic logic that is part of the business model of the designed domain. To give a clear example, all logic related to a Factory or a Repository or a Validation Rule is considered as Business Task. To deeper analyze, what we will have inside a Factory is logic that permits to create a Business Entity in a state that is immediately considered as business validated. This code will surely be used in several processes, where for example several entities must be created at once.

Utility Tasks

Utility task is the best example of agnostic logic, cause it is naturally not related to any specific process or entity, as it simply provide valuable and reusable logic. An example of a utility tasks can be a task that given two points return their distance, or given a text return a formatted text following a certain format condition. Where this code is located depends on its purpose: if it is related to certain domain entities it could be in the domain layer, or if not related to any domain entity could be in the application layer. Sometimes, when working in an enterprise-wide environment, could be also interesting to have another layer with only utility tasks, to permit to be reused and shared between different applications. In an SOA for example it is normal to have a category of services labeled as Utility Services residing in a separate layer.

Application Tasks

An Application Task accomplishes the implementation of logic that is in the System Requirements but is not part of the Business Model of the Domain. I usually try to apply this definition, even if it is not always clear specially when business and system documents are not well separated (and this is the most common case…). Another way to describe an Application Task is as logic that extends features provided by Business and Utility Taks.

 The Process Logic

Finally Process Logic is considered all that logic that simply composes several tasks in a pre-designed logic flow, handling Exceptions and managing Transactions. So a Process normally does not implement any pure logic, but simply composes existing logic into a new configuration; that is why we could also classify it as a Controller. Processes are considered the entry point for each interaction with the system. WS-BPEL for SOA is an example of Language for process definition. For a desktop application, Processes are what UI Actions will directly call.

Application Services

As the Application Layer should stay agnostic about the Infrastructure implementation, sometime is necessary to delegate the Infrastruture Layer to implement application logic defined in the Application Layer. This is simply done as for the Domain Layer by defining simply the interface of the logic and then use the concept of interface-implementation separation, as discussed in Multilayered Architecture, to recall the actual available implementation of the logic. The following figure shows a final picture of what an Application Layer could contain.

κατάλογος

Conclusions

The Application Layer contains logic that in most of the cases is specific to a system implementation. Anyway, to foster Reusability, it could always be separated in small horizontal layers that could be reused and integrated in different applications. User Interface and Infrastructure related technologies should still be kept away from this layer.
 

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


four − 1 =



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close