10 Replies Latest reply on May 4, 2007 3:22 PM by asavitsky

    Is seam-gen really a good idea to learn about seam?

    fperedo

      Hi!
      I mean, I love having a tool that generates everything...
      but it seems to me that has made the documentation a lot poorer:
      Its so easy to start building an applications, so why bother with an step by step guide, from only POJOs and Tomcat to J2EE with JBoss to J2EE with any container you like, that really explains the differences between:
      -Limitations for in Seam with only POJOs (what can not be done)
      -Limitations for Seam with Tomcat without the jboss microcontainer
      -Limitations for Seam with Tomcat with the jboss microcontainer in tomcat
      -Limitations for Seam with Tomcat with the jboss microcontainer in other
      container with the same level functionality as tomcat
      -Limitations for Seam with Tomcat with jboss (none I guess?)
      -Limitations for Seam with Tomcat with glassfish
      -Limitations for Seam with Tomcat with other somewhat EJB3 complaint containers (like oc4j)

      And finally:
      -Limitations for Seam without generation (why is generation so useful with seam? was it written to make it a lot easier to work with a generator? (because let me tell you I have tried to use it without the generator and failed... I think it is pretty hard)

      A nice way to present it would be:

      -How to use seam in eclipse without know anything about "ant" or using seam-gen
      -How to use seam in netbeans without know anything about "ant" or seam-gen

      What do you think? have you had the same problems.

      (Just to clarify, a think Seam is a really good framework, and I really would like to use it for lots of my future projects, but right now, I am finding it really really hard, because there is no way to build a really simple introductory example, and build more complex things from there, I feel that seam-gen is good for experts, not not for "becoming an expert")

        • 1. Re: Is seam-gen really a good idea to learn about seam?
          stu2

          I was a complete newbie in January, so have recently followed the path you're on. I think seam-gen's main benefit is just providing a project structure and correct packaging of a seam app. The generation stuff was useful for my first test page, but I haven't used it since. It's much better to just create things by hand, especially since seam apps tend to be code-light.

          I did find the book useful. I picked up a rough cut from Oreilly's safari, and read it straight through. It's a little dated (seam development is moving FAST), but is a much gentler introduction than the docs. Docs become extremely useful once you get the core concepts.

          Beyond that, I've found that the breadth of example apps included to be tremendously helpful. When I'm not sure how to do something, I often grep through the example source to see where whatever-it-is is being used. The wiki in particular elegantly implements some non-trivial functionality. Lots to be learned from looking at others' code.

          • 2. Re: Is seam-gen really a good idea to learn about seam?
            fperedo

            I tried creating a "without J2EE5" application directly based in the register application... but... just failed... and couldn't find any posts (with answers) of problems similar to the ones I had...
            I also didn't like the fact that all examples share the same huge ant file (makes it hard to understand if you are not an ant expert)
            I believe seam-gen is a very good "power utility" for certain cases... but an step by step:
            transient POJOs to persistent POJOS to J2EE5 tutorial is really really missing...

            • 3. Re: Is seam-gen really a good idea to learn about seam?
              pmuir

              yeah, seam-gen caters for the majority by providing ee5 ootb. i'm not quite sure *what* a "transient POJOs to persistent POJOS to J2EE5 tutorial" is... the tutorial really builds up from basics!

              • 4. Re: Is seam-gen really a good idea to learn about seam?
                fperedo

                Hi!
                well a "transient POJOs to persistent POJOs to J2EE5 tutorial" would be:
                -First, transient POJOs: show me what can be done in
                SEAM without JPA or Hibernate. (a really simple in memory POJOs example with 1 page first, and then 2 or three) ¿this part needs the microcontainer?

                -Second, persistent POJOs: evolve from the first tutorial and make some of its POJOs persistent (using just Hibernate, then show how to do it with JPA annotations) ¿this part needs the microcontainer?

                -Third, full J2EE, add stuff like stateless & statefull POJOS that can only be done having a full J2EE5 stack (is there a difference between having a full J2EE5 stack and using the microcontainer?)

                Currently, the documentation starts with a short example, but that doesn't make it simple, too much background is needed to understand how all the moving parts of SEAM interact to give life to that example... that is why I want a step by step example... I understand that once I am an expert in SEAM I will want to use the generator to save me from doing repetitive stuff, but, now that I am a beginner... I find it a little overwhelming... of course I can "just use it", but I am worried that after a while I find that I need to customize something "low level" and, if that happens... I am going to feel trapped in a dead end...

                • 5. Re: Is seam-gen really a good idea to learn about seam?
                  fperedo

                  Perhaps, between each of the 3 steps of the tutorial, to show, the difference between more or less integration with J2EE, the tutorial should try to use SEAM "wrong" (trying to do something that can only be done with SEAM tutorial level 3, in tutorial level 1, and showing how to do it right)

                  • 6. Re: Is seam-gen really a good idea to learn about seam?
                    christian.bauer

                     

                    the tutorial should try to use SEAM "wrong"


                    As a writer I can tell you that this is a very difficult approach. You should not show readers something that doesn't work, the risk that part of it is memorized is high. You can use that technique sometimes, but I don't think it's a good idea here. The problem is that JavaEE/non-JavaEE deployment options are many and complex, adding more "wrong" combinations doesn't make them easier to learn.

                    One of the reasons why I did not yet push for a "press this key"-style example tutorial is because there is still hope that we can somehow simplify the deployment options to one or two primary choices. Which, instead of 22 configuration files for Hello World, would maybe run with 2.

                    • 7. Re: Is seam-gen really a good idea to learn about seam?
                      fperedo

                      Yes... I can see what you mean... but... then... how can we really learn "what can, and can't be done in Seam on each level?" I mean... errors are going to happen... and I have always loved tutorials with a troubleshooting are that says "if you are seeing XXXX error, is because you are trying to do YYYY and that is not compatible with setting ZZZ, to fix it do AAAAA, or do BBBBB"
                      Maybe the tutoria shouldnt teach it wrong... just "incomplete", make some changes... run again... it fails... why it fails? well, because to do that you have to:
                      1)Enable de microcontainer
                      2)Modify some XML file
                      3)Hava a fully J2EE5 compliant container.

                      • 8. Re: Is seam-gen really a good idea to learn about seam?
                        pmuir

                        I really think you are coming from this upside down - Seam is *simplest* to run in an EE5 container - and, obviously, JBoss AS is the most tested - using the microcontainer or EEJB3 is *more complex*. Seam was built for EE5 environments - elsewhere we provide code to make it more like an EE5 environment! This is why we start with tutorials which run on an EE5 platform.

                        If you are learning Seam I strongly recommend starting with JBoss AS and seam-gen. Get the basics down, then, if you need to, you can get your app working on another server.

                        We do need to indicate which features aren't available if you don't have an EE5 environment so that you can do a proper evaluation of Seam at the outset, and don't have control over your app server.

                        • 9. Re: Is seam-gen really a good idea to learn about seam?
                          fperedo

                          I agree... Seam is simplest to use in an EE5 container... perhpas my problem is that I am used to other frameworks on which you learn the other way around:
                          1) How to do it without EE5
                          2) How to do it with EE5

                          I guess all this comes from the fact that I would love to use Seam over OC4J... but from what I have read over the net, OC4J is kindof a EE4 container with "full EJB3 support" (so... it is a an... EE4.5 container?) and since I liked Seam a lot a would like to use it, even if I have to "turn off" some of its features... but the thing is there is no guide to know what features will I miss if I have to do that (maybe I'll endup with a Seam so crippled that I would prefer to use some other framework)
                          I know it is not you fault... I would prefer to use JBoss or Glassfish, but OC4J is already deployed at my work, and there is some pressure to use it...

                          • 10. Re: Is seam-gen really a good idea to learn about seam?

                             

                            "fperedo" wrote:
                            Hi!
                            -First, transient POJOs: show me what can be done in
                            SEAM without JPA or Hibernate. (a really simple in memory POJOs example with 1 page first, and then 2 or three) ¿this part needs the microcontainer?

                            No, though one does get included in the Seam-PDF example. You can safely drop most of MC/JPA/Hibernate stuff in such setup - though Seam does have some dependencies I couldn't get rid from: namely ejb3-persistence.jar (doh!) and hibernate-validator.jar (expressions, facesMessages and validators Seam components)
                            "fperedo" wrote:
                            -Second, persistent POJOs: evolve from the first tutorial and make some of its POJOs persistent (using just Hibernate, then show how to do it with JPA annotations) ¿this part needs the microcontainer?

                            there are alternatives to using MC - see http://www.jboss.com/index.html?module=bb&op=viewtopic&t=104525 - though Pete is right, MC is the easiest to set up
                            "fperedo" wrote:

                            -Third, full J2EE, add stuff like stateless & statefull POJOS that can only be done having a full J2EE5 stack (is there a difference between having a full J2EE5 stack and using the microcontainer?)

                            From top of my head (incomplete list):
                            Stateful, Stateless and message-driven EJBs (forget about @Stateful and @Stateless). Entity beans are in, though.
                            Persistence Context injection via @PersistenceContext (use @In)
                            You have to (or, rather, you better to) use Seam-managed transactions and Seam-managed persistence contexts if you're outside J2EE container

                            HTH,

                            Alex