4 Replies Latest reply on Jul 29, 2011 2:18 PM by aamonten

    brainstorming for a CDI Demo


      Hi, I just enhanced the number guess app (JSF + CDI) from the jboss as7 quickstart with a switchyard service for the random number generation. You will be able to look at it here:




      So this is a very basic application and with Keith we have been talking about making a more complete, so please provide some ideas/feedback.

        • 1. Re: brainstorming for a CDI Demo

          Hey Alejandro,

          Very cool.  I can already see some fun enhancements. :-)  A few questions/comments:


          • I noticed you included a switchyard.xml in src/main/webapp/META-INF.  Is there a reason why you are no relying on the automatic generation?  If it's just so we include the switchyard.xml in the packaged WAR, then maybe we can use the resource plugin in Maven to make sure the version generated in target/classes/META-INF makes it into the webapp?
          • Now that you have verified this works, I'm thinking it would be great to switch from number guess to an order submission application.  The interfaces and implementation beans from the orders quickstart can be reused here, so it's really just a matter of updating the JSP to take order input and display order ack output.
          • It would be cool if we could inject @Service references directly into the JSP using EL instead of relying on a backing bean which is then injected into the page.  Not sure if this is possible with our current CDI support, but it's something we should look at.




          • 2. Re: brainstorming for a CDI Demo

            Hi Alejandro,


            I just tried it and works like a charm. It is good to have a UI to interact with the services.


            Just thinking out loud here... what do you think about having a "Game Center" which has different Games (random-numbers would be one of these) using different implementations and differetn bindings, but "thanks to Switchyard" they can all be referenced homogeneously.


            Following Keith's suggestion to stay with the OrderService, we could have "An Order Center", which interact with different OrderServices using, once again, different implementations and bindings.


            I think this kind of demo could help to easily highlight one of the benefits of using Switcyhard in the backend.



            • 3. Re: brainstorming for a CDI Demo

              Hi Keith,

              I added the switchyard.xml while I was working on the app, but I have just tried it without the switchyard.xml file and it still works.


              I will keep working on enhancing the demo with yours and Mario's ideas!

              • 4. Re: brainstorming for a CDI Demo

                Mario, I will start working on the Order Service app and then continue with the Game Center, thanks for your suggestions!