7 Replies Latest reply on Feb 16, 2010 6:11 PM by Francisco Jose Peredo Noguez

    Creating a modular application with Seam

    Eric Taylor Newbie

      Hello Forum:


      I just purchased Developer Studio and have begun to dive into JBoss and JBoss Seam.  I must say that I'm singularly impressed with the whole platform.


      I'm a certified .NET developer, and I'm quite familiar with the Adobe space--from Flash Builder and Dreamweaver up top to ColdFusion in the middle.


      My question concerns modularity.  Consider, say, Microsoft Outlook for a moment.  On the left, we have an accordion-based navigation control.  Each item in that control represents a module of sorts.  In Outlook, the modules have cross-cutting concerns and, of course, access the same underlying MAPI database.


      Is this sort of approach doable in Seam?  Or do we allow the browser's tab mechanism to supply the navigational system (as opposed to a tabbed control in a single Seam application), and then just bind to the same underlying data model, separating concerns with contexts?


      I ask because, you know, there's no easy way to do modularity in Flex (or in any framework for that matter).  Cairngorm isn't really suited for it (although it can do it); the Potomac framework is too young; ColdBox doesn't really stretch into the UI.  This caught us be surprise as we moved further into the Flex space.


      Thank you.


      Eric

        • 1. Re: Creating a modular application with Seam
          Francisco Jose Peredo Noguez Master

          Eric Taylor wrote on Feb 15, 2010 18:48:


          Hello Forum:

          I just purchased Developer Studio and have begun to dive into JBoss and JBoss Seam.  I must say that I'm singularly impressed with the whole platform.


          I am curious... what impressed you the most?



          I'm a certified .NET developer, and I'm quite familiar with the Adobe space--from Flash Builder and Dreamweaver up top to ColdFusion in the middle.


          Certified in WindowsForms.NET? or in ASP.NET? (just too better understand your perspective)



          My question concerns modularity.  Consider, say, Microsoft Outlook for a moment.  On the left, we have an accordion-based navigation control.  Each item in that control represents a module of sorts.  In Outlook, the modules have cross-cutting concerns and, of course, access the same underlying MAPI database.

          Is this sort of approach doable in Seam?


          Doable it is, (it is even doable in assembly language for that matter), comfortable to do... I guess it depends... with with Weld I would be comfortable saying that the non-gui component architecture is mature. In Seam 2... I do not feel like it is, conversations, and bijection (and specially JSF) make things unnecessary complicated IMO. (Just search for problems dealing with nested conversations, or information exchange between conversations to see what I mean, or search about representing recursive navigational graphs... or about dealing with multiple nested modal panels or scoped indexes in richfaces)



          Or do we allow the browser's tab mechanism to supply the navigational system (as opposed to a tabbed control in a single Seam application), and then just bind to the same underlying data model, separating concerns with contexts?


          Well, conversations in Seam are IMO pretty much there to make it possible to deal comfortably with browser's tab but, at the same time, in my experience, do not help much if you plan on building an application on a single page... if your application is more like a website presenting documents, with little interaction in a single page, Seam and Richfaces might be a great solution for you, if, on the other hand, you are looking to create a something high complexity in each page, you will find a better solution in Flex, or ZK, or Echo, or OpenLazslo, or ExtJs or Capuchinno... and all of them makes the server side component model much  less important



          I ask because, you know, there's no easy way to do modularity in Flex (or in any framework for that matter). 


          Well, if you think modularity is bad in Flex, it is because you have not tried JSF... afterwards you will love modularity support in Flex. Just try to hack in to the codebase of, for example RichFaces and  you will see what I mean... or try to solve the simple problem of representing a CRUD page of an entity with a one to many recursive relationship. IMO JSF abstraction breaks very fast when compared with Flex



          Cairngorm isn't really suited for it (although it can do it); the Potomac framework is too young; ColdBox doesn't really stretch into the UI.  This caught us be surprise as we moved further into the Flex space.

          Thank you.

          Eric


          Well, if what you are looking for is high level of reutilization without an excessive amount of effort, JSF is IMO not the solution for  you (IMO not even JSF 2.0). Look at for example, this tabindex limitation or this focus handling limitation or the fact that rerender is subview blind.

          • 2. Re: Creating a modular application with Seam
            Arbi Sookazian Master

            Francisco Peredo wrote on Feb 15, 2010 21:40:


            Well, conversations in Seam are IMO pretty much there to make it possible to deal comfortably with browser's tab but, at the same time, in my experience, do not help much if you plan on building an application on a single page...


            beg to differ.  it's true that Seam does support apps with multiple tabs in the browser (see Hotel booking for example) - essentially workspaces - but you can also model conversational state in a use case that spans multiple pages in only a single tab as well, using a SFSB or JavaBean as backing bean for your JSF view, and take advantage of clicking the browser back button as well as atomic conversations via the SMPC and Hibernate manual flush mode.  Also, using manual flush, Seam/Hibernate solves the LazyInitializationExceptions by keeping the persistence context open for the duration of the conversation until the LRC ends.  Thus, entities are not prematurely detached from the PC as is the case with the default auto flush mode.


            I would say that nested conversations may be somewhat less useful and AFAIK are not in CDI spec (i.e. Weld currently does not support nested conversations).

            • 3. Re: Creating a modular application with Seam
              Eric Taylor Newbie

              Francisco,


              Thank you for the reply.



              I am curious... what impressed you the most?

              The breadth and depth of the platform.  On the .NET front, before settling on LLBLGen Pro as my ORM of choice, I worked extensively with NHibernate.  I was happy to see Hibernate as part of the stack.  Also, the inclusion of a full-blown BPM platform impressed me.  Anything's got to be better than Workflow in the .NET space.  Concerning the server, I had never before set up a JBoss server.  I was able to download the AS, get it up and running, connect it to IIS ( a little tricky), and then get BlazeDS and ColdFusion running...all in about 3 hours (actually, I had the server up in about 10 minutes).



              Certified in WindowsForms.NET? or in ASP.NET? (just too better understand your perspective)

              We have to study both, but I'm definitely a desktop guy.  I love WinForms, warts and all.  I'm definitely not a Web guy, but I'm becoming one.  Salesforce opened my eyes to the possibilities.




              ...if, on the other hand, you are looking to create a something high complexity in each page, you will find a better solution in Flex, or ZK, or Echo, or OpenLazslo, or ExtJs or Capuchinno... and all of them makes the server side component model much less important.

              Oh.  Well, yes, our first application will be just that: complex.  You mention a lot of frameworks here.  Any opinions or recommendations?



              Well, if what you are looking for is high level of reutilization without an excessive amount of effort...

              Isn't everybody? :).


              Thanks for the food for thought.  It sounds to me that we might be better off with, say, Clear Toolkit and Flex.






              • 4. Re: Creating a modular application with Seam
                Arbi Sookazian Master

                The enterprise Java space is all about frameworks (and has been for many years).  It's almost a waste of time to ask which ones to use as you'll find advantages and disadvantages with them all.  And new ones crop up seemingly every month.


                One tool worth checking out is JRebel 3 for class reloading.  Esp. for a .NET guy, you'll notice that your productivity is shot to hell in Eclipse/JBoss, etc. compared to RoR/Grails or .NET.

                • 5. Re: Creating a modular application with Seam
                  Francisco Jose Peredo Noguez Master

                  Eric Taylor wrote on Feb 15, 2010 22:42:


                  I am curious... what impressed you the most?

                  The breadth and depth of the platform. 


                  I certainly does a lot of things :-).



                  On the .NET front, before settling on LLBLGen Pro as my ORM of choice, I worked extensively with NHibernate.  I was happy to see Hibernate as part of the stack.


                  Hibernate does a lot of powerful stuff, but in my opinon, the EntityFramework (thanks to LINQ) looks as a better option I specially do not like the fact that queries are forbidden inside entities in Hibernate, which leads you to an anemic domain model.
                  (although if you ask what I really like, I think people should pay some attention to the potential of Rel or Dataphor, ORMs with their object oriented extensions to SQL can only soften a little the blow of the spectacular design mistakes of SQL)



                  Also, the inclusion of a full-blown BPM platform impressed me.  Anything's got to be better than Workflow in the .NET space.


                  Yeah,well, if you ask me, the usefulness of all any work flow solutions are overrated, but I can accept that it might be the case that for you it does help to solve a problem.



                  Concerning the server, I had never before set up a JBoss server.  I was able to download the AS, get it up and running, connect it to IIS ( a little tricky), and then get BlazeDS and ColdFusion running...all in about 3 hours (actually, I had the server up in about 10 minutes).


                  Mmmm, 10 minutes... to start JBoss... 3 hours with ColdFusion (have you tried Railo BTW? it is a free, open-source alternative for ColdFusion application development)
                  You seem to be a smart guy, it took me more time to grasp the basics of a JEE appserver like JBoss (specially from inside Eclipse)...and I ended up switching to Tomcat because I did not need any of JBoss advanced features...(and I initiall worked with Netbeans fora long time because I found Eclipse too confusing, I now have a very customized Eclipse in my machine, but it did took me a while to get used to it)
                  I don't how to put this, please do not get me wrong, but with VS.NET anyone can have a Silverlight project running in less than 30 seconds... that IMO makes me really hard to understand why you like the idea of leaving .NET. And using LINQ and the EntityFRamework combined with ADO.NET Dataservices you can have multitier persistence in almost no time (something I have not seen since my WebObjects days)... so I am a little confused with your preferences...



                  Certified in WindowsForms.NET? or in ASP.NET? (just too better understand your perspective)

                  We have to study both, but I'm definitely a desktop guy.  I love WinForms, warts and all.  I'm definitely not a Web guy, but I'm becoming one.  Salesforce opened my eyes to the possibilities.


                  It does has great possibilities, but it also has really big underlying limitations (like lack of good focus handling, or the lack of good data frameworks: no ORMs for javascript and believe me,you will end up writing everything in javascript if you application is going to be highly interactive and you want it to feel fast). I can not wait for Flex or Silverlight to kill HTML+JS, but guess it will never happen.




                  ...if, on the other hand, you are looking to create a something high complexity in each page, you will find a better solution in Flex, or ZK, or Echo, or OpenLazslo, or ExtJs or Capuchinno... and all of them makes the server side component model much less important.


                  Oh.  Well, yes, our first application will be just that: complex.  You mention a lot of frameworks here.  Any opinions or recommendations?


                  I think,that on the HTML+JS arena, the future (even if I do not like it) might be in Jaxer if you are going to build a complex application, and that means a lot of javascript, why not use a platform that really embraces it. You can then combine it with Capuccino, or ExJS, or JQuery or Prototype, or any (and all) of the JavaScript frameworks that are so on hype right now. It really makes DWR or Seam Remoting look primitive in comparision... the only thing missing (nothing is perfect) is that is not implemented in top of Rhino, so no Java support (you will might miss JDBC)



                  Well, if what you are looking for is high level of reutilization without an excessive amount of effort...

                  Isn't everybody? :).


                  Lately... not sure, it seems to me that the main objective or most, right now, is to make copy&paste programming easier. I do not like it, but it is what I seem to find almost everywhere.




                  Thanks for the food for thought.  It sounds to me that we might be better off with, say, Clear Toolkit and Flex.



                  Yeap... or maybe you should try Silverlight... have you?

                  • 6. Re: Creating a modular application with Seam
                    Eric Taylor Newbie

                    Francisco,



                    Hibernate does a lot of powerful stuff, but in my opinon, the EntityFramework (thanks to LINQ) looks as a better option

                    EF is very limited right now.  There is nothing out there that touches LLBLGen Pro and its use of dynamic SQL (it supports stored procedures, as well, though).



                    ...have you tried Railo BTW?

                    Yes, I looked at Railo.  But if you poke around on the Internet, you'll find articles pointing up the fact that it's not 100% faithful to ColdFusion.  In its defense, though, I didn't thoroughly explore whether those articles were stale.  Perhaps that's not the case anymore.



                    ...don't how to put this, please do not get me wrong, but with VS.NET anyone can have a Silverlight project running in less than 30 seconds... that IMO makes me really hard to understand why you like the idea of leaving .NET. And using LINQ and the EntityFRamework combined with ADO.NET Dataservices you can have multitier persistence in almost no time (something I have not seen since my WebObjects days)... so I am a little confused with your preferences...

                    Believe me, anything .NET is more fun wanting (and buying) then having.  Yes, you're right: One can get up and running on VS pretty quickly and even have a rudimentary application running in 30 minutes, as you say--whether the technology be WinForms, WPF, ASP.NET, or Silverlight.  Because we can connect to data sources so easily, and because data-binding (in WPF) is so wonderful, all of our problems are solved...I guess.  What's interesting, though, is that I never really found the data manipulation to be terribly challenging anyways.  (Just for the record, ADO.NET pales in comparison to ADO).  What I found challenging was having to write an undo-redo (UR) management framework from scratch (my framework actually support a Cooperian UR mechanism, where history is persisted with the object(s) to which it pertains when the application exits).  Also, Microsoft never brought over commanding from MFC.  So I had to write a commanding framework as well, which, of course, ties into UR.  (On a side note, I found that using the Flyweight pattern instead of the Command pattern makes commanding much more attractive.  I wound up with two classes: Command and ClosedCommand, and that's it).  And then there's the whole navigation thing, which brings in the modularity issues, which in turn leads one down the DI path, which leads one to contemplate suicide...


                    .NET, it turns out, is a very expensive technology to develop with and to maintain.  I just can't say how impressed I am with some of the OpenSource projects out there: Eclipse, JBoss AS, JBoss Seam (and all of its underlying technologies), JasperReports, BIRT, RichFaces, and so on.  I do prefer VS over Eclipse, but Eclipse is starting to grow on me.



                    Yeap... or maybe you should try Silverlight... have you?

                    I have, and I prefer Flex.  No matter what Microsoft does on the front end, there will always be the issue of plumbing.  Rocky Lhotka's CSLA.NET is wonderful, but it comes up only to the level of business objects.  I've been using his framework on top of LLBLGen Pro, but there's nothing bridging the gap from the business objects tier to the presentation tier.  That space, I think, is more muddled and less developed.







                    • 7. Re: Creating a modular application with Seam
                      Francisco Jose Peredo Noguez Master

                      Eric Taylor wrote on Feb 16, 2010 17:34:


                      Francisco,

                      Hibernate does a lot of powerful stuff, but in my opinon, the EntityFramework (thanks to LINQ) looks as a better option

                      EF is very limited right now.


                      You think? What limitation is hurts you the most? (I am also at crossroads right now, thinking seriously to go back to .NET, since it seems to getting closer to what WebObjects had 10 years ago, but I might be wrong)



                      There is nothing out there that touches LLBLGen Pro and its use of dynamic SQL (it supports stored procedures, as well, though).


                      I played with the very first version of LLBLGen and did not like it... I guess that, for me, nothing out there touches EOF but IMO the EntityFramework sure seems to be in the right track...




                      ...have you tried Railo BTW?

                      Yes, I looked at Railo.  But if you poke around on the Internet, you'll find articles pointing up the fact that it's not 100% faithful to ColdFusion.  In its defense, though, I didn't thoroughly explore whether those articles were stale.  Perhaps that's not the case anymore.

                      ...don't how to put this, please do not get me wrong, but with VS.NET anyone can have a Silverlight project running in less than 30 seconds... that IMO makes me really hard to understand why you like the idea of leaving .NET. And using LINQ and the EntityFRamework combined with ADO.NET Dataservices you can have multitier persistence in almost no time (something I have not seen since my WebObjects days)... so I am a little confused with your preferences...

                      Believe me, anything .NET is more fun wanting (and buying) then having.  Yes, you're right: One can get up and running on VS pretty quickly and even have a rudimentary application running in 30 minutes, as you say--whether the technology be WinForms, WPF, ASP.NET, or Silverlight.  Because we can connect to data sources so easily, and because data-binding (in WPF) is so wonderful, all of our problems are solved...


                      Well, .NET databinding is still not as good as WebObjects/Cocoa/Interface Builder databinding, but it sure comes closer than anything else I have seen. In Java, the only thing I have seen that can compete in that regard is JSR-296 sadly, it was not a priority for Sun... (but has very good support from NetBeans, have you tried it?, you may like it, the IDE has a much closer to the user experience to the one in VS.NET )



                      I guess.  What's interesting, though, is that I never really found the data manipulation to be terribly challenging anyways.  (Just for the record, ADO.NET pales in comparison to ADO).  What I found challenging was having to write an undo-redo (UR) management framework from scratch (my framework actually support a Cooperian UR mechanism, where history is persisted with the object(s) to which it pertains when the application exits).


                      Sadly, other than XMF, I have not read about any language with first class support for undo



                      Also, Microsoft never brought over commanding from MFC.  So I had to write a commanding framework as well, which, of course, ties into UR.  (On a side note, I found that using the Flyweight pattern instead of the Command pattern makes commanding much more attractive.  I wound up with two classes: Command and ClosedCommand, and that's it).  And then there's the whole navigation thing, which brings in the modularity issues, which in turn leads one down the DI path, which leads one to contemplate suicide...


                      Well, navigation is one more thing I miss from WebObjects, I can feel your pain ;-).



                      .NET, it turns out, is a very expensive technology to develop with and to maintain.  I just can't say how impressed I am with some of the OpenSource projects out there: Eclipse, JBoss AS, JBoss Seam (and all of its underlying technologies), JasperReports, BIRT, RichFaces, and so on.  I do prefer VS over Eclipse, but Eclipse is starting to grow on me.


                      Yes, well, Eclipse is excellent for Java, sadly, much of the coding done nowadays is not in java, but in JavaScript, and I am yet to find an IDE with good support for that (good being as god as Eclipse supports Java). Oh, and forget about any standard for databinding in JavaScript: Everybody does it in different incompatible and often highly programmatic ways.



                      Yeap... or maybe you should try Silverlight... have you?

                      I have, and I prefer Flex.  No matter what Microsoft does on the front end, there will always be the issue of plumbing.  Rocky Lhotka's CSLA.NET is wonderful, but it comes up only to the level of business objects.  I've been using his framework on top of LLBLGen Pro, but there's nothing bridging the gap from the business objects tier to the presentation tier.  That space, I think, is more muddled and less developed.



                      I really think you should take a second look at EntityFramework with DataServices, there IMO is nothing like that in the Java Word, you can even use it as the backend for Flex... (of course, you have to use XML or JSON to transfer data to you Flex app... mmmm,  I wonder if it possible to port GraniteDS AMF serialization to .NET and plug it into DataServices... that would be really interesting project...)