design-first / system-designer

A low-code development platform for creating systems 🇺🇦#standwithUkraine
https://designfirst.io/systemdesigner/
Apache License 2.0
930 stars 136 forks source link

Sub-Systems ? #148

Open FaBLPR opened 2 years ago

FaBLPR commented 2 years ago

I just started to play with the app (which is really good) but can't find a way to use a sub-system in another system. Is it a limitation ? Do you plan to do something for this ?

Thanks ! Fabien

ecarriou commented 2 years ago

Hello,

maybe it is not well documented but you can compose systems.

For example if you have created System-A and System-B systems:

Capture d’écran 2022-06-06 à 15 28 19

And then if you click on the import button you will be able to select System-B to be composed with System-A:

Capture d’écran 2022-06-06 à 15 28 37

Documentation is here. I will update it soon to add more details.

Is it what you need ?

FaBLPR commented 2 years ago

Thanks, this feature allows to duplicate the content of the input system into the target system, which is indeed interesting, but I was more thinking to actually reference another system as a component to have a "system of system" methodology. Thanks ! Fabien

ecarriou commented 2 years ago

I think that all notions that you are talking about are not yet exposed in System Designer UI, but they are implemented in System Runtime, the JavaScript lib used to run systems.

At runtime a system is a component (from _System class) and can be required like a classic component. You can see here _System model.

Capture d’écran 2022-06-06 à 22 50 44 Capture d’écran 2022-06-06 à 22 51 07

When you are in the start method of your system, this refers to the current component, the system, and so you have access to all these properties / methods / ... .

By the way a system is managed like an OSGi module, you can start / stop / install / uninstall a system on the fly. This is what I do in System Designer to install / remove extensions. System Designer is the "core" system and extensions are sub-systems that can be installed / uninstalled.

Things can be easily very complex that's why in System Designer, by default, I did not exposed this complexity. Once you know how things work, you can start to go deeper.

I think it deserves more documentation on System Designer side but you can read System Runtime documentation to understand what is under the hood.