New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Organisation of \Piwik\Plugin\* classes #7929
Comments
I would keep related classes together and in logical namespaces, e.g.: Piwik\Widget\List - former WidgetsList |
I think it would also make sense to distribute this by domain, as @dczajkacc wrote. |
There's one thing I dislike with the I would be +1 to move related things together as suggested, e.g.
I honestly hate things in the root namespace ;) I would definitely be +1 to reorganize things in separate namespaces (e.g. However there's one advantage to keep the current [not ideal] names: it allows us to refactor the component later and use the good name without breaking BC. For example with the scheduler the old class was
We can also set up class aliases or write subclasses to keep BC. |
That's a strong opinion :) I don't mind them there and find it can be even nice sometimes. I'd rather find How would we rename eg |
Hate maybe was a strong word rather "dislike" ;) WidgetProvider could do but are we talking about the classes that plugins extend to define widgets? If yes then either each implementation is a widget (in which case the natural name for the class would be |
For now I put everything under |
Feel free to comment etc if someone has new or more thoughts on this |
We currently have a couple of classes under
Piwik\Plugin\*
classes. EgPiwik\Plugin\Report
,Piwik\Plugin\Widget
,Piwik\Plugin\Controller
. We put there classes that can be extended by plugins to create new entities, eg Widgets, Reports, ...It is quite nice to have all those classes under
Piwik\Plugin
and to see at a glance which classes can be extended and what kinda our main API's are. Though I'm not so sure if it's still the right way.Eg where do we put Widget related classes such as
WidgetFactory
orWidgetsList
. UnderPiwik\Plugin\Widget\Factory
andPiwik\Plugin\Widget\WidgetsList
?Or should we move
Piwik\Plugin\Widget
toPiwik\Widget
andPiwik\Widget\Factory
andPiwik\Widget\WidgetsList
? Or mixed?We currently also have
Piwik\Db
,Piwik\Url
,Piwik\DataTable
and I reckon for plugin developers and for us it's maybe not clear where to find/put which class.Any opinions / thoughts?
With Piwik 3.0 we could break the API and maybe move those classes although it could be quite a bit of work, especially to also keep all of our plugins compatible.
The text was updated successfully, but these errors were encountered: