Posts

Showing posts with the label J2EE Design Patterns

Application Controller Pattern

Use an  Application Controller  to centralize retrieval and invocation of request-processing components, such as  commands  and  views . Let's discuss how Application Controller Design Pattern works with examples. This pattern is divided into a number of sections for simplicity like problem, forces, structure, solution, implementation etc. Table of Contents Problem Forces Solution Explanation Structure - Class Diagram, Sequence Diagram Participants and Responsibilities Implementation Consequences Applicability Real world examples References Read above topics on http://www.javaguides.net/2018/08/application-controller-design-pattern-in-java.html

Design Patterns used in Hibernate Framework

Image
In this post, let's discuss a different kind of design patterns which are widely used in the Hibernate Framework. Design Patterns denote the best computer programming practices in the object-oriented software development. Hibernate framework has been built by using the following design pattern or standard practices. I list few known design patterns used in Hibernate Framework. Please mention in a comment, if you know any other design patterns used in Hibernate Framework. You can also read my post of  Design Patterns used in Spring Framework Domain Model Pattern The domain model is treated as POJO in Hibernate. The domain model is an object model of the domain that incorporates both behavior and data. Read more about Domain Model Pattern here https://stackoverflow.com/questions/41335249/domain-model-pattern-example Proxy Design Pattern Proxy Pattern for lazy loading - https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/performance.html Proxy Pattern provides a surrogate ...

Design Patterns used in Spring Framework

Image
In this post, let's discuss a different kind of design patterns which are widely used in the Spring Framework. Design Patterns denote the best computer programming practices in the object-oriented software development. Spring framework has been built by using the following design pattern or standard practices. I list few known design patterns used in Spring Framework. You may interested in  Design Patterns used in Hibernate Framework Proxy Design Pattern Proxy pattern is used heavily in AOP , and remoting . A good example of proxy design pattern is org.springframework.aop.framework.ProxyFactoryBean . This factory constructs AOP proxy based on Spring beans.  The proxy provides a surrogate or placeholder for another object to control access to it. Read more details about Proxy Design Pattern here  Proxy Design Pattern Singleton Design Pattern Singleton design pattern ensures that there will exist only the single instance of the object in the memory that could provide servic...

Context Object Pattern

We can use a Context Object to encapsulate state in a protocol-independent way to be shared throughout your application. Context object pattern encapsulating system data in a Context Object allows it to be shared with other parts of the application without coupling the application to a specific protocol. For example, an HTTP request parameter exists for each field of an HTML form and a Context Object can store this data in a protocol-independent manner while facilitating its conversion and validation. Then other parts of the application simply access the information in the Context Object, without any knowledge of the HTTP protocol. Any changes in the protocol are handled by the Context Object, and no other parts of the application need to change. A Context Object�s main goal is to share system information in a protocol- independent way, improving the reusability and maintainability of an application. Table of content Problem Forces Solution Explanation Structure - Class Diagram, Sequ...

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 Activator Pattern

Image
In enterprise applications, a majority of the processing is done in a synchronous manner. A client invokes a business service and waits until the business service returns from processing. However, the business processing in some use cases takes considerable time and resources. The business processing might even span applications, possibly integrating with applications inside and outside the enterprise. For these long-lived processes, it is not feasible for application clients to wait until the business processing completes so in this case we want to invoke services asynchronously. Some long-running use cases take a long time. Instead of blocking the users, we can run these asynchronously JMS is a good example of  Service Activator Pattern - JMS (Java Message Service) is an API that provides the facility to create, send and read messages. It provides loosely coupled reliable and asynchronous communication. This pattern is divided into a number of sections for simplicity like pr...