osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

[CDI] "naming" references in CDI #2889

Closed bjhargrave closed 6 years ago

bjhargrave commented 6 years ago

Original bug ID: BZ#3021 From: @rotty3000 Reported version: R7

bjhargrave commented 6 years ago

Comment author: @rotty3000

CDI, like in DS, has the concept of "references"; injection points where we want OSGi services. CDI references have effectively the same semantics as DS reference's do.

In both scenarios, references should always have a name, either manually set or derived.

However there is one major distinction between the two scenarios:

DS' "scope" for naming is limited to a single class and so the collision space is small. It's therefore relatively easy to define heuristics to derive reasonably short names, which can later be used in configuration.

However, unlike DS, CDI's references are not scoped to a specific class, rather they are scoped over a whole graph of objects.

The result is that "naming" is not so simple as in DS as many CDI classes name have injection points with identical injection point members.

The obvious first solution is to derive names from the fully qualified class name + the injection point member name.

This should adequately limit collisions, but it may result in potentially very long and ugly names for references.

I'm looking for suggestions.

bjhargrave commented 6 years ago

Comment author: @timothyjward

(In reply to Raymond Auge from comment BZ#0)

CDI, like in DS, has the concept of "references"; injection points where we want OSGi services. CDI references have effectively the same semantics as DS reference's do.

In both scenarios, references should always have a name, either manually set or derived.

However there is one major distinction between the two scenarios:

DS' "scope" for naming is limited to a single class and so the collision space is small. It's therefore relatively easy to define heuristics to derive reasonably short names, which can later be used in configuration.

However, unlike DS, CDI's references are not scoped to a specific class, rather they are scoped over a whole graph of objects.

The result is that "naming" is not so simple as in DS as many CDI classes name have injection points with identical injection point members.

The obvious first solution is to derive names from the fully qualified class name + the injection point member name.

This should adequately limit collisions, but it may result in potentially very long and ugly names for references.

I'm looking for suggestions.

How often are people exposed to these names? In DS pretty much the only time that you care about a reference's name is when you want to set a target filter in configuration. If using the reference name is an equally rare occurrence in CDI then it may be that your current proposal is sufficient.

bjhargrave commented 6 years ago

Comment author: @bosschaert

Handled in the proposed spec document.