Package URI [message #646084] |
Tue, 21 December 2010 17:55  |
Eclipse User |
|
|
|
Hi,
I'm preparing the first release of JS4EMF and have been pondering what
the official annotation URI should look like. This URI is used when
annotating EClasses with constraints, EOperations with the body etc. I
know it has not meaning, but it still should look "nice". I've used
http://www.eclipse.org/emf/js4emf/source for a while, and then noticed
that the corresponding OCL URI is
http://www.eclipse.org/emf/2002/Ecore/OCL If I follow this pattern "my"
URI would be http://www.eclipse.org/emf/2002/Ecore/js or
http://www.eclipse.org/emf/2002/Ecore/Javascript.
The question is: Is there any URI policy, so I don't select a URI that
doesn't fit nicely in?
Hallvard
|
|
|
|
Re: Package URI [message #646143 is a reply to message #646097] |
Wed, 22 December 2010 05:47  |
Eclipse User |
|
|
|
On 22.12.10 03.53, Ed Merks wrote:
> Hallvard,
>
> Keep in mind that the text used in the tree view for an EAnnotation is
> computed like this:
>
> public String getText(Object object)
> {
> EAnnotation eAnnotation = (EAnnotation)object;
> StringBuffer result = new StringBuffer();
> if (eAnnotation.getSource() != null)
> {
> int index = getParent(eAnnotation) instanceof EAnnotation ? -1 :
> eAnnotation.getSource().lastIndexOf("/");
> if (index == -1)
> {
> result.append(eAnnotation.getSource());
> }
> else
> {
> result.append(eAnnotation.getSource().substring(index + 1));
> }
> }
> return result.toString();
> }
>
> So you'd definitely want the last segment to be descriptive and
> relatively unique. Your last choice seems nice...
Yes, that's one reason the URI is not arbitrary. My current one is shown
as "source" and that isn't very descriptive when you may be using
several languages, like OCL AND Javascript.
So, defining the constant as EcoreURI + "/" + languageName could be a
generic pattern, where languageName in my case is "Javascript" (or "JS").
Hallvard
> Hallvard Trætteberg wrote:
>> Hi,
>>
>> I'm preparing the first release of JS4EMF and have been pondering what
>> the official annotation URI should look like. This URI is used when
>> annotating EClasses with constraints, EOperations with the body etc. I
>> know it has not meaning, but it still should look "nice". I've used
>> http://www.eclipse.org/emf/js4emf/source for a while, and then noticed
>> that the corresponding OCL URI is
>> http://www.eclipse.org/emf/2002/Ecore/OCL If I follow this pattern
>> "my" URI would be http://www.eclipse.org/emf/2002/Ecore/js or
>> http://www.eclipse.org/emf/2002/Ecore/Javascript.
>>
>> The question is: Is there any URI policy, so I don't select a URI that
>> doesn't fit nicely in?
>>
>> Hallvard
|
|
|
Powered by
FUDForum. Page generated in 0.04461 seconds