Beanstalk is an AWS-managed service that allows applications to run containerized in AWS. I am using Elastic Beanstalk (EB) to deploy quickly developed applications when the emphasis is on time-to-market rather than all the features of an enterprise application. For the purpose of this post, I will use the application called Genova as an example. It is a web application that exposes HTML and JSON content. Step 1 - Create a Spring Profile for AWS Beanstalk The configuration of Spring Boot application is applications-<profile>.yml files that are in the src/main/resources folder. By default, an EB deployment listens to the port 5000. For this reason I am creating the file application-eb.yaml with the following content: server: port: 5000 Step2 - Build the Spring Boot Application Using maven to create the Spring Boot jar file: mvn clean package -DskipTests This command creates a file with the name genova-1.0.0-SNAPSHOT.jar in the target folder. Step 3 - Create the Elastic Bean
This blog is about practical applications of Category Theory to the development of Java + Spring applications. I am looking at a design approach to simplify the development of web applications. Traditionally, this kind of back-office application is based on the Web 1.0 technology stack, using Spring Boot and Thymeleaf. My approach is to keep using Spring Boot but replace the generation of HTML with J2HTML and higher-order views. From a Category Theory point of view, we can look at web applications as mappings from the Category of Business Entities and the Category of UI Widgets. If we go one step further, both business entities and UI widgets are mapped to Java classes. Thus, we can view a web application (or a part of it) as an endofunctor in the Category of Java Classes. We define the View-functor as follows: domain(V) - Java classes representing business entities - e.g., Invoice, User - and, codomain(V) - Java functions that render the business entity as a DomContent object (DomCont