Freeze Business Logic Layer.

simplify
simplify @Image courtesy of digitalart/ FreeDigitalPhotos.net

Freeze Business Logic Layer.

Welcome to CodeSpread!

We regularly work on three-layer architecture for application development and always use some standard data layer and UI layer guidelines for design but what we always ignore is business logic layer. The reason behind maybe we are not comfortable in designing something which has no limits and no boundaries defined. If I share my experience; whenever we have tried to freeze our business logic, ironically, we felt a need to extend it to accommodate new requirements or sometimes for better optimization. Though, I have no correct answer for achieving best design for business logic layer but we can explore it a bit.

What is a Business Logic Layer?

One of the architecture followed in application development environment is Layer Architecture.With this architecture, Applications is trusted with different layers responsible for performing a designated role. It improves isolation of concerns. Mainly Layers are divided into

  • the Data Access layer
  • the Business Logic layer
  • the Graphical User Interface layer

For more information on architecture,read this article.

The business layer contains business entities. A business entity is a type of business component that represents a domain model object used within the service boundary. Typically, business entities represent real-world objects, such as customers and orders. It contains all the business rules that are applied to data exchange process which happens between the presentation layer and the Data access layer.

Business rules describe the operations, definitions and constraints that apply to a user/community/organization. To understand it, check these examples

  • A customer is entitled for bonus offers if he has done a purchase of minimum limit.
  • User is not allowed to register if it does not adhere to specific guidelines.
  • Employer can enlist constraints and conditions on employees of the organization.
  • Legal rules

Benefits of Business Logic Layer

  • Flexibility: Business Logic Layer which provides decoupling from the application and allows the flexibility to build other applications on top of it in the future.
  • Maintainability:  Business Logic Layer optimizes the way that the application works when deployed in different ways, and provides a clear delineation between locations where certain technology or design decisions must be made.
  • Reusability: Business Logic Layer follows components based architecture and can be reused in different business models.Each logical layer contains a number of discrete component types grouped into sub layers, with each sub layer performing a specific type of task
  • Scalability: Business Logic Layer can perform well in extended conditions.

Guidelines for Business Logic Layer Design

  • Loose coupling is the key: Different patterns are available to implement loose coupling like Factory Design Pattern, Singleton Pattern.The business layer should know only about the layer below (the data access layer), and not the layer above (the presentation layer or external applications that access the business layer directly).
  • It is always a good idea to use a separate business layer where possible to improve the maintainability of your application.
  • Identify the responsibilities of your business layer. Use a business layer for processing complex business rules, transforming data, applying policies, and for validation.
  • Do not mix different types of components in your business layer.Use a business layer to decouple business logic from presentation and data access code, and to simplify the testing of business logic
  • Reuse common business logic. Use a business layer to centralize common business logic functions and promote reuse.
  • Identify the consumers of your business layer. This will help to determine how you expose your business layer. For example, if your business layer will be used by your presentation layer and by an external application, you may choose to expose your business layer through a service.
  • Reduce round trips when accessing a remote business layer. If you are using a message-based interface, consider using coarse-grained packages for data, such as Data Transfer Objects. In addition, consider implementing a remote façade for the business layer interface.

reference:http://msdn.microsoft.com/en-us/library/ee658103.aspx

There is no exact understanding about design of Business Logic Layer which can be taught but people can only learn through their experience. I really appreciate, if people can contribute their experience to improve this article.

Author: hershey

A passion for knowledge drives me to do programming, A passion for programming drives me to create something different, A passion for creation drives me to spread the knowledge.

Share This Post On

0 Comments

  1. nice superb explaination

    Post a Reply
  2. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

More from CodeSpread:

  • Agile Encounters UnpredictabilityAgile Encounters UnpredictabilityWhat is Agile? Wikipedia says “Agile software development is a group of software development methods based on iterative and incremental development, where requirements and solutions evolve through...
  • Few lines about Static code analysisFew lines about Static code analysisStatic code analysis We divide the term into two parts: Static+code analysis. Static in programming can be referred to as non-running/non-dynamic and code analysis is a process where the code is...
  • SDLC: Importance of Requirement Analysis.SDLC: Importance of Requirement Analysis.What is SDLC? SDLC is the acronym for Software Development Life Cycle or System Development Life Cycle.It is a conceptual model that describes the stages involved in development of a software or a...
  • User Interface DesignUser Interface DesignWhat is a User Interface? Webopedia says “Abbreviated UI, the junction between a user and a computer program. An interface is a set of commands or menus through which a user communicates with a pr...
  • Scrum is AgileScrum is AgileIn our last article,Agile Part 1, we have explained basics of Agile and now we are sharing an article on SCRUM What is SCRUM? Wikipedia says “Scrum is an iterative and incremental agile software ...
  • Lean in ITLean in ITWikipedia says ‘Lean IT is the extension of lean manufacturing and lean services principles to the development and management of information technology (IT) products and services.’ What are these ...
  • Best Practices: Does Professional Database exists?Best Practices: Does Professional Database exists?What is Database? Database is a structured set of data, which facilitates storage,search and retrieval. Databases revolves around tables and relationships between them. Imagine you have a truck lo...
  • Risk Management in IT: Another step for QualityRisk Management in IT: Another step for QualityWhat is Risk? Risk is an uncertainty. Here, this pertains to a situation where It is difficult to decide that whether a particular event will occur or not. But if it occurs then what impact it wil...