Friday, November 17, 2023

Wrapper Controller Architecture Pattern

Wrapper Controller Architecture Pattern

Wrapper Controller Architecture Pattern solves complexity involved in exposing a Monolith Java Class into Rest API. By using this pattern, you can easily execute the Monolith Code ( Methods ) as service end points. Thus you can add this Rest API as Microservice within your cloud applications. You can then realize all benefits of the cloud application for your same monolith code.

This is part of "Lift & Shift of Monolith " Group of Architecture Patterns.

Problems addressed

Below are the problems that you face when you want to expose a single Java Class from a Monolith App as Rest API.

  1. You cannot scale out a single Java class from Monolith Application

  2. If you change the syntax ( Name or parameters) of methods of the Java class, it will break the consumer classes and you have to rewrite them as well.

  3. The formal data types of the parameters of the methods are not directly supported for Request / Response over Rest API
       
  4. We cannot slice a Java class from Monolith as it is A Single JVM Application

 How we solve the Problems

  1. We create a serverless application ( Spring Boot / Thorntail ) and add a REST Controller to the application and the Monolith Jar.

  2. The REST Controller will have an unique end point, corresponding to each public method of the Java Monolith Class. This includes Getter and Setters as well as service methods ( Business Functions )

  3. Call to REST Endpoints will further propagate to the Java Monolith Class. We wire the Java Monolith Class ( as service ) to this Controller Class

Wrapper Controller Architecture Pattern in Action

This pattern is used by Digital Transformation Tools. You can refer to below videos to understand how this pattern helps in Digital Transformation.


1) CodaGeeks Digital Transform Tool:
This Tool helps you to transform your Java Monolith Class into Microservice. This tool is also available as an service ( SAAS ). Refer http://www.codageeks.com for more details.

 
 
 
 
       2)  Miracle Open Transform:
     This is an Open Source project hosted on git hub. It has code which               implements this and other "Lift and Shift Monolith" group of patterns.






What is an Architectural Pattern?

According to Wikipedia,

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. Architectural patterns are similar to software design pattern but have a broader scope.

At Miracle Labs, we constantly innovate around real time problems and try to find solutions. While we were attempting early Digital Transformation Projects, we solved complex problems.










No comments:

Post a Comment