Skip to main content
Mercurial provides a Subsystem interface that is a thin wrapper over Feature from Core, you should go read the documentation on Feature if you wish to use the Subsystem interface. The Subsystem interface is entirely optional, and you may implement subsystems however you wish, but we’ll take a quick look at what they provide on top of Feature. However you decided to implement subsystems, they are highly recommended as a great way to separate parts of your code from each other, and allow them to be recombined on demand. Dairy Core’s Feature system is a great way to do subsystems. We’ll use these example subsystems: Java Kotlin
Take a look at the examples above, and read more about Core’s Features in order to learn more about how to use Subsystems.

SubsystemObjectCell

SubsystemObjectCell is like Core’s OpModeLazyCell or OpModeFreshCell that is tied to a particular Feature being attached, and Mercurial being attached. It ensures that its contents have been evaluated post init, and will ensure that it is empty after the OpMode finishes. This makes it perfect for OpMode lifetime scoped objects with Mercurial Subsystems. Take a look at both OpModeLazyCell and OpModeFreshCell in Core.