You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
My solution aims to improve architecture from the initialization from ServiceProviders and Subscribers by removing the reference to subscribers inside the Plugin.php file.
Describe the solution you'd like
For that I would consider a solution using the same logic as rocket-cdn plugin to initialize the plugin.
However instead of one kind of subscriber referenced on service providers we would have 4 types:
Front subscribers
Admin subscribers
Common subscribers
License subscribers
Also as subscribers names will be hidden, we should create a prefix for each service provider that add before before the id from the class that would prevent conflict between two subscribers.
One drawback that I potentially saw is that we need to initialize every service provider to check for subscribers.
However as we don't use ServiceProviders constructors (we have no operations inside them) I don't think this would be a huge issue.
Another potential issue I saw was adding multiple time the same ServiceProvider to the container. However the container does a check to see if it is already there before adding it so that shouldn't be an issue.
Code
For that we could create a new base for all ServiceProvider that we will call AbstractServiceProvider with the following content:
Is your feature request related to a problem? Please describe.
My solution aims to improve architecture from the initialization from ServiceProviders and Subscribers by removing the reference to subscribers inside the
Plugin.php
file.Describe the solution you'd like
For that I would consider a solution using the same logic as rocket-cdn plugin to initialize the plugin.
However instead of one kind of subscriber referenced on service providers we would have 4 types:
Also as subscribers names will be hidden, we should create a prefix for each service provider that add before before the id from the class that would prevent conflict between two subscribers.
One drawback that I potentially saw is that we need to initialize every service provider to check for subscribers.
However as we don't use ServiceProviders constructors (we have no operations inside them) I don't think this would be a huge issue.
Another potential issue I saw was adding multiple time the same ServiceProvider to the container. However the container does a check to see if it is already there before adding it so that shouldn't be an issue.
Code
For that we could create a new base for all ServiceProvider that we will call AbstractServiceProvider with the following content:
Concerning the
Plugin.php
we can change the logic to load subcribers like that:The text was updated successfully, but these errors were encountered: