1 2 Previous Next 23 Replies Latest reply on Oct 27, 2008 6:17 AM by ericjava.eric.chiralsoftware.net Go to original post
      • 15. Re: New article on @Unwrap and @Factory annotations
        admin.admin.email.tld

        Pete Muir wrote on Oct 12, 2008 15:25:



        Eric H wrote on Oct 10, 2008 21:21:


        Ok, thanks for the suggestion.  I'll re-word it.  And of course, I'll need to add an explanation of outjection and Seam contexts.

        Another question: imagine a very simple component like this:

        @Name("bob") public class Bob {
          public String getHello() { return "Hi, I'm Bob!"; }
        }



        Would you really say that this is outjected?  Perhaps you could, because the Seam loader is outjecting it when the JAR file is scanned?  Or is there some other word?  I would almost say, inserted into the context.

        The reason I'm making a distinction here is because to me, outject implies @Out, while all the other ways of putting something into Seam context maybe should use some other word?


        I only ever say something is outjected if it's set into the context using @Out or @Factory, but in general I prefer to use something like stored in the context or aliased from the context.


        what about @DataModel?  that outjects as well...

        • 16. Re: New article on @Unwrap and @Factory annotations
          pmuir

          Sool Chubeshmekh wrote on Oct 12, 2008 16:40:



          Pete Muir wrote on Oct 12, 2008 15:25:



          Eric H wrote on Oct 10, 2008 21:21:


          Ok, thanks for the suggestion.  I'll re-word it.  And of course, I'll need to add an explanation of outjection and Seam contexts.

          Another question: imagine a very simple component like this:

          @Name("bob") public class Bob {
            public String getHello() { return "Hi, I'm Bob!"; }
          }



          Would you really say that this is outjected?  Perhaps you could, because the Seam loader is outjecting it when the JAR file is scanned?  Or is there some other word?  I would almost say, inserted into the context.

          The reason I'm making a distinction here is because to me, outject implies @Out, while all the other ways of putting something into Seam context maybe should use some other word?


          I only ever say something is outjected if it's set into the context using @Out or @Factory, but in general I prefer to use something like stored in the context or aliased from the context.


          what about @DataModel?  that outjects as well...


          That too :)

          • 17. Re: New article on @Unwrap and @Factory annotations
            deanhiller2000

            This is really confusing....



            @Unwrap is for simple cases where a component needs to be injected into a context, and the class that does the managing doesn't need to be accessible. You'll see what that means when we compare @Unwrap with @Factory.
            
            We'll create a POJO using @Unwrap to inject a simple component. @Unwrap is suited to simple cases. This particularly simple POJO will first inject a string that gives the current time



            I would think every word here should really be outject.  @Out is outject and Unwrap is similar to Out, is it not, or am I really confused.  I thought Out took a POJO variable and placed it into context. Unwrap takes not the variable but the return value and places that in the context, so should not this be worded outject instead of inject.


            This part really is confusing...


            component needs to be injected into a context



            Considering variables are only ever outjected into a contect.  They are never injected into a context


            Well, that is my opinion.

            • 18. Re: New article on @Unwrap and @Factory annotations
              pmuir

              @Unwrap doesn't place anything into a context, read what I wrote again :p

              • 19. Re: New article on @Unwrap and @Factory annotations
                deanhiller2000

                This whole article sounds like it was written from the reference of a context, but I thought @Out and outjected and @In and injected where from the reference of the POJO.  ie. you outject from a pojo which puts the outjected thing IN the context.  you inject to a pojo which gets the injected thing FROM the context.  Am I incorrect or are all the terms accidentally reversed?  Otherwise, I think it would be a pretty good article, though I personally am still confused between using @DataModel and @Out and such with @Factory myself.  I wish this article had more on DataModel with Factory.  We keep getting something wrong and resulted in a hack in our pages for now until we understand this better.

                • 20. Re: New article on @Unwrap and @Factory annotations
                  swd847

                  The difference between @Factory and @Unwrap is that @Factory creates two Seam components

                  Technically @Factory does not create two seam components, there is only one seam component (the manager with the @Factory annotation). The value that is outjected is not a component, just a value in a context.

                  • 21. Re: New article on @Unwrap and @Factory annotations
                    ericjava.eric.chiralsoftware.net

                    It seems like there is a subtle difference between a component and a value in a component.  If I put a @Name annotation on a class, I've got a component, even though its value may be null.  In contrast, I can use @Out to set a value that isn't a component.  Components are things registered with Seam, whereas values are just that, values in context.  I'm not sure if I'm saying this right, but does this sound right?


                    Thanks Peter and others for the suggestions.  I'm making a few more changes in the article to get the terminology consistent.  I'm also going to add some discussion of autocreate and components vs. values, to get this whole thing clear.

                    • 22. Re: New article on @Unwrap and @Factory annotations
                      antoine.antoine.abside.com

                      Thank you for your article.


                      I've just finished one myself to clarify differences between @Out and @Factory :


                      Who’s @In ? who’s @Out ? Clarification on Seam bijection (part 1)


                      I think it can complete your article on @Out and @Factory usages


                      Antoine Sabot-Durand

                      --------------------

                      http://www.next-presso.fr


                      • 23. Re: New article on @Unwrap and @Factory annotations
                        ericjava.eric.chiralsoftware.net

                        That is good explanation.  Yes, the fact that @Out doesn't happen until a method (any method) in the class is invoked, that is an important piece of information for understanding what's going on.  And the other things in your article are good.


                        I'm working on some changes (clarifications) in my article, and also a Part 2, explaining how to use all these things in the real world for common tasks.  I have it written but it's not polished enough yet.

                        1 2 Previous Next