Fork me on GitHub

OfficeFloor Tutorials

Once you have installed the OfficeFloor plug-in you have the tools ready for the below tutorials.

The tutorials refer to WoOF, which stands for Web on OfficeFloor. It is a set of prefabricated plug-ins for OfficeFloor that enables OfficeFloor to act as a high performance Web Application Server. Due to inversion of coupling control (IOCC), you will see that the prefabricated plug-ins are much more re-usable than simple Dependency Injection framework objects.

All tutorials are part of the OfficeFloor continuous builds and their source can be found here.

Introduction

The following tutorials demonstrate the IOCC concepts behind OfficeFloor.

Tutorial Description Covered
My first application Walks through the simple steps to create and run an OfficeFloor web application.
Continuation Injection Controlling execution flow (avoiding heavy coupled refactoring costs). @Next , @FlowInterface 
(Continuation Injection)
Exception handling Handling exceptions. @Parameter
Dependency Injection Dependency injecting a plain old java object (POJO). Dependency Injection
Thread Injection Thread injection to performance tune the application. Thread Injection

Test and Deploy

Many frameworks focus on features and how wonderful they are in production. While this is important, much of the application costs can be in maintaining and testing changes to the application outside production. Many frameworks forget this and this creates increased difficulty for developers and subsequently extra costs.

As production is typically the least complicated environment (just needs to handle scale), OfficeFloor ensures the road to production is also easy for development teams. Therefore, in the importance of test driven development and continuous integration / DevOps cycles, the next tutorials focus on testing and deploying.

Tutorial Description Covered
Test Testing the application Unit / System / Integration testing
Environment Configuring the application @Property, Profile
Deploy Deploying the application Deploy , Docker
Servlet / PaaS / Cloud Deploying to Servlet container (PaaS / cloud) Servlet, PaaS / Cloud

REST server for mobile / single page applications in the cloud

Now that there is an understanding of the OfficeFloor basics, the following tutorials look at supporting mobile / single page applications.

Tutorials focus on web based single page applications (for ease of running). However, the REST functionality works just as effectively for mobile applications.

Tutorial Description Covered
REST REST REST , @PathParameter , HttpException
Static content Serving the single page files /PUBLIC
Logging Loggers identifying location within application Logger
JWT JWT Security JWT Security
JWT Authority JWT Authority JWT Authority
Small JWT Application Single server with JWT Security and JWT Authority Combined JWT Security / Authority
OpenAPI / Swagger Document via OpenAPI / Swagger OpenAPI / Swagger
CORS Cross-origin resource sharing Web intercepting

More in depth concepts

The following tutorials focus on building out functionality of your application.

Tutorial Description Covered
Activity Modularising configuration Activity (Section)
Transaction Managing transactions with Governance. Governance
Variables Passing state downstream for flows. Out<T> , @Val
Managed Object Source Dependency injecting a customised managed object. ManagedObjectSource
Start Up Ordering Ordering the start up of ManagedObjectSource instances. start-before, start-after
Thread Affinity Thread Affinity Executive
Kotlin Using Kotlin. Polyglot Kotlin
Scala Using Scala. Polyglot Scala
JavaScript Using JavaScript. Polyglot JavaScript

Integrations

OfficeFloor can integrate dependency injection frameworks, like Spring, as a library of dependencies. Hence, most integrations with third parties can be via other dependency injection frameworks.

The following are some integration examples.

Tutorial Description Covered
Spring Wiring in Spring beans (ease of re-using code from dependency injection only frameworks) Supplier
Flyway Migrating databases on start up Flyway
Reactive Using Reactor for reactive programming. Reactor
Cats Effect Using Cats Effects Cats Effect
ZIO Using ZIO ZIO
Google Sign-in Sign-in via Google Google Sign-in
Objectify Objectify for Google App Engine datastore Objectify
Google App Engine Google App Engine Google App Engine
PayPal Payment via PayPal PayPal

Migration Guides

The following tutorials detail sequential steps to migrate existing applications to take advantage of OfficeFloor's IOCC.

Spring Web MVC

Step Tutorial Description Covered
1 Embedding Spring Web MVC Running Spring Web MVC @Controller within OfficeFloor Spring Web MVC @Controller
2 Spring Web MVC @Controller Procedures Integrating Spring Web MVC @Controller as a Procedure to start taking advantage of OfficeFloor features Spring Web MVC @Controller Procedure
3 Migrate Spring Web MVC Removing dependency on Spring and taking advantage of all OfficeFloor features Migrate Spring Web MVC @Controller

Spring Web Flux

Step Tutorial Description Covered
1 Embedding Spring Flux Running Spring Web Flux @Controller within OfficeFloor Spring Web Flux @Controller
2 Spring Web Flux @Controller Procedures Integrating Spring Web Flux @Controller as a Procedure to start taking advantage of OfficeFloor features Spring Web Flux @Controller Procedure
3 Migrate Spring Web Flux Removing dependency on Spring and taking advantage of all OfficeFloor features Migrate Spring Web Flux @Controller

JEE Web Archive (WAR containing Servlets)

Step Tutorial Description Covered
1 Embedding WAR Running WAR within OfficeFloor WAR
2 Servlet / Filter Procedures Integrating Servlets / Filters as Procedures to start taking advantage of OfficeFloor features Servlet / Filter Procedure
3 Migrate Servlet / Filter Removing dependency on JEE and taking advantage of all OfficeFloor features Migrate Servlet / Filter

JAX-RS

Step Tutorial Description Covered
1 Embedding JAX-RS Running JAX-RS within OfficeFloor JAX-RS
2 JAX-RS Procedures Integrating JAX-RS as Procedures to start taking advantage of OfficeFloor features JAX-RS Procedure
3 Migrate JAX-RS Removing dependency on JAX-RS and taking advantage of all OfficeFloor features Migrate JAX-RS

Dynamic web page for prototyping and simpler applications

While richer applications are expected, sometimes you just need something up and running. The following tutorials demonstrate the ease of getting dynamic web pages running with OfficeFloor.

Tutorial Description Covered
Wireframe prototyping Build working web prototypes and then later extend into a working web application. #{link}
Dynamic web page Rendering dynamic content. ${bean ... $} , ${property}
Interactive web page Handling of requests to provide interactive pages. #{link} , @HttpParameters
Session state Storing state between requests within the HTTP session. @HttpSessionStateful
Generating HTML Render generated HTML. @UnescapedHtml
AJAX Servicing AJAX requests from JavaScript. @HttpObject , ObjectResponse , @NotRenderTemplateAfter
Sectioning content Sectional rendering content. <!-- {section} -->
Template Inheritance Inheriting sectioned content. <!-- {:override} --> , <!-- {!} -->
Secure Page Shows the ease of securing a page Template Secure
Secure Link Demonstrates the ease of securing a link Link Secure
Authentication Easy means to provide authentication Authentication