Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Package URI
Package URI [message #646084] Tue, 21 December 2010 22:55 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 672
Registered: July 2009
Location: Trondheim, Norway
Senior Member
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 #646097 is a reply to message #646084] Wed, 22 December 2010 02:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31540
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080504090004050204090402
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

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...



Hallvard Tr


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Package URI [message #646143 is a reply to message #646097] Wed, 22 December 2010 10:47 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 672
Registered: July 2009
Location: Trondheim, Norway
Senior Member
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
Previous Topic:[EEF] EFeatureMap code generation.
Next Topic:[EMF Compare] Standalone mode with adapting comparison process
Goto Forum:
  


Current Time: Wed Oct 21 14:10:09 GMT 2020

Powered by FUDForum. Page generated in 0.04911 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top