Info |
---|
This is in DRAFT. Feedback or improvements are welcome using the comment feature in confluence. |
To solve some limitation with the OpenSCD monolith architecture; and improved architecture is created. The Motivation for creating a new generation of OpenSCD next architecture:
- Make is more easy to build your own distribution
- Make is more easy to create custom plug-ins
- Less tangled code
- Reusable code
- Faster development speed (once it is ready)
- Plug-ins can be build in any code language and framework (as long as they adhere to the specifications)
Info | ||
---|---|---|
| ||
Practical example for CoMPAS. CoMPAS currently relies on "fork" of OpenSCD in order to add the needed functionality: The goal for CoMPAS would be to add the CoMPAS specific code as add-on to OpenSCD-next in form of plug-ins. The current "fork" will no longer be needed. CoMPAS will just make a distribution of OpenSCD including the CoMPAS plugins/extensions. |
Architecture principles for OpenSCD-core
Some architecture principles are written in order to guide the architecture and implementation.
- Use the standard webAPI as much as possible (developer.mozilla.org)
- It should be easy to write a plug-in
- Clear API's for plug-in authors
- Plug-in author can use components to speedup the development and give a consist look and feel (optional)
OpenSCD-core architecture overview
The OpenSCD next architecture consist of 4 major software components:
- OpenSCD-core
- Plug-ins
- Components
- add-ons
Overview of the global architecture
Components and their interaction. OpenSCD-core loads alle the "components/plugins etc".
draw.io Diagram | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
A plugin can use EditEvent to make modifications in OpenSCD-core.
draw.io Diagram | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
OpenSCD-Core
OpenSCD-core is main application of OpenSCD-next. OpenSCD-core will be loaded once people open the application. OpenSCD-core sets the requirements for the plug-ins.
OpenSCD Core consists of the open-scd
WebComponent, which is responsible for loading plugins and addons.
The open-scd
WebComponent is the outer shell of OpenSCD, containing limited functionality in order to make it flexible.
Editing of a (SCL) Document should
be handled by OpenSCD Core. OpenSCD Core provides an API for Document editing by listening to CustomEvents. These CustomEvents can be dispatched b Plugins.
Based on a configuration file OpenSCD-core load the different Plug-ins/addins etc.
Functionalitiy of OpenSCD-core:
Loading addons/plug-ins
Display the selected plug-in
Handling SCL edits
Host the SCL doc editing
SCL doc editing
The SCL doc editing is reponsible for manipulating the SCL. It takes care of the right sequince/order of SCL edits. For more information see OpenSCD-core handling SCL Edits.
OpenSCD Plugins
OpenSCD plug-in is an addition to OpenSCD-core to add functionality. This could be generic 61850 functionality or vendor/utility specific functionalitiy. Examples: datatemplate editor, substationsection editor, GOOSE editing etc.
OpenSCD-core supports 2 types of plugins: menu plugins
and editor plugins
. These plugins have a different behavior.
For more information see: OpenSCD-core plug-in
OpenSCD Components
OpenSCD Components are reusable WebComponents. Components can be used by plug-ins to build functionality faster, plug-in authors can also decide to build everything themselves.
Examples: filterdlistst are used in many plug-ins. In order to re-use the code, and filteredlist component is build.
OpenSCD add-ons
OpenSCD addons are an extension of OpenSCD-core to split functionality. This functionality can be pure technical and requires no custom UI. Example for some OpenSCD addons are Wizarding, Validating, Waiting, etc.
OpenSCD addons will be a replacement for current mixins, so there is no or less need to fork
OpenSCD-core and to build mixins on top of the fork. Addons allow experiments with (potential) new core functionality. Succesful addons can be merged into OpenSCD-core.
Example: Wizarding API is hard to make pefect in the first run. If started with an addon for wizarding, we can experiment/use. If it turns out that the addon is missing crucial functionality. We can introduce a new add-on next to the old addon (with its limitations).
What are mixins: TypeScript: Documentation - Mixins (typescriptlang.org)