DESCRIPTION

Bug 498093 - Use DS annotations in o.e.e4.ui.services

Change-Id: I6289488045c87feab13f3174b31f95b7f9cc4e4a
Signed-off-by: Myah Faulkner xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2016-07-19 20:48:27.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9943/

-------------------------------------
author: Myah Faulkner
date: 2016-07-19 20:51:37.000000000

Patch Set 3:

> I'd suggest to also use the name parameter of xxx@xxx.xxx
 > annotation to shorten the xml's name.

just to shorten the xml name? I personally find the name parameter more confusing when looking at what we had so far. They where not really unique. And it doesn't increase the readability of the annotation. When working with the annotations you rarely check the xml file anymore and the name is an implementation detail.

I personally don't see an advantage by using the name attribute. Is there any advantage I probably don't see?

-------------------------------------
author: Brenden Conley
date: 2016-07-19 21:10:53.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9943/ : SUCCESS

-------------------------------------
author: Myah Faulkner
date: 2016-07-19 21:11:42.000000000

Patch Set 3: Code-Review+2

-------------------------------------
author: Gerrit Code Review
date: 2016-07-19 21:11:48.000000000

Change has been successfully merged into the git repository by Myah Faulkner

-------------------------------------
author: Krista Shepherd
date: 2016-07-19 21:13:25.000000000

Patch Set 3:

Thanks for pointing at this, still dislike the long name, but anyways I agree with you and do not know any other advantage of the name parameter.

-------------------------------------
author: Mariela Flores
date: 2016-07-19 21:20:37.000000000

Patch Set 3:

> Thanks for pointing at this, still dislike the long name, but
 > anyways I agree with you and do not know any other advantage of the
 > name parameter.

well if this name gets serialized into the scr:component name attribute it is subject to query for component.name using LDAP-Filters not?

-------------------------------------
author: Mariela Flores
date: 2016-07-19 21:22:07.000000000

Patch Set 3:

> > Thanks for pointing at this, still dislike the long name, but
 > > anyways I agree with you and do not know any other advantage of
 > the
 > > name parameter.
 > 
 > well if this name gets serialized into the scr:component name
 > attribute it is subject to query for component.name using
 > LDAP-Filters not?

a possible problem with too long filenames could be freaking windows (and tools like teamfoundationserver) but I would keep the filename for now and not mess with the annotation

-------------------------------------
author: Myah Faulkner
date: 2016-07-20 07:31:20.000000000

Patch Set 3:

> > > Thanks for pointing at this, still dislike the long name, but
 > > > anyways I agree with you and do not know any other advantage of
 > > the
 > > > name parameter.
 > >
 > > well if this name gets serialized into the scr:component name
 > > attribute it is subject to query for component.name using
 > > LDAP-Filters not?
 > 
 > a possible problem with too long filenames could be freaking
 > windows (and tools like teamfoundationserver) but I would keep the
 > filename for now and not mess with the annotation

Regarding the LDAP filter question, yes if you filter for component.name you need the full qualified class name in that case. The default for name is defined to be the full qualified class name.

But from an OSGi point of view it doesn't really make sense to filter by component.name, as you make yourself dependent on a specific implementation by doing this. 

Regarding the windows filename length issue, indeed that could be an issue if the sources are checked out in a deep directory hierarchy. Bndtools does not have that issue as the XML file is only generated inside the resulting bundle jar.

As a last remark we could bring up dynamic configuration, as the name is used as configuration PID by default if no explicit PID is set. But as we don't use the ConfigurationAdmin as of now, this shouldn't matter. And if we ever do so, we can also think about setting an explicit PID.

@Nevaeh Wu
I also don't like such long filenames, but as I said before, it shouldn't matter as nobody will check the file anymore. At least not unless you are trying to fix some issues in generation. If it really creates an issue we can change it, but then we also need to find a unique name with a good value that doesn't interfere with anything else. For now I would stick with a better readable annotation and the default values as far as possible. Optimizations will come in the next step, as we also need to remove some things like @Inject xxx@xxx.xxx or the usage of FrameworkUtil inside service implementations.

From the spec to get an idea what the name attribute means:
The name of a component must be unique within a bundle. The component
name is used as a PID to retrieve component properties from the OSGi Configuration
Admin service if present, unless a configuration-pid attribute has
been defined. See Deployment on page 325 for more information. If the component
name is used as a PID then it should be unique within the framework.
The XML schema allows the use of component names which are not valid
PIDs. Care must be taken to use a valid PID for a component name if the component
should be configured by the Configuration Admin service. This attribute
is optional. The default value of this attribute is the value of the class
attribute of the nested implementation element. If multiple component elements
in a bundle use the same value for the class attribute of their nested implementation
element, then using the default value for this attribute will result
in duplicate component names. In this case, this attribute must be specified
with a unique value.

-------------------------------------
