Initialization via a static Initialize method which creates the type for you is not friendly for DI. It makes everything ass-backwards. I have to let CrossPushNotification create my listener, extract it via CrossPushNotification.PushNotificationListener, then inject that into my container.
It would be useful to have overloads that take an already instantiated instance of T:
var composition = new CompositionRoot();
var listener = composition.ResolvePushNotificationListener();
CrossPushNotification.Initialize(listener);
Initialization via a static
Initialize
method which creates the type for you is not friendly for DI. It makes everything ass-backwards. I have to let CrossPushNotification create my listener, extract it viaCrossPushNotification.PushNotificationListener
, then inject that into my container.It would be useful to have overloads that take an already instantiated instance of
T
: