sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: [DISCUSS] reducing the api-regions extension verbosity
Date Fri, 14 Sep 2018 16:56:46 GMT
Hi Simo

thanks for your suggestions.

Unfortunately the array is needed as the regions have an order, a later
region adds to the preceding region. A map in JSON has no order.

The point of the api controller is to avoid accidental exports of new
packages. Therefore if new api is added it should be a conscious
decision to export this to others. Therefore we don't want to support
wildcards as this would be against this goal.

In general, if you've written the section once, you rarely need to touch
it again. And for the first time you might want to generate it with a
script or something

Carsten


Simone Tripodi wrote
> Hi all,
> During the last days I've been working with the api-regions extension and I
> think we can improve, even if a little, the extension verbosity.
> 
> What we currently have is something where fields are explicitly identified
> via the "name" and "exports" fields:
> 
> "api-regions:JSON|false": [
>     {
>       "name": "global",
>       "exports": [
>         "org.osgi.util.function"
>       ]
>     },
>     {
>       "name": "asf",
>       "exports": [
>         "org.osgi.util.function"
>       ]
>     }
>   ]
> 
> while they can be implicit, reducing the syntax where each key identifies
> directly the region "name" and the related string array values identify the
> "exports":
> 
> "api-regions:JSON|false": {
>     "global": [
>       "org.osgi.util.function"
>     ],
>     "asf": [
>       "org.osgi.util.function"
>     ]
>   }
> 
> specifying the main array is not needed anymore.
> 
> Moreover, in order to implement the "export all" behaviour, we could use
> wildcards that users are already used to, i.e.:
> 
> "api-regions:JSON|false": {
>     "global": [
>       "*"
>     ],
>     "asf": [
>       "org.osgi.util.function"
>     ]
>   }
> 
> What do you think?
> Many thanks in advance, all the best!
> ~Simo
> 
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
> 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Mime
View raw message