avaje / avaje-config

Application configuration / properties loading for JVM applications
https://avaje.io/config
Apache License 2.0
55 stars 8 forks source link

Add EventLog interface with preInitialisation() and postInitialisation() support #51

Closed rbygrave closed 1 year ago

SentryMan commented 1 year ago

yeah, this is much better than what I was about to do. LGTM.

SentryMan commented 1 year ago

I wonder though, should the lifecycle hooks be tied to the EventLog? Or should that be a separate interface?

rbygrave commented 1 year ago

Originally I had them on a separate interface. It depends a bit of what is wanting to be achieved but with those methods there then there is the full ability / control and the logging of events knows if those are occurring before or after the postInitialisation(). Right now I think the EventLog needs those lifecycle hooks but maybe ... there should be a separate additional lifecycle interface for folks that ONLY want to hook into the lifecycle and not additionally control the logging of events.

The other slightly crazy alternative idea is to cleanly separate events that occur prior to postInitialisation() ... to the events that occur after postInitialisation()