3 Replies Latest reply on May 22, 2008 2:06 PM by thetikigod

    War File Best Practices

    thetikigod

      What is the best practice when packaging portlets into a war file?

      I am working on an application that has multiple portlets. Each portlet may stand alone (excluding database: they all require the same one) and they each perform a different function. Together, they comprise the entire application. Based on roles, different people will see different portlets or functions within the portlets. Is it better to package each portlet in its own war file or to package them all into a single war?

        • 1. Re: War File Best Practices
          thetikigod

          Please someone post their advice. Im really not sure what to do at this point. None of the tutorials Ive read provide a best practice or convention. All they say is that you can package multiple portlets into a war. What do you guys think?

          • 2. Re: War File Best Practices
            peterj

            How modular would you like your portlets to be? In other words, will you always deploy all of the portlets? Or will there be cases when you want to deploy only 1 (or two or..) of them?

            Also, is there any sort of logical organization among your portlets (for example, portlets A and B are always used together). This should give you some ideas about how to split it up.

            The other issue to think about is the classes the portlets have in common. For example, both portlet A and B use class C. In that case, placing them into the same war is better because if A and B were each in their own wars, then C would have to be in both wars (due to the isolation of the classloaders for wars as required by the servlet spec).

            The final issue I can think of is convenience. For example, if you were someone (other than you who knows the app well) who had to install the app, what you you rather install - a single war file or multiple war files? This becomes an even bigger issue if each war file has to be downloaded (from some web site) separately. (Sometimes there are reasons other than technical for deciding how to package something.)

            • 3. Re: War File Best Practices
              thetikigod

              Thanks a bunch for the advice!