Posts

Showing posts with the label Business Tier

Converter Pattern

In this post, we will discuss most commonly used  Converter Design Pattern  in Java/J2EE projects. Thanks to Java 8 features not only provides a way of generic bidirectional conversion between corresponding types but also a common way of converting a collection of objects of the same type, reducing the boilerplate code to the absolute minimum. we have written source code for this pattern using Java 8 features. Intent The purpose of the Converter Design Pattern is to provide a generic, common way of bidirectional conversion between corresponding types, allowing a clean implementation in which the types do not need to be aware of each other. Moreover, the Converter Design Pattern introduces bidirectional collection mapping, reducing a boilerplate code to a minimum. Source code The Converter Design Pattern is a behavioral design pattern which allows a common way of bidirectional conversion between corresponding types (e.g. DTO and domain representations of the logical...

Transfer Object Assembler

Use a  Transfer Object Assembler  to build an application model as a composite Transfer Object. The Transfer Object Assembler aggregates multiple Transfer Objects from various business components and services and returns it to the client. This pattern is divided into a number of sections for simplicity like a problem, forces, solution, class diagram, sequence diagram etc. Table of contents Problem Forces Solution Structure - Class Diagram, Sequence Diagram Participants and Responsibilities Implementation Consequences Applicability References Problem (Problem section describes the design issues faced by the developer) You want to obtain an application model that aggregates transfer objects from several business components. Read more on http://www.javaguides.net/2018/08/transfer-object-assembler-pattern-in-java.html

Value List Handler

The  Value List Handler  provides the search and iteration functionality. To perform a search, the Value List Handler uses a  Data Access Object  to execute the query and retrieve the matching results from the database. It is hard to understand this pattern so my suggestion is to go to  source code  section and have a look at code step by step gives you more clarity. This pattern is divided into a number of sections for simplicity like problem, forces, solution etc. Problem (Problem section describes the design issues faced by the developer) You have a remote client that wants to iterate over a large results list. Forces (This section describes Lists the reasons and motivations that affect the problem and the solution. The list of forces highlights the reasons why one might choose to use the pattern and provides a justification for using the pattern) You want to avoid the overhead of using EJB finder methods for large searches. You want to implement a...

Service Locator Pattern

The service locator design pattern is used when we want to locate various services using JNDI lookup. Considering high cost of looking up JNDI for a service, Service Locator pattern makes use of caching technique. For the first time, a service is required, Service Locator looks up in JNDI and caches the service object. Further lookup or same service via Service Locator is done in its cache which improves the performance of application to great extent The  Service Locator Pattern  is to transparently locate business components and services in a uniform manner. Spring Framework internally uses Service Locator pattern to manage Dependency Injection .These days, Service Locator isn�t of much use anymore, except in very small proprietary projects. For the rest, use a good dependency injection framework like spring or guice. Let's discuss how Service Locator Pattern transparently locates business components and services in a uniform manner. Reading theory is always boring ...

Business Delegate Pattern

The  Business Delegate pattern  adds an abstraction layer between presentation and business tiers. By using the pattern we gain loose coupling between the tiers and encapsulate knowledge about how to locate, connect to, and interact with the business objects that make up the application. Business Delegate Pattern  is used to decouple presentation tier and business tier. Let's discuss how  Business Delegate Pattern  decouples presentation tier and business tier with a class diagram and source code . This pattern is divided into a number of sections for simplicity like problem, forces, solution etc. Table of contents Problem Forces Solution Structure - Class Diagram, Sequence Diagram Participants and Responsibilities Implementation Consequences Applicability References Read more on http://www.javaguides.net/2018/08/business-delegate-design-pattern-in-java.html