brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <>
Subject Re: [PROPOSAL] Refactor packages to avoid the split package problem
Date Thu, 06 Aug 2015 22:49:10 GMT
Agree on all counts. Especially on getting more opinions on this topic.

Your memory serves you well :). The situation you described is not a 
split package.

I'd suggest staying on this thread, but identify issues separately, 
discuss them separately and decide later how to deal with contentions, 
because hopefully there won't be the case. So I will start with capturing:

1. How to deal with ./api? In general I have a slight preference towards 
making things explicit. In this case I am mostly neutral. I would be 
fine with either aob.* or oab.api.*. There is a bit of a grey area, I 
think for packages like oab.entity.*, say .trait. A user would not know 
immediately what bundle implements that, especially if we'd have stuff 
in oab.entity.core (or whatever other convention we come up with).

2. What is the convention for implementations in multiple bundles? 
Should it be for example: oab.entity.core.* or oab.core.entity.* or 
something else? My preference would be oab.core.entity.*. The motivation 
is that a human user would be able to quickly guess that the package is 
implemented in brooklyn-core. Computers and tools don't care much.


On 08/06/2015 04:48 PM, Aled Sage wrote:
> Remind me: it doesn't count as split packages if org.apache.brooklyn.entity is in one
module and org.apache.brooklyn.entity.core is in another?
> On balance, I'd prefer api module to be the odd one out: not to include .api in the package
> I'm a fan of simple interface names. IMO it reads nicer/simpler if you miss out api.
> I could be argued round though.
> ---
> This is a big *one-off decision*.
> I'm keen to get more people's opinions!
> Aled
> Sent from my iPhone
>> On 6 Aug 2015, at 17:32, Hadrian Zbarcea <> wrote:
>> I agree. I am not sure what the best structure is, we can refine it while we do the
refactoring. For the api part though (which is my focus now) how do you feel about org.apache.brooklyn.api?
>> Cheers,
>> Hadrian
>>> On 08/06/2015 11:56 AM, Aled Sage wrote:
>>> Hi Hadrian,
>>> +1; makes sense to fix the split-package problem for the 0.8.0 release.
>>> These should be different PRs from the org.apache.brooklyn, so that they
>>> can be reviewed accordingly.
>>> I'll need to look again at the packages to give a definite opinion on
>>> naming. It's probably not as simple as org.apache.brooklyn.core.* in
>>> ./core:
>>>   * There are utility classes in core named brooklyn.util.*, which
>>>     should be compared with the brooklyn-util-common
>>>     (main difference is that many utils in core have dependencies on
>>>     other things in core, rather than being truly independent utils).
>>>   * I'd like us to extract the core tasks framework
>>>     (brooklyn.util.tasks) to its own module.
>>> ---
>>> We should also review what is public (i.e. what packages should be
>>> exported). For example, is core's brooklyn.internal.* definitely not
>>> used by any other projects?
>>> ---
>>> An alternative approach (definitely less appealing for me long term)
>>> would be to use OSGi fragments. I think something like that was done in
>>> the early days of OSGi'ifying jclouds, but don't recall the details off
>>> hand. There's an e-mail thread [1] and a blog post about it [2].
>>> Aled
>>> [1]!topic/jclouds-dev/FdsbfELc1o0
>>> [2]
>>>> On 06/08/2015 15:50, Hadrian Zbarcea wrote:
>>>> Hi,
>>>> I opened a new jira [1] for this. While doing my refactoring in ./api
>>>> I discovered quite a bunch of places where we have split packages
>>>> among api, utils, core, etc.
>>>> I would recommend using something like:
>>>> org.apache.brooklyn.api.* in ./api
>>>> org.apache.brooklyn.core.* in ./core
>>>> and so forth. There are also a bunch of circular dependencies and
>>>> other smaller issues that we should correct.
>>>> WDYT?
>>>> Hadrian

View raw message