Hi devs,
To progress on this topic, I’m trying to summarize the options we have since it’s still
not clear in my mind.
Option 1: Internal package after the 1st package
========
Class FQN example:
* org.xwiki.<package1>.internal.<package2>.<package3>.MyInternalClass
Pros:
* Easy to find all internal code for a given module (they’re all grouped together)
* Cons: ?
Devs:
* Vincent
* Marius
Option 2: Internal package at any level in the package hierarchy
========
Package examples:
* org.xwiki.<package1>.internal.<package2>.<package3>.MyInternalClass
* org.xwiki.<package1>.<package2>.internal.<package3>.MyInternalClass
* org.xwiki.<package1>.<package2>.<package3>.internal.MyInternalClass
Pros:
* ?
Cons:
* Internal code scattered in more packages.
* No consistency. Some devs will use
org.xwiki.<package1>.internal.<package2>.<package3>.MyInternalClass when
others will use
org.xwiki.<package1>.<package2>.internal.<package3>.MyInternalClass and
yet others will use
org.xwiki.<package1>.<package2>.<package3>.internal.MyInternalClass
Devs:
* Thomas
* Edy
* Sergiu
* Guillaume
Conclusion
=========
@Thomas, Edy, Guillaume, Sergiu: could you confirm that you’re in favor of option 2? If so
could you aslo explain the Pros of it and the Cons you see for option 1. Right now I see
more pros for Option 1. But maybe I misunderstood what you’re proposing. Maybe you’re
suggesting an option 3, based on the Maven module names?
Thanks
-Vincent
On 16 Apr 2018, at 18:28, Vincent Massol
<vincent(a)massol.net> wrote:
Hi devs,
On Matrix/IRC, I’ve posted the following:
"
* Guillaume Delhumeau: BTW your naming is strange for the internal package
* for ex: package org.xwiki.notifications.preferences.internal.email;
* normally we put internal just after the main package part
* ie.
* org.xwiki.notifications.internal.*
* and org.xwiki.notifications.* for public classes
* see
http://dev.xwiki.org/xwiki/bin/view/Community/CodeStyle/JavaCodeStyle/#HPac…
* General rule is org.xwiki.(module name).internal.
* I see thomas has done the same “error" for org.xwiki.job.handler.internal and
org.xwiki.job.handler.internal.question . So maybe there's something to
discuss/change
* I guess we have a mix of both now so we should discuss it and adjust our rules if need
be
“
So I think we don’t have all the same rules/understanding of the definition at
http://dev.xwiki.org/xwiki/bin/view/Community/CodeStyle/JavaCodeStyle/#HPac…
I’d like to discuss with you to see what you prefer and adjust our rules so that it
matches what we do in practice.
Any take in this?
Thanks
-Vincent