Fórumok

Many small plugins VS fewer big ones

Vilmos Kozma, módosítva 12 év-val korábban

Many small plugins VS fewer big ones

Junior Member Bejegyzések: 68 Csatlakozás dátuma: 2009.11.12. Legújabb bejegyzések
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?

Regards,
Vili
thumbnail
David H Nebinger, módosítva 12 év-val korábban

RE: Many small plugins VS fewer big ones

Liferay Legend Bejegyzések: 14916 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
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).