Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tigerstripe-dev] Using annotations....

Title: Re: [tigerstripe-dev] Using annotations....
FYI, I posted a few comments on the corresponding bug:


On 5/12/08 12:42 PM, "Steve Jerman (stjerman)" <stjerman@xxxxxxxxx> wrote:

So, I am trying to make use of the Annotations framework from Tigerstripe...

I declared an OclConstraint annotation with 3 attributes (type, description and constraint).

I then used the annotation from Tigerstripe in a plugin:

#foreach ($entity in $entities)

$entity.Name | $entity.getAnnotations(

($ocl = $entity.getAnnotations("tigerstripe"))

($o in $ocl)

-> $o.content.language

-> $o.content.description

-> $o.content.constraint


This is hardly user friendly. Looking in the implementation of org.eclipse.tigerstripe.annotation.core.Annotation and  org.eclipse.tigerstripe.workbench.internal.core.model.ArtifactComponent

I see the following issues:

1) Annotation just contains the URI of the annotated object and the annotation itself. There is no information about what the annotation is. What I actually want to do is something like:

($anno = $entity.getAnnotations("tigerstripe"))

($a in $anno)

($a.type == "OclConstraint)

-> $a.content.language

-> $a.content.description

-> $a.content.constraint



2) I also want to get able to directly access an annotation:

($ocl = $entity.getAnnotation("tigerstripe","OclConstraint"))




--> Should throw an exception if more than one defined...

($ocls = $entity.getAnnotations("tigerstripe","OclConstraint"))

These should both return the annotation content, rather than the annotation itself.

Recommended Fix:

1) Add annotationType field to the Annoation object and populate it with the model object name (maybe need more that this? - the annotation URI?)

2) Modify the methods in AbstractComponent as described above.

I will raise bugzillas for this..


tigerstripe-dev mailing list

Back to the top