[ 
https://issues.apache.org/jira/browse/PIVOT-578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891163#action_12891163
 ] 

Sandro Martini commented on PIVOT-578:
--------------------------------------

> 1) Where might such an annotation be applied (i.e. to what class or method)?
I'm thinking on a method, or maybe on an instance variable where the bxml is 
injected, but at the moment it's only an idea

> 2) What entity would be responsible for processing the annotation? 
a pivot class, but sorry here maybe I don't have well understood your question 
...

> 3) What would processing the annotation do? BXML isn't compiled - the only 
> way to validate it is to attempt to load it. 
Right, and maybe some initial checks could be try to read it and see if it's a 
well-formed xml, then ask the serializer to load it and see if some exception 
occurs or if null returns, etc ...
> If you try to write a compiler (or "verifier"), you'll probably end up 
> re-writing BXMLSerializer.
No I don't want to make this, you have reason, but maybe with some enhancements 
to it could be enough (or a custom serializer extending it) ... but also this 
has to be seen

> It might make more sense to implement this as an IDE plugin or Ant task 
> rather than an annotation. 
I understand, but when I use Maven for example ? 
Or if I'd want to put those checks inside my test classes only ?
On the namespace pre-population and other complex cases not covered by this 
approach I'd keep them out to not complicate this too much.

And last, I know that bxml is a runtime feature (and the same are all other 
modern toolkits for their counterparts), but how often do your prepare a 
release of an application, change something (test only the changed part) and 
sometimes other parts are broken (discovered only at runtime) maybe only for 
simple typos (for example some type in Javascript called from a web page) ? 
Note that here I'm speaking from my experience in general way, and not related 
to Pivot Applications (where this type of problems could be less present) :-) .
If we could make something to reduce this type of errors in users code, I think 
it's good, but without trying to handle all cases ...

Or do you think does not worth the effort ?


Thank you for your feedback,
Sandro


> create an annotation to check at compile time bxml files
> --------------------------------------------------------
>
>                 Key: PIVOT-578
>                 URL: https://issues.apache.org/jira/browse/PIVOT-578
>             Project: Pivot
>          Issue Type: New Feature
>            Reporter: Sandro Martini
>            Assignee: Sandro Martini
>            Priority: Minor
>
> In some cases could be useful to have an optional annotation to check (but at 
> compile time) bxml files, so when application grows, less tests should be 
> done by hand. This could be a great plus.
> For example checks could be more, ranging from existence of the resource 
> file, to check for a well-formed structure, to a well-formed contents (if 
> possible) ...
> At the moment this is only an experimental (optional) feature.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to