5 Replies Latest reply on Oct 26, 2009 5:05 PM by luxspes

    Weld and metadata

    asookazian

      We know that JBoss is currently big on annotations for metadata (as is the rest of the SE/EE community).


      It's certain (or pretty close anyways) that XML and annotations will be replaced by a better method for identifying metadata, etc.  It would have been cool if Weld introduced that concept to the JEE world...


      what method would be better than XML or annotations?  any ideas?  it's interesting, b/c nobody ever discusses this topic.

        • 1. Re: Weld and metadata
          nickarls

          I don't even have a clue what it could be replaced with, either it's centralized somewhere (XML) or it's close to the place where it's used (annotations). Where else could it be and how different could it be from the existing corresponding solutions? Sure, you can do stuff a bit differently but what new stuff could it be that's so unheard of that it would be worth parting from the stuff that is already used? Both XML and annotations have their place...

          • 2. Re: Weld and metadata
            gavin.king

            Nick, the correct answer is that you have a new language (i.e. not Java) that fully supports both declarative and procedural modes of expression. Annotations are a (very) half-step in that direction. Of course, this is well outside of the scope of JSR-299.

            • 3. Re: Weld and metadata
              asookazian

              It's outside the scope of 299 but I brought it up anyways because it's somewhat relevant.  (Plus I was interested in hearing some answers from the 299 Gods ;)).


              So how do languages like Scala handle metadata? (Scala is a hybrid language, no?)  Weld written in Scala would be interesting...  Will 299/Weld always be tied to Java??

              • 4. Re: Weld and metadata

                Arbi Sookazian wrote on Oct 23, 2009 23:02:


                It's outside the scope of 299 but I brought it up anyways because it's somewhat relevant.  (Plus I was interested in hearing some answers from the 299 Gods ;)).


                Probably Weld will get a Java configuration option as Spring does in the near future. (The only advantage of XML configuration is that it does not need to be recompiled... so I guess a Groovy configuration option or a Bean Shell configuration option or a JRuby configuration option or even a Clojure configuration option is all we need to finally drop those ugly XML files).



                So how do languages like Scala handle metadata? (Scala is a hybrid language, no?)  Weld written in Scala would be interesting...  Will 299/Weld always be tied to Java??


                Scala is, AFAIK an hybrid between Object Oriented and Functional Oriented language... since it is particularly good to create DSLs, I guess it could be used to provide a new way of configuring IoC a Scala configuration option

                • 5. Re: Weld and metadata

                  Arbi Sookazian wrote on Oct 23, 2009 23:02:


                  Weld written in Scala would be interesting... 



                  Weld written in Scala, I don't think so, and implementation of JSR 299 written in Scala? could be interesting...
                  a new JSR taking advantages of Scala features to offer new exciting features? even better!




                  Will 299/Weld always be tied to Java??



                  Weld is written in Java, but that does not mean it is tied to it, AFAIK nothing prevents you from having your projects written in Scala, Clojure or Groovy and use Weld for your IoC needs.


                  Of course, it would be interesting to have extensions on top of Weld like equivalent to the Bindforge DSL for Guice (which is implemented in Scala, while Guice is (AFAIK) implemented in Java). And nothing prevents anyone from doing that.