Molecule
Molecule copied to clipboard
Add announcers to know when a Molecule Component is started and stopped
A GitHub search of its repository shows that no such option exists at the moment:
Announcers would be useful for the visualization option currently developed in Molecule-Incubator
Hi @Eliott-Guevel, this code is the internal mecanism of Molecule to be notified when classes change. This is not related to component life-cycle but related to live-coding features.
I think we don't have Molecule Announcers and it should be good to propose that for monitoring a Molecule system. This can be for example:
- ComponentInitialize
- ComponentActivate
- ComponentPassivate
- ComponentRemove
We have this:
MolHomeServices>>instantiateComponent: aComponentClass named: aName
(...)
component triggerEvent: #instantiateComponent with: component.
(...)
MolHomeServices>>activateComponent: aComponentClass named: aName
(...)
component triggerEvent: #activateComponent with: component.
(...)
etc.
This is an old mecanism, probably not used because no tests and no references to it. @ELePors I thinks we can replace this old (and not used) mecanism by new system Announcers, what is your opinion?
Hi @labordep and @Eliott-Guevel
Whe should try to create Announcement subclasses :
MolComponentAbastractAnnoucement
├── MolComponentActivated
├── MolComponentInstanciated
├── ...
with a #component: method implemented to indicate which component is related to the announcement.
The MolComponentManager should do announcements... and others should listen to these announcements...