:toc: macro
toc::[]
:idprefix:
:idseparator: -
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

= devon4j
For _Java_ based back-end solutions, _devonfw_ includes https://github.com/devonfw/devon4j/wiki/architecture[devon4j] that provides a standardized architecture blueprint, an open best-of-breed technology stack as well as industry proven best practices and code conventions for a cloud ready _Spring_ based server.

Included in _devonfw_ framework as default server solution, https://github.com/devonfw/devon4j[devon4j] is the result of applying devonfw principles in a Java based technology stack. With _devon4j_ developers are able to create web application back-ends in a fast and reliable way, generating web services (REST, SOAP) that web clients can consume.

== devon4j Technology Stack
As mentioned before, devon4j is not only a framework but a set of tools and conventions. devon4j provides a Java back-end solution based on the following technologies:

* https://spring.io/[Spring framework] as the main development framework.

* https://projects.spring.io/spring-boot/[Spring Boot] as project accelerator.

* https://maven.apache.org/[Maven] as project and dependencies management tool. The _Maven_ projects use the _POM_ file to store all the necessary information for building the project (project configuration, dependencies, plugins, etc.). You can get more details about _POM_ files https://maven.apache.org/pom.html#What_is_the_POM[here].


Some of the main features of _Spring Boot_ are:

* Creation of stand-alone Spring applications in an easy way.

* Embedded Tomcat directly (no need to deploy WAR files).

* Provide 'starter' POMs to simplify your Maven configuration.

* Automatically configure Spring (whenever possible).

* Provide production-ready features such as metrics, health checks and externalized configuration.

* No requirement for XML configuration.

For _persistence_ and _data access_ devon4j implements:

* https://en.wikipedia.org/wiki/Java_Persistence_API[JPA] and http://hibernate.org/[Hibernate]

* http://www.querydsl.com/[QueryDsl] as query manager

* http://www.h2database.com/html/main.html[H2] instance embedded as _out-of-the-box_ database that is launched each time the application is started so the developers are able to start working with a real data access from scratch.

* https://flywaydb.org/[Flyway] as a tool for version control of the database.

As service framework:

* http://cxf.apache.org/[Apache CXF] that provides support for:

** https://en.wikipedia.org/wiki/Representational_state_transfer[REST] services through https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services[JAX-RS]

** https://en.wikipedia.org/wiki/SOAP[SOAP] services through https://en.wikipedia.org/wiki/Java_API_for_XML_Web_Services[JAX-WS]

== devon4j Tools
The following tools are included in the https://github.com/devonfw/ide[devonfw IDE], which -- among many other things -- can create, run and deploy devon4j applications, avoiding lots of manual work.

=== Custom Eclipse Instance
As part of the _devonfw_ framework, devon4j projects are integrated into a customized Eclipse instance, which provides pre-configurations and pre-installed plugins, focusing on code quality and productivity boosting. 

=== CobiGen
A generic incremental generator for end to end code generation that allows us to automate the generation of major components of our apps. Based on entities, CobiGen can generate all CRUD functionality for us, starting with services and ending with the persistence data layer.

== devon4j Architecture Overview
devon4j provides a solution for industrialized web apps based on _components_ and a three-layers architecture.

image::images/devon4j/1.Overview/devon4j_architecture.png[devon4j Architecture, 600]

A _component_ is a package that contains the services and logic related to one feature of the app.

Each component will be divided in three layers: `service`, `logic` and `dataaccess`.

* *Service* Layer: will expose the REST API to exchange information with the client applications.

* *Logic* Layer: the layer in charge of hosting the business logic of the application.

* *Data Access* Layer: the layer to communicate with the data base.

Finally the _devon4j_ applications provide a _general_ package to locate the cross-cutting functionalities such as _security_, _logging_ or _exception handling_.

In the next chapters you can find all the details about the implementation of each layer and how to develop all the relevant parts of a web app based on _devonfw_ framework and _devon4j_.

'''
*Next Chapter*: link:an-devon4j-application[A devon4j Application]
