-
Notifications
You must be signed in to change notification settings - Fork 0
Concepts
The most important concepts of the Optimal Framework are the broker, plugins and schemas.
In the conceptual middle of the system is the broker.
It is responsible for most cross-cutting concerns like messaging, security logging and keeping persistent data. For clients of a system built on the framework, its role is application server and messaging platform.
JSON Schema is used to define all data structures in the system.
It is not only used to validate and define the data in the MongoDB database backend, but also used in front end interfaces like the administrative interface, and to handle messages.
All data in OF are required to have a valid schema reference that it adheres to, and are dictionaries that is turned back and forth into JSON when transmitted.
All functionality is added via plugins.
In OF, a plugin is almost able to change everything about how the system operates. Developing plugins is simple and intuitive, they are simple GIT repositories that have a definitions file that describes them.
Plugins add:
- functionality to the backend by defining CherryPy-exposed classes that are mounted by the built-in web server and dynamically incorporated into the backend via hooks. Hooks are run at different points of the broker initialisation, which allow for extensive control. Implementing a hook is simply to define a function in a module.
- namespaces and definitions by simply placing the schemas in the /schema folder, they are automatically imported into the system, to be used in the messaging and data validation.
- functionality to the admin frontend by listing the angular directives, controllers, menu items and routes that one wished to include.
There are numerous advantages to being plugin-based like this.
For all it becomes:
- possible to create an and sustain an ecosystem among users of the framework
- easy to separate ones own code from that of the ecosystem, making it easier to handle upgrades
- possible for the system to degrade gracefully in case of failuse
For commercial applications it becomes very easy to:
- maintain several editions of a system (like community, enterprise).
- add functionality in a modular way using plugins