Skip to content

Add lifecycle property to component description schema #168

@eeberhard

Description

@eeberhard

It is important to know if a component is a lifecycle component or not. In previous versions of modulo, this could be checked based on the existence of "lifecycle predicates". These predicates have been removed in modulo 5.0.

The component description schema includes the "inherits" property for which component implementations can declare their immediate parent class. For "first-generation" components, this is either modulo_components::Component or modulo_components::LifecycleComponent, and this field could therefore be used to check if a component is lifecycle or not. But for second-generation components and beyond, the inherits field shows the direct parent class, and so the ultimate base class is no longer retrievable.

The simplest way to mark a component as lifecycle would be to add a boolean property to the schema, and then have the modulo lifecycle components set this property to true. Then, all components that inherit the description from the lifecycle component would also have this property as true.

An alternative would be to separate the "inherits" field into some required "base_class" (either the base modulo component or lifecycle component) and optional "parent_class" which might be some intermediate class, but I prefer the simple case.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions