2 Replies Latest reply on Mar 7, 2007 1:55 PM by cja987

    static checking of components?

      It's nice that there's more than one way to create and name components in seam, but it certainly takes some discipline on the part of the programmer to organize them thoughtfully, and minor slips in naming result in null values getting injected. This is easy to catch when not using required=false or create=true, but it can be maddening otherwise. Every time I misspell a component name or forget some file when I've renamed it, I curse a little that I couldn't catch it until runtime. It's like the terse expressiveness of Java with the rigor and safety of python :p

      Is it possible or feasable for there to be a way for the scanner to check uses of @In to ensure that there is a matching @Out, @Name, @Role or declaration in components.xml? Scanning all injections at startup time would be pretty expensive, but could still be an option for a development environment.

      Adding something to JBossIDE to check seam annotations and add the appropriate squiggly lines would also be quite nifty with or without any of the other suggestions.

        • 1. Re: static checking of components?
          gavin.king

          There's something to be said for this. It would not be at all difficult to implement. Note that I could not actually throw an exception, since I can't detect the use of Context.set(name, value), but I could log a WARN.

          Add a feature request to JIRA. I think its a great idea.

          • 2. Re: static checking of components?

            Done, JBSEAM-1002.

            I just got to thinking that it would be neat if ComponentScanner and NamespaceScanner were themselves components that could be overridden. That way it'd be simple for anyone to add their own app-specific validation logic. Does make for a bit of a bootstrap problem, I'll admit.