2 Replies Latest reply on May 19, 2010 8:40 PM by boomerbrian.brian.abston.featurenotbug.com

    Is the word Component and Class used interchangeably?

    samuraicoder

      I am reading the beginnings of Seam 2.x Web Development. I think the author is using the term Component as a substitution for Class. Is that often the case?


      For example



      Injection is the process of the framework setting component values before an object 
      is created. With injection, the framework is responsible for setting components 
      (or injecting them) within other components. Typically, Injection can be used to
      allow component values to be passed from the web page into Seam components.

      Does he mean the class?

        • 1. Re: Is the word Component and Class used interchangeably?
          lvdberg

          Hi,


          Your question can lead to the longest forum discussion , but ok.


          A component is sort of an object, both are instances of a Class.  In the context of Seam a Component can be defined as a Seam intercepted or created object. You create a component yourself by writing a Class with all the Seam annotations and let Seam create an instance of it. However you can also use not-seaminzed classes and make them a Seam component by defining them in components.xml.


          Never, never use the new operator in a Seam-environment, let Seam do the work for you !


          Pretty impressive stuff and can overwhelm you sometimes. 


          Welcome to the wonderful world of Seam !


          Leo

          • 2. Re: Is the word Component and Class used interchangeably?
            boomerbrian.brian.abston.featurenotbug.com

            The @Name annotation is what makes the Java class a Seam component. So the answer to your question is yes and no.