• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cloning a portlet Vs Defining it in portlet.xml

 
Srini Kesavan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Folks,
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

Thanks in advance
 
Christian Nicoll
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini,
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.

Best regards,
Christian
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic