You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Chris Bartlett <cb...@gmail.com> on 2010/07/22 18:21:37 UTC

Re: [jira] Commented: (PIVOT-578) create an annotation to check at compile time bxml files

I was thinking that something along the lines of a BXML 'checker' would be
useful and probably be part of any forthcoming GUI creation/editing tools.

Perhaps it could simply be an Ant task wrapper for BXMLSerializer which
would spit out warnings & errors, but also perform tasks such as reporting
any @BXML annotated fields that are null after binding, missing or unused
namespaces etc.  If so, and following with the 'BXML is for more than just
GUI creation' thinking, it would be a tool in its own right.

I haven't thought this through in any level of detail, but anything which
might help new users get started with using BXML would be beneficial.  Over
the last couple of months there have been a number of patches & improvements
to the BXML/WTKXSerializer classes to improve the quality of error
reporting, but I'm sure that more can be done to help catch some of the more
simple slip ups.

Regards,

Chris

On Thu, Jul 22, 2010 at 9:32 PM, Greg Brown (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/PIVOT-578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891190#action_12891190]
>
> Greg Brown commented on PIVOT-578:
> ----------------------------------
>
> I can see some potential value in it, but I think you should try to more
> clearly articulate what problem you are trying to solve and how you plan to
> solve it. BXML is primarily a shortcut for creating Java object hierarchies.
> You can write comparable Java code by hand to produce the same result - what
> benefits does the Java compiler offer you in this case that BXML currently
> does not?
>
> I'm not sure annotations will offer much here. What you are describing
> seems more along the lines of "javac for BXML", only it wouldn't produce
> compiled class files - only a boolean "valid" result. But you need to define
> what "valid" means. Again, I suspect that you might end up simply re-writing
> BXMLSerializer in order to determine a BXML document's validity.
>
>
> > 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.
>
>

Re: [jira] Commented: (PIVOT-578) create an annotation to check at compile time bxml files

Posted by Greg Brown <gk...@mac.com>.
BXMLSerializer already generates exceptions and warnings, so I'm not sure how much value a subclass would offer. Also, it would be kind of a pain to have to rewrite your application code to take advantage of the "debug version". So I don't think this would be the best approach.

On Jul 23, 2010, at 11:28 AM, Sandro Martini wrote:

> 
> Hi Chris,
> thanks for your comments ...
> 
> Personally I don't like too much the idea of an Ant task wrapper, because in
> my projects usually I use Maven or other products, but I'm not against this
> :-) , I only think it's not so general .
> 
> So, the idea to have another (mainly related to development environment)
> serializer extending the standard BXMLSerializer, and try to handle this
> type of warnings directly in it (in the hope to not have to change too much
> in the base class, if not little things) ?
> Maybe using the standard Java logging facilities (that's not the best, Ok,
> but to avoid other dependencies could be enough ...) and depending on the
> logging level write more or less warnings ?
> But have this data in log is Ok but not enough, because in unit tests I
> could also make some assertions on "I'm expecting no errors in the bxml
> file", "no warnings", etc ...
> Also in this case we'll have this feature only at runtime, but maybe also in
> unit tests this feature could be used simply.
> 
> Greg (and others), comments ?
> 
> Bye,
> Sandro
> 
> -- 
> View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/jira-Created-PIVOT-578-create-an-annotation-to-check-at-compile-time-bxml-files-tp986885p990044.html
> Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.


Re: [jira] Commented: (PIVOT-578) create an annotation to check at compile time bxml files

Posted by Sandro Martini <sa...@gmail.com>.
Hi Chris,
thanks for your comments ...

Personally I don't like too much the idea of an Ant task wrapper, because in
my projects usually I use Maven or other products, but I'm not against this
:-) , I only think it's not so general .

So, the idea to have another (mainly related to development environment)
serializer extending the standard BXMLSerializer, and try to handle this
type of warnings directly in it (in the hope to not have to change too much
in the base class, if not little things) ?
Maybe using the standard Java logging facilities (that's not the best, Ok,
but to avoid other dependencies could be enough ...) and depending on the
logging level write more or less warnings ?
But have this data in log is Ok but not enough, because in unit tests I
could also make some assertions on "I'm expecting no errors in the bxml
file", "no warnings", etc ...
Also in this case we'll have this feature only at runtime, but maybe also in
unit tests this feature could be used simply.

Greg (and others), comments ?

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/jira-Created-PIVOT-578-create-an-annotation-to-check-at-compile-time-bxml-files-tp986885p990044.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.