Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Basic architecture question
Basic architecture question [message #434357] Fri, 30 March 2007 15:54 Go to next message
Mike Yawn is currently offline Mike YawnFriend
Messages: 50
Registered: July 2009
Member
I'm new to the whole annotation processing area, so apologies if this is
something that should have been obvious.

Mentally, I'm picturing a 'front end / back end' design, where a user could
use GUI tools such as Dali provides to generate annotations into their code,
and then I could plug in my own annotation processor to see those
annotations and generate the correct back-end code for our proprietary
persistence layer.

I'm just wondering if it breaks something if my processor 'claims' those
annotations; because I would assume Dali needs to see changes users might
make manually to the annotations in order to update the model. Does Dali
install an annotation processor to do this, or is it responding directly to
events from the editor? If Dali does have its own annotation processor, is
it possible for the two to play nice together (i.e., Dali continues to do
everything needed to make the GUI tools work, but doesn't do any code
generation)
Re: Basic architecture question [message #434366 is a reply to message #434357] Mon, 02 April 2007 20:56 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
Registered: July 2009
Senior Member
Hi Mike,

Let me see if I can answer some of your questions.

> I'm just wondering if it breaks something if my processor 'claims' those
> annotations; because I would assume Dali needs to see changes users might
> make manually to the annotations in order to update the model. Does Dali
> install an annotation processor to do this, or is it responding directly to
> events from the editor? If Dali does have its own annotation processor, is
> it possible for the two to play nice together (i.e., Dali continues to do
> everything needed to make the GUI tools work, but doesn't do any code
> generation)


Using the Annotation Processor Tool (or APT) would likely be the best way
to go for what you are thinking about doing (as a side note there is
integration for APT in Eclipse -
http://www.eclipse.org/jdt/apt/index.html). Your processor doesn't really
have to "claim" these annotations for itself, but rather it would simply
perform an action as a result of processing them. A number of annotation
processors could operate on the same annotations. I believe they would
run sequentially and there wouldn't be any issues with processing the same
annotation more than once. That said, Dali does not make use of APT. An
annotation processor is good for doing one-way operations, such as
building a model, generating code, or performing a validation run. They
look at a snapshot of source code. Dali functionality requires granular
interaction with the JDT model, involving the reading and writing out of
specific source code updates.

As you suggest, Dali does have to be aware of any manual edits to the JPA
annotations, but we are indeed listening for events that inform us when we
need to update the model. We don't use annotation processing for any of
that functionality, but even if we were, it shouldn't interfere with what
you are trying to do.

Hope this clears things up a bit.

Neil

Mike Yawn wrote:

> I'm new to the whole annotation processing area, so apologies if this is
> something that should have been obvious.

> Mentally, I'm picturing a 'front end / back end' design, where a user could
> use GUI tools such as Dali provides to generate annotations into their code,
> and then I could plug in my own annotation processor to see those
> annotations and generate the correct back-end code for our proprietary
> persistence layer.



> I'm just wondering if it breaks something if my processor 'claims' those
> annotations; because I would assume Dali needs to see changes users might
> make manually to the annotations in order to update the model. Does Dali
> install an annotation processor to do this, or is it responding directly to
> events from the editor? If Dali does have its own annotation processor, is
> it possible for the two to play nice together (i.e., Dali continues to do
> everything needed to make the GUI tools work, but doesn't do any code
> generation)
Re: Basic architecture question [message #593397 is a reply to message #434357] Mon, 02 April 2007 20:56 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
Registered: July 2009
Senior Member
Hi Mike,

Let me see if I can answer some of your questions.

> I'm just wondering if it breaks something if my processor 'claims' those
> annotations; because I would assume Dali needs to see changes users might
> make manually to the annotations in order to update the model. Does Dali
> install an annotation processor to do this, or is it responding directly to
> events from the editor? If Dali does have its own annotation processor, is
> it possible for the two to play nice together (i.e., Dali continues to do
> everything needed to make the GUI tools work, but doesn't do any code
> generation)


Using the Annotation Processor Tool (or APT) would likely be the best way
to go for what you are thinking about doing (as a side note there is
integration for APT in Eclipse -
http://www.eclipse.org/jdt/apt/index.html). Your processor doesn't really
have to "claim" these annotations for itself, but rather it would simply
perform an action as a result of processing them. A number of annotation
processors could operate on the same annotations. I believe they would
run sequentially and there wouldn't be any issues with processing the same
annotation more than once. That said, Dali does not make use of APT. An
annotation processor is good for doing one-way operations, such as
building a model, generating code, or performing a validation run. They
look at a snapshot of source code. Dali functionality requires granular
interaction with the JDT model, involving the reading and writing out of
specific source code updates.

As you suggest, Dali does have to be aware of any manual edits to the JPA
annotations, but we are indeed listening for events that inform us when we
need to update the model. We don't use annotation processing for any of
that functionality, but even if we were, it shouldn't interfere with what
you are trying to do.

Hope this clears things up a bit.

Neil

Mike Yawn wrote:

> I'm new to the whole annotation processing area, so apologies if this is
> something that should have been obvious.

> Mentally, I'm picturing a 'front end / back end' design, where a user could
> use GUI tools such as Dali provides to generate annotations into their code,
> and then I could plug in my own annotation processor to see those
> annotations and generate the correct back-end code for our proprietary
> persistence layer.



> I'm just wondering if it breaks something if my processor 'claims' those
> annotations; because I would assume Dali needs to see changes users might
> make manually to the annotations in order to update the model. Does Dali
> install an annotation processor to do this, or is it responding directly to
> events from the editor? If Dali does have its own annotation processor, is
> it possible for the two to play nice together (i.e., Dali continues to do
> everything needed to make the GUI tools work, but doesn't do any code
> generation)
Previous Topic:Dali Installation
Next Topic:JPA Activation
Goto Forum:
  


Current Time: Tue Dec 23 01:07:28 GMT 2014

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

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