What is the CTS2 Development Framework?
The CTS2 Development Framework is a development kit for rapidly creating CTS2 compliant applications. The Development Framework allows for users to create plugins which may be loaded into the Development Framework to provide REST Web Services that use CTS2 compliant paths and model objects.
Because the Development Framework is plugin based, users are required only to implement the functionality that is exclusive to their environment. For example, in any REST service, a large portion of code must be written to accept HTTP requests, handle errors, accept parameters, etc. The Development Framework provides all of this infrastructure, as well as utilities to help create plugins. The developer then is left to create the implementation plugin, which is the code specific to the individual environment. For example, this code may retrieve data from a database, read data from a file system, aggregate two more other services…
What does the Development Framework Provide?
CTS2 Development Framework provides a REST web application, along with URL routing and parameter handling. There are also several utility classes to assist developers. Some provided functionality includes:
- Templates for creating REST Hypermedia URLS
- Query/Filtering functionality for searches
- Marshalling/Unmarshalling of Java Beans to XML
- A REST Client
- The CTS2 Model represented as Java Beans
- A Plugin system that allows implementation bundles to be registered and discovered, as well as swapped at runtime
- Parameter handling framework for defining the options of a Plugin
- A set of Interfaces that are recognizable to the Development Framework as CTS2 Profiles
- Maven Assemblies to create plugins
- XML and JSON views
The CTS2 Development Framework and “Model View Controller” (MVC) Architecture
CTS2 is modeled abstractly (the Platform Independent Model or ‘PIM’) and for specific platforms (the Platform Specific Model or ‘PSM’). The CTS2 Development Framework attempts to transform these ideas into the MVC architecture style. Much like a traditional MVC implementation, multiple ‘Views’ expose the ‘Model’ with the help of the ‘Controller’. If we think of a ‘PSM’ as a ‘View’, and the CTS2 Development Framework acting as the ‘Controller’, a developer needs only to produce the ‘PIM’ based ‘Model’. Going further:
Transforms View (CTS2 PIM) structures into state (aka “backing store”)
May also enforce some invariants
Implements the static portion of the CTS2 model
(Indirectly) enforces some invariants
Implements the behavioral portion of the CTS2 model