Bug 173726 - No api exists to create a Usage dependency on a NamedElement
Summary: No api exists to create a Usage dependency on a NamedElement
Status: VERIFIED FIXED
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: M6   Edit
Assignee: James Bruck CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-02-09 22:03 EST by Steven R. Shaw CLA
Modified: 2012-05-22 11:34 EDT (History)
1 user (show)

See Also:


Attachments
updated API (241.09 KB, patch)
2007-03-23 16:56 EDT, James Bruck CLA
Kenn.Hussey: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven R. Shaw CLA 2007-02-09 22:03:17 EST
There's an api to create a dependency (createDependency), but since Usage is it's own type, this isn't sufficient.
Comment 1 James Bruck CLA 2007-02-11 21:15:02 EST
Steve, I agree that a more convenient API should be provided, in the meantime, you can try something like the following to create your USAGE.

Usage usage = (Usage) package_.createPackagedElement(
			null, UMLPackage.Literals.USAGE);

		usage.getClients().add(namedElement);
		usage.getSuppliers().add(supplier);

or use the factory methods to create your usage.

Comment 2 James Bruck CLA 2007-03-23 11:48:37 EDT
I would propose adding the following..

NamedElement#createUsage(NamedElement supplier)

NamedElement already has getters for dependencies ... ie. getDependency(String ...) etc.


Comment 3 Steven R. Shaw CLA 2007-03-23 15:46:02 EDT
sounds adequate to me...
Comment 4 James Bruck CLA 2007-03-23 16:56:45 EDT
Created attachment 61883 [details]
updated API

added new createUsage() function to NamedElement
Comment 5 Kenn Hussey CLA 2007-03-27 00:03:31 EDT
The changes have been committed to CVS.
Comment 6 Kenn Hussey CLA 2007-03-30 15:17:30 EDT
The changes are available in build I200703301423.
Comment 7 Nick Boldt CLA 2008-01-28 16:37:12 EST
Move to verified as per bug 206558.