There is much more to Apache Isis than only creating user interfaces, it is a full stack rapid application development framework focused on domain driven design. But rather than talking about it, let’s see a complete application created with Apache Isis.
SEMAT Essence Kernel
To learn Apache Isis, I decided to implement the SEMAT model and deploy it to OpenShift Online asa Docker container. Simply said, SEMAT (Software Engineering Method and Theory) Essence Kernel is a OMG Standard that helps define among other things a framework for describing the state of software projects from multiple perspectives (called alphas).
The idea is, that every project can be described in a generic way using the following seven alphas:
Stakeholders, Opportunity, Requirements, Software System, Work, Team, Way-of-Working. And each Alpha can be in one or multiple states, for example, the
Stakeholders can be: Recognized, Represented, Involved, In Agreement, Satisfied, etc. In addition, each state has certain items to be satisfied before an Alpha can be transitioned to that state.
As you can see, this is a pretty simple domain model with a state machine logic behid it.
The Showcase Application
Enough said, to see how much Java I had to write for this application, check the dom module of the project on github. All of the other skeleton code is generated through a maven plugin and no user interface code is required. And here is a screenshot of the Project domain entity screen rendering:
In addition to generating a user interface, Apache Isis will generate also a REST API using the same domain model. How cool is that.
And the beauty of all this is, that generating UI allows you quickly to iterate over the domain model, show it to the business owners to get feedback and contonue evolving the model.
Some of the SEMAT Application Features implemented/enabled
- Multi tenancy
- Manage multiple projects per tenant
- Manage project Alpha states
- Custom Essence Alpha state list per tenancy
- Custom Essence Checklist items per tenancy
- Alpha state spider/radar diagram
- Automatic Apache Wicket based UI generation from domain model
- Automatic REST API generation from the same domain model
- Self Signup/Registration
- Auditing user actions
- Session logging
- Breadcrumb trail
Build and Run
Check the readme for full details, but you can build and run the application locally or on OpenShift to try it out.
mvn clean install cd webapp mvn jetty:run
mvn clean install docker build --rm -t bibryam/semat . docker run -p 8080:8080 bibryam/semat
Then go to http://localhost:8080/ and login: user/user
Deploy to OpenShift
Once you have got an OpenShift running either locally or
online, and have a oc client installed, then you can deploy the already build semat docker image with the following commands:
oc new-project semat oc new-app bibryam/semat:latest -e CATALINA_OPTS=“-Xmx300m” oc expose service semat
If you do not trust docker images build by others (you should not!) then you can build your own docker image as shown above with options 2 and 3 and push it your own docker registry and run the application from it:
oc new-app your_name/semat:latest -e CATALINA_OPTS=“-Xmx300m”
Alternatively, you could avoid installing and running docker all together, and have the source code and the docker image build on OpenShift. That is called OpenShift Source-to-Image
approach. You can do this from OpenShift UI by using for example “Red Hat JBoss Web Server 3.1 Tomcat 8 1.0” template and pointing to the SEMAT github repo. Or use the template provided in the project itself:
oc create -f semat-openshift-template.json oc process semat
Using source to image approach allows setting up github webhooks, have a Red Hat base image, have jolokia added, Java memory configurations done, etc.
Live demo on OpenShift
See try out the application, check live demo running on a OpenShift Online
In summary, if you have a domain model that changes often, and the agility in changing the domain logic is more important than how the user user interface looks like, check out Apache Isis. It is an incredible productive and fast business application development framework.
|Published on Java Code Geeks with permission by Bilgin Ibryam, partner at our JCG program. See the original article here: Rapid SEMAT Application Development with Apache Isis|
Opinions expressed by Java Code Geeks contributors are their own.