Bug 308997 - [metadata] Add RequirementDescription to MetadataFactory
Summary: [metadata] Add RequirementDescription to MetadataFactory
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, helpwanted
Depends on:
Blocks:
 
Reported: 2010-04-13 09:00 EDT by DJ Houghton CLA
Modified: 2020-02-20 01:10 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2010-04-13 09:00:34 EDT
There are many methods on MetadataFactory to create a Requirement. We keep adding new methods with more arguments.

We should consider the approach we took with InstallableUnit and create a RequirementDescription object which the client creates and populates and then we would use that to create the Requirement instance.
Comment 1 Dean Roberts CLA 2010-10-22 11:33:01 EDT
I took a look at this as motivation to become more familiar with some P2 code.

This case looks a little different than the InstallableUnit case in that the MetaDataFactory.createRequirement* methods seem to map onto various flavours of RequiredCapabilities constructors and that these constructors are called in many places in the code base.  The non-test occurances being primarily in generator and publisher.

Is it the case that all places in the code directly instantiating RequiredCapabilities should be changed to call the static methods on MetaDataFactory?

If that is not the case, are we sure that the current single line calls to the RequiredCapabilities constructors will really be improved by multi line calls like:

RequirementDescriptor descriptor = new RequirementDescriptor();
descriptor.setName(name);
descriptor.setNameSpace(namespace);
descriptor.setRange(range);
...

Clearly we could make a few multiple argument constructors on the new descriptor ... but that probably just creates the same permuations we see on the create methods.
Comment 2 Thomas Watson CLA 2011-06-08 11:28:46 EDT
Move all 3.8 bugs to Juno.
Comment 3 Ed Merks CLA 2020-02-20 01:10:37 EST
Given that this has been absent for so long, it seems there would be very few users of any new API developed for this purpose at this point in time.