Skip to content

decision service framework

devonfw-core edited this page Dec 13, 2022 · 10 revisions

Decision Sheet for Choosing a Service Framework

We need to choose which framework(s) we want to use for building services. For the devonfw, we focus on a standard API, if available. However, we also want to recommend an implementation. While projects would still be able to choose whatever they want, we want to suggest the best, most robust, and established solution. This way, projects do not have to worry about the decision and can rely on a production-ready framework without running into any trouble. Also, besides the standard, the configuration of the implementation framework differs, so we want to give instructions in the documentation and by our sample application. This is why, in the end, the implementation also matters. If a project has a customer demand to use something else, the project has to take care of it. We will always suggest and "support" ONE solution.

REST Services

For REST services, devonfw relies on the JAX-RS standard (and NOT on spring-mvc with its proprietary annotations). JAX-RS (Jakarta RESTful Web Services) is a Java programming language API to develop web services following the Representational State Transfer (REST) architectural pattern. For Apache CXF, the spring container was the first choice, but container abstraction has been properly introduced by design, so it can be used in JEE application servers. Apache CXF is a services framework that helps to build and develop services using frontend programming APIs, such as JAX-RS. Everything works smoothly in our sample application, and in addition, we collected feedback from various projects utilizing CXF, either with XML or JSON, with reported success in production. Therefore, we decided to use Apache CXF for Spring. For Quarkus applications, devon4j recommends to use RESTEasy, which is a JAX-RS implementation aimed at providing productivity frameworks for developing client and server RESTful applications and services in Java.

WebServices

For WebServices we rely on the JAX-WS standard. On our short list we have Metro2 and Apache CXF. Here a collection of facts and considerations:

Table 1. Decision for JAX-WS implementation
Metro2 Apache CXF

Pro

- reference implementation
- proven in many projects
- standard in RF

- supports both JAX-WS and JAX-RS therefore consistent configuration, single integration into servlet-container and spring
- proven in a lot of projects
- already chosen by devonfw for JAX-RS (so we already have a JAX-WS implementation on board).

Contra

- We expect trouble if use the planned URL path scheme <app>/services/(rest|ws)/... as CXF and Metro2 would both occupy services/*
- ugly endorsed trouble and small spring-integration issues with WSDL/XSD link resolution (input from Martin Girschik)

- IMHO currently used in less projects than metro2 so less existing experience

See also http://predic8.de/axis2-cxf-jax-ws-vergleich.htm We also had an evaluation at CSD research on CXF vs. Axis2. vs. Metro that suggested CXF.

BTW: Axis(2) is definitely out of discussion for devonfw.

Clone this wiki locally