Components

More about components

A component is a piece of code, which is invoked when a resource URI is accessed or information about a component is retrieved by a client.

At its core, component code consist of a single class, which implements a number of 'service methods'. Those service methods are eventually directly accessible as 'sub resources' for any resources that are based on the component.

Self documenting

Component code is self-documenting: The features and services it implements, the parameters it requires and attributes it provides (such as name and documentation) are picked up by RESTx and then displayed to a client. Therefore, after implementing a component and restarting the server, no further configuration steps are required: All that RESTx or a client needs to know about the component is known and available via the server's RESTful API.

Simple API

Simplicity is important. Therefore, the API for components is deliberately simple and allows for a very flexible means of passing data to and from a component. Wherever you may have considered an ad-hoc script or program before - because it is so simple and easy - you can now consider RESTx: Writing a component is as straight forward and quick as writing an ad-hoc script, except that now you also get all the benefits of a proper platform and framework for free.

Chose your language

The component API is provided in multiple languages (currently JavaPython and JavaScript with more to follow). Therefore, you are free to pick the language you are most comfortable with, or which is best suited for the task. Your language choice may be influenced by the availability of libraries for the task you need to accomplish. RESTx does impose any limits on the third-party libraries you wish to use, or on what you can do with your code.

Easy component creation and installation

Creating and installing a new component is accomplished with just a single command.

Where to go next?