Services are the fundamental building blocks of applications. In fact, applications are nothing but multiple service calls chained together to achieve a computable goal. They are the primary means by which developers define behaviors of applications.
Every service is written to perform a particular task. They are reusable, interoperable, self-contained units of code. They can be used in a variety of contexts, including but not limited to: Martini packages1, Martini endpoints, APIs, and even other services.
There are a number of service types you can choose from, each with unique perks of their own. In the following sections, we will take a look at all of these types, and how they can be used to implement elegant integration solutions.
Low code application development
Gloop and Flux allow low-code application development in Martini. Together with one-liners, you can build applications that do more with even less code.
Inputs and outputs
Similar to a function, all services consist of inputs and outputs. Inputs are data taken in for processing, or data used to affect the process. Outputs, on the other hand, are values returned by a service.
Gloop and Flux services can return as many needed output properties. Meanwhile for Java and Groovy-based services, only one value may be returned. This can easily be by-passed by returning objects made up of multiple properties, which may or may not be nested themselves.
For readability purposes, TORO recommends keeping input or output properties to a maximum of seven per service.