5 Replies Latest reply on Oct 14, 2010 3:37 AM by lvdberg

    Suitability of Seam for Multiple Small Projects

    traviskds

      Hi


      Over the past couple of years I have been developing Seam based small projects for my company and deploying all these to one JBoss server.


      I find Seam and JSF/JPA (I guess JEE6) fantastic and very easy to develop and also very powerful especially when you need to grow these small apps as it has a lot of the enterprise level features.


      But my concern is that when you add more projects to JBoss, it takes a long time to start-up and also this started me thinking if Seam is really a good choice for small to medium applications that can be hosted on a shared JBoss app server.


      This may not be only a Seam issue but Java in general.  We also have another team that uses PHP via the Symfony framework and their deployment is really a breeze as it does not have the Java app server overhead.


      Now I know Java has a lot of benefits and you cannot compare PHP with Java for large scale projects but when it comes to small to medium projects I am interested to get the thoughts of the Seam community.


        • 1. Re: Suitability of Seam for Multiple Small Projects
          yahawari

          start-up time is of an essence when u are developing. for production servers that really has no value. what does a 10 min mean when u restart ur jboss server?. you shouldn't be doing that often anyway (otherwise it is not production!).


          ur concern is totally valid for development setup. i myself are investigating for a way to solve this. my application is getting larger and larger and the startup time is really getting on my nerves. i am using JRebel to minimize it, but it is very annoying still when it happens.


          java got some current options:
          1- OSGI 
          2- Google Guice
          3- Yet to come is java7 jigsaw.


          dynamic libraries should keep ur application size small (modularize ur application then mix and match).


          Seam2 is not modular enough. try running a couple of wars in an ear and u will start feeling the music. Try to add quartz jobs for those applications and the music will become hard-core rock :).


          Weld/CDI is going to the opposite extreme though. but we they seem to be far far away for current seam2 users, see how far is seam2 backward compatibility:
          http://in.relation.to/Bloggers/Seam3StatusUpdate


          basically seam2 developers would be the last to enjoy seam3, ironic right :).


          i don't want to seem sarcastic. I like seam and i know seam team got lotsa talents, but we gotta face the facts. nothing starts perfect and software by nature is an evolving process.


          i also have a php symphony guy on my team. he loves symphony (i have not used symphony, so i don't really know why :) ). many times when i get stuck in seam, he would snappily say that he could do that in symphony in a flick of a finger !!..


          long story short, seam is perfect for small projects and gets linearly less convenient for development as u grow!.



          • 2. Re: Suitability of Seam for Multiple Small Projects
            traviskds

            Thanks Yasser for your thoughts. Looks like we both are on the same boat. My PHP Symfony guys tell me the same with regard to Seam. But I do believe its easier to develop in Seam (i.e. JSF2, JPA etc) The more you get your head around the concepts, seam can be very powerful.


            I think the biggest issue is more the app server than the framework.In my case at a give time, I work on one or two projects only so its not a development issue but more a production issue where you are right that we don't need to restart a production server that often but my concern is how many wars can it handle before it starts to run out of resources and then compare this with PHP/Symfony.


            Maybe its time for me to start doing some research on OSGi as I believe JBoss 6 will have OSGi support and will look into Google Guice 3 and jigsaw.


            My ideal app server with regard to dynamic libraries should be something like this.


            Be able to create libraries by version. so for example on my JBoss app server, I can have Seam 2.1 folder with all the 2.1 jars in it, then Seam 2.2 folder with all the 2.2 jars in it etc.


            Then from my application war, I should be able to specify with version of the library to use. That way I do not need to keep packaging the same libraries in the war file over and over again but due to the ability to have different folders for each version, it will allow us to use different seam versions in the same app server. At the moment I do this by packaging it within the war file which is a best practice in the Java world.


            I think I can do this using an entry in the MANIFEST.MF file where you can specify the required jars. Need to test this out.



             

            • 3. Re: Suitability of Seam for Multiple Small Projects
              kapitanpetko

              Travis De Silva wrote on Oct 13, 2010 21:27:


              Thanks Yasser for your thoughts. Looks like we both are on the same boat. My PHP Symfony guys tell me the same with regard to Seam. But I do believe its easier to develop in Seam (i.e. JSF2, JPA etc) The more you get your head around the concepts, seam can be very powerful.



              I don't do PHP/Symphony, but developing with JSF/RichFaces is anything but easy or productive. Seam is quite good, but the whole JSF/server- driven Ajax UI thing is a complete fiasco. Because you have all this Ajax power, people will want dynamic interfaces close to what they have in desktop applications. As your UI gets more complex, it gets harder and near impossible to debug. The whole UI logic is embedded in RF tags (regions, rerender lists, and what not), good luck trying to figure out what's going on. So while I like Seam, developing anything past a simple CRUD app using Seam+JSF is unnecessarily complex and very unproductive. That is, IMHO, because xhtml+RF tags is a very ineffective DSL for developing UIs, plus the whole JSF lifecycle is getting in your way big time. Client-side UIs like Flex/GWT should be much more productive and easier to debug. You can still use Seam/CDI on the server side, but once you don't need conversations (because you have client-side state), the merits of Seam are not that much (of course, you can still use events, jobs, injection, etc.)


              Just my two cents after using Seam for a couple of years.


              PS. Forum formatting is still ridiculous after all this time...


              • 4. Re: Suitability of Seam for Multiple Small Projects
                cash1981

                Just a quick reply to Yasser's answer.


                I agree with regard to development and the validity of (re)deployment. However, you can use JRebel or even Stuart Douglas's fakereplace which basically gives you instant redeployment. Even for EJB's

                • 5. Re: Suitability of Seam for Multiple Small Projects
                  lvdberg

                  Hi,


                  some small additions from my part on the Seam is difficult discussion included in this thread. One of the big mistakes people make when they start with Seam  is that they need a thorough knowledge of the core technologies before using them. and this even includes core java knowledge (!) I am answering a lot of beginnners question from which I deduct that companies are pushing young developers without any real experience to use this state-of-the-art stuff because the market asks for it.


                  Almost 90% of all problems can be solved by just taking some time and study the provided documentation and examples. If you have any background in user-interfaces, EJB etc. using Seam is really not that hard and within 3/4 months you have all the needed skills.


                  One of the problems is that people think that everything can be solved by only using the silver-bullet Seam-gen and that's it. Let's be honest; it's a great tool, but besides knowing how to kick-start it, you should understand what it produces, because it works for a simple CRUD application but it will certainly NOT cover all the customers requirements.


                  Besides this I honstly think is that developing software is something more than creating 10.000 lines of code per day. There are things like maintainibility, extensibility etc. etc. Things where Seam with its annotation-based DYNAMIC DI outruns its competition.


                  Ok, now  back to the original question. I come from the time that systems had KILO-bytes and costed a fortune. When an application outgrows your server you should consider buying an additional server and migrate your specific application to the new one. It is as simpe as that.


                  Leo