Layerd Architecture in Software Engineering

Layerd Architecture in Software Engineering

This article is by one of Leapset’s Tech Leads Sivakumaran Kathamutthu. You can read more by him on his blog:

Software architecturing is in a nutshell ,organizing software component which is specific for a one functionality in a system, architectured system will have multiple component each specific for one kind of functionality. But each component should be very independent from other component and also consistent on its own context.

In term of software development , there are few software architectural methodology available which has been identified by software professionals.So we are in a lucky stage that we can use it without thinking as crazily to identify the proper architecturing framework for our own application.The below appearing some of architecturing methodology which software professional now days using to develop theirs own application.

Most popular software architectural methodologies

  • Client–server model (2-tier, n-tier, peer-to-peer, cloud computing all use this model)
  • Database-centric architecture (broad division can be made for programs which have database at its center and applications which don’t have to rely on databases, E.g. desktop application programs, utility programs etc.)
  • Distributed computing
  • Event-driven architecture
  • Front end and back end
  • Implicit invocation
  • Monolithic application
  • Peer-to-peer
  • Pipes and filters
  • Plugin
  • Representational State Transfer
  • Rule evaluation
  • Search-oriented architecture (A pure SOA implements a service for every data access point.)
  • Service-oriented architecture
  • Shared nothing architecture
  • Software componentry
  • Space based architecture
  • Structured (module-based but usually monolithic within modules)
  • Three-tier model/Layerd Architecture (An architecture with Presentation, Business Logic and Database tiers)

in this article I am going to talk about my favorite architecture methodology ie. Three-tier model/Layerd Architecture in details and its pros and cone.

Three-tier model/Layerd Architecture (An architecture with Presentation, Business Logic and Database tiers)

A software layer is a common layer for J2EE application, where each layer is specific for one section of functionality of the system.The layers are organized in the system in such way that providing support and base functionality for other layers.

For example, lets talk about a ferry service system, when a ferry service need to handle the travels , it needs vessel details which is going to be traveled ,passenger or cargo type which going to be load kind of details.These details are basic details which ferry business service needs handle the travel.So those details are given by ferry data access layer.

Layering is not new concept for software industry.For example if you take the network protocols, it has been using this for years.For instant, FTP,Telnet and browse are services which depends on TCP/IP layer of network, so that if you need to modify or technology advances, you can do it without affecting to the FTP or Tel net configuration.

So in a nutshell we are keep apart the each layer with distinct functionality in a system.The below table outlines the layers which we can identify in a typical layerd architected software application.

Below is layers and its roles

Data Access Object layer – Manage reading ,writing, updating, and delete stored data,Commonly contains JDBC , Hibernate ,IBatis or some other Database connectivity code.

Business logic layer- Mange business processing tool and logic

Value Object Layer – Lightweight structures for related business information These are some times referred to as data transfer object

Deployment layer – Publishes business object capabilities.

Presentation layer – Control display the end user

Architectural component layer – Generic application utilities.Often these objects are good candidates for enterprise side user
The below immage articulate the tipical layerd architechering methodology with component.

Software Layers for J2EE Application

So lets go the each layer in details.

Data Access Layer.

Data access layer is specific for handling persistent unit of the application.Basically database SRUD operation.It manage access to persistent storage of some type.Simply the persistent storages are relational database,data xml file and data files.
The primary reason to separate the data access from rest of application is . that’s easy to switch data sources and share DAOs between application.
A couple of patterns for data objects are most common.The simplest pattern has each persistent object represent as a DAO .The more complex and but more flexible pattern in common use is a factory base pattern.

Value Object Layer

Every applicaion has data items that logically belongs and typically are used togather. Its programmatically canvenient and with enterprise beans performance enhancing to treat this logical group of data items as a seperate object.

Business Logical layer

Object in the business logic layer combine data with business rules, constraints and activities. Business objects should be separated from DAOs, VOs, and deployment layer, such as enterprise beans to maximize the possibility of reuse.Business objects often use and coordinate the activities of multiple data object.

Deployment layer

Object in the deployment layer called deployment wrappers, are the heart of J2EE achitecture.Deployment wrappers publish business object functionality to java classes that could be on separate machine.

Presentation layer

The presentation layer is the section of application responsible for everything end users physically see in the end user interface.This layer can be build using JSP,Servelet,Html,javascrip etc.

Architectural component Layer

Ideally all general utilities and components would be provided JDK.But accordingly your requirement , you will need to use third party libraries and component.All those component are reside in this layer.

Finally this is all about layered architecture.Next blog i will show coding project example for the Layered architecture.

Leave a Comment