Hi Carsten,

On Mon, Dec 30, 2013 at 10:11 AM, Carsten Ziegeler <cziege...@apache.org> wrote:
> Bertrand wrote:
>> 4) I'm not sure about FeatureProvider.hideResource(featureName,
>> Resource) - as seen from the ResourceResolver, IMO you just care
>> whether a given FeatureProvider wants to hide a Resource or not, you
>> don't really care (*) which feature name causes the Resource to be
>> hidden...

>> A provider might provide more than a single feature, so it needs to know
> which feature definition to use for the two mentioned methods.
> The provider can be sure that the caller already checked that the feature
> is active, that's why the ProviderContext is not needed anymore. The
> provider does not need to do any checks anymore and can simply hide the
> resource...

So IIUC the when hiding a resource or changing its resource type the
scenario is as follows?

1. ResourceResolver checks all existing features to see which ones are
active in the given context.

2. For each active feature, ResourceResolver calls
FeatureProvider.hideResource and
FeatureProvider.getResourceTypeMapping to find out if resource
manipulations are needed.

If I'm correct, that's a bit expensive for our 10'000 features (yes I
bet creative users will get there ;-)

How about making a Feature an object, instead of just a String:

  Feature {
    String getName();
    String getDescription();
    boolean hasResourceTypeMapping();
    boolean canHideResource();
  }

The ResourceResolver can then consider only the features which are
marked for resource type mapping or for hiding resources. And having a
feature description can be useful for troubleshooting, webconsole etc.

-Bertrand

Reply via email to