Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tigerstripe-dev] Re: Annotations and routers: how does it work?

Title: Re: Annotations and routers: how does it work?
Hi Andrey, Yuri,

Thanks for the feedback. Yes indeed, I think you put your finger on the problem there.
I’m going to experiment and will update you.

Eric


On 6/12/08 8:47 AM, "Andrey Platov" <andrey@xxxxxxxxx> wrote:

Hi folks,

I'd like to add a short clarification to Yuri's email:

1) TAF routers should work well in current version, and will put your annotations wherever you specify (of course remembering that location).
2) Current TS router creates "file://" EMF URI, which is used by EMF to create .ann file on the filesystem. This is not correct if .ann files will be stored within Eclipse Workspace. If you'd like to create .ann file as Workspace resource (file which belongs to Eclipse project) you shall create "platform://" EMF URI using URI.createPlatformResourceURI(...) as Yuri mentioned. In this case EMF will use Eclipse Resource API, and .ann files will be visible to Eclipse (including TAF). Indirect access to Eclipse Resources (bypassing Resource API) makes workspace out of sync with actual filesystem content, which is probably the problem we have in TS router.

Please update us if you need more info on this.

Kind Regards,
Andrey


----- Original Message -----
From: "Yuri Strot" <yuri@xxxxxxxxx>
To: "Eric Dillon" <erdillon@xxxxxxxxx>
Cc: "Andrey Platov" <andrey@xxxxxxxxx>, "Tigerstripe Developers" <tigerstripe-dev@xxxxxxxxxxx>
Sent: Thursday, June 12, 2008 1:04:04 PM GMT +06:00 Almaty, Novosibirsk
Subject: Re: Annotations and routers: how does it work?

Hi Eric,

TAF remember all files where you route annotations. I tested tigerstripe and didn't find any problems (after Eclipse restarting all annotations successfully restored when I select corresponding elements). However, I don't find a way to store annotations in separate files (all of them stored in the /annotations/org.eclipse.tigerstripe.annotation.core.test.ann file).

I've also found that your router use file URI (URI.createFileURI(...)). In fact, it's better to use platform URI (URI.createPlatformResourceURI(...)) because when you create EMF file resource it will be asynch with the workspace. Since we support *.ann files renaming, moving, etc. it can be the problem because when this resource will be synch with the workspace it will be interpreted by the TAF as new *.ann file. It's make framework not so flexible and I belive in future we will solve this problem, but while please use platform resources (you can found complete example in the org.eclipse.tigerstripe.annotation.example.router plug-in).

If this is not a file resource problem please describe how we can reproduce it (which project, artifacts, annotations, etc. should be created).

--
Best regards,
Yuri Strot

------------------------------

Hi Andrey, Yuri,

I¹m testing the integration of Tigerstripe with the TAF, and finding some
problems around the ³routing² mechanism for storage.
As mentioned before, in the Tigerstripe case, routing of all
³tigerstripe://...² annotations will be done to .ann files in the local
project. (see code in org.eclipse.tigerstripe.annotation.ts2project.router).
What we do there is basically route based on the nsURI of the target
annotation, so that all ³DesignNotes² will go into a single file, all
³HibernateHints² will go into another single file, etc...
That way we can choose to include a .ann file or not to provide the
corresponding annotations.

Now, when creating annotations, the routing logic works fine. It routes
Anntations properly.

But when I stop and restart Eclipse (with projects that contain multiple
.ann files), I don¹t get the annotations... The files are there but the
corresponding annotations don¹t appear in the Annotations Views.
I¹ve set a break point in the routing logic expecting that the TAF would use
that logic to figure what .ann files to read and load annotations but
nothing.

So, this is letting me believe that there is something missing here. At
start-up how does the TAF know what to load?

The weird thing is that, if I add new annotations on top of the existing
ones, they get routed properly and added to the right .ann files, I see them
in the UI but still can¹t see the ones created in the previous session.

Now, our routing requirements make it very dynamic. So you can¹t expect the
TAF to ³remember² the files. It needs to get the URIs on-demand when an
object is selected for all potential targets.
This may require a change in the API.

Please let me know your thoughts on that.

Thanks,
Eric



Back to the top