0 Replies Latest reply on Feb 25, 2010 12:29 PM by Piotr Sobczyk

    Guidelines for creating seam components

    Piotr Sobczyk Newbie

      Are there any guidelines for creating Java components that co-operate with JSF views? In exact, how to name/package Java components that contains actions that are invoked from view? From which component to take data that should be rendered on view?


      Up to now I usually do something like that:



      • view: Mypage.xhtml

      • action: MyPageAction.java

      • bean: MyPageBean.java





      For every page that need it I create single action component that contains all actions that command components from template can invoke (this component has usually event or stateless scope). And I create single bean component that helps page to render itself (for example provide data to render) and contains some page scoped data (this component has usually page or conversation scope). Is it good to create a separate components for each page or should I rather tend to create components that span methods/properties useful on several pages.


      I did quite a lot of searching but cound find anything on this topic. I looked to Seam examples, but there is only one real life example (Wiki). In Wiki example it seems that they prefer to create components that group similar actions (for example admin actions) rather than creating separate component for every page.


      How are you guys doing?