Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Vilmos Kozma
Many small plugins VS fewer big ones
June 8, 2011 12:02 PM

Vilmos Kozma

Rank: Junior Member

Posts: 68

Join Date: November 12, 2009

Recent Posts

Hi Community!

Recently, we've been crossed an interesting question: which approach is better, to have many plugins -one for each portlet- or to have only a few encompassing many portlets.

As much as I understood both solutions has its pros and cons regarding deploy time and administration tasks but is there a thumb of rule for choosing one? Or any ideas and thoughts on this?

David H Nebinger
RE: Many small plugins VS fewer big ones
June 8, 2011 2:06 PM

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 13099

Join Date: September 1, 2006

Recent Posts

Your biggest issue will be runtime resource consumption. Separate WAR files, containing separate plugins, will definitely work, but they will tend to consume more resources.

For example, say you have 5 spring-based portlets which use a spring-based business layer loaded at startup. In a single WAR file, the 5 portlets can share a single Spring context with one copy of the business layer beans. In 5 separate WARs, each of the portlets will be creating a separate copy of the Spring context, resulting in separate (but equal) copies of the business layer beans. Memory requirements go up as a result.

We initially went down the road of having separate plugin projects but after analyzing the runtime impact, we merged the separate plugins into a single WAR and were much happier with the result.

There are general recommendations such as not mixing the different types of plugins into a single project, especially if there is no inherent dependencies (i.e. don't mix a theme with a hook unless the theme requires the hook to function properly).