This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am wondering which will be a better option in terms of server resources.
If there is a portlet called WeatherPortlet and if I want to create another portlet called CanadaWeatherPortlet. Which option is better
1) Clone the Weather Portlet to create CanadaWeatherPortlet OR
2) Define another portlet (CanadaWeatherPortlet) in portlet.xml
I think neither of those proposals is a good idea, because in each way you'll 've a lot of duplicated code.
I would create just one portlet, the WeatherPortlet. If I've the requirement, that on page A this portlet has to be the CanadianWeatherPortlet and on page B you need a USAWeatherPortlet, then I would define a (country- or locale-)parameter. To create your pages A and B, and to set specific country-parameter for your portlet(-instances) you can create an XMLAccess-Script.