layrry icon indicating copy to clipboard operation
layrry copied to clipboard

Support addition and removal of layers at runtime

Open gunnarmorling opened this issue 4 years ago • 3 comments

gunnarmorling avatar Apr 27 '20 20:04 gunnarmorling

Would it make sense to deactivate a later at runtime? Deactivation does not remove the layer as you'd like to keep the layer hierarchy in place.

Deactivation "unloads and hides" the classes of that layer. If deactivation makes sense, does deactivating a layer also deactivates its parents or only itself? Should decativation be conditional so that parents get deactivated as well?

aalmiray avatar Sep 20 '20 12:09 aalmiray

What would be your use case for this? Also, if deactiviting implies class unloading, what's the difference to removing it really? If we wanted to something like this, note it'd not imply deactivating the parent layer(s) but child layer(s) of the deactivated one. That is, classloading cannot really triggered explicitly anyways, it'll happen automatically when the last reference is removed (be it from a parent layer (via a service reference) or from a child layer).

gunnarmorling avatar Sep 20 '20 16:09 gunnarmorling

As I understand Layrry's current layer model, if a Layer were to be removed (say the plugins layer is nuked), then it's parent-child relationship are lost. Layers relationships are immutable at this point.

If a layer can be removed it stands to reason a layer can be added, in which case establishing parent-child relationships must be possible.

Deactivating/Activating a layer keeps the parent-child relationships in place but removes/adds access to its modules. Honestly I don't know how feasible is this particular scenario, just thought it might be good idea to explore how further down the road this may be taken or perhaps it's a fool's errand.

aalmiray avatar Sep 20 '20 16:09 aalmiray