user3433085
user3433085

Reputation: 1

Good practice to develop on liferay

I ask you to please have information on the rules for development on Liferay:

  1. Group multiple portlets in the same project liferay plugin or for each project to develop a single portlet?
    1. Develop one portlet per page in liferay portal or more per page?
  2. What is the best Framework to use for the visualization layer (HMI) (LiferayMVC, JSF, Vaadin)?

Thank you in advance.

Upvotes: 0

Views: 679

Answers (1)

yannicuLar
yannicuLar

Reputation: 3133

  • Starting with question 1: when you have multiple portlets in the same liferay project, they will be exported in the same .war file. As a result:

    1. All of them will be deployed together. if there is a hook project among them, it will be deployed and have effect too, in every Portal
    2. while developing, a change in one of the portlets will cause a redeployment for all the portlets in that project. If your project becomes too large, this can become a big overhead. But otherwise, this feature should be convenient.
    3. If you use Service builder, all your projects -except the hooks- will have access to your service

    4. All your portlets will/can share the same localization keys, and Utility functions

To make it more simple, each time you have to decide between bundling them in the same project or not, you should answer the question : "Is it a good idea having to deploy all these portlets Together in EVERY Portal ?"

  • Develop one portlet per page in liferay portal or more per page ?

Not sure if you're talking about instance able portlets, or a complex form that can could be splitted in different portlets. If all the forms in that page are meant to interact with each other, you better move them in the same portlet, because inter-portlet communication is an issue.

  • Now, about the Framework, there can be no definite answer on that. Every framework has it's benefits and fan base. I find LiferayMVC convenient for very simple portlets (a few pages, with simple controls that will work out of the box, and a small total number of actions). For every other case, I'd recommend JSF for the following reasons:

    1. It's suitable for large projects with a complex back-end or lots of pages.
    2. It's better for forms that are demanding, of too custom or too ajax/javascript heavy. JSF tag libraries like primefaces are powerful, complete, well documented, and with better community support, compared to JSP libraries
    3. Lots of times, I find it impossible to write a clean jsp page, without having huge java and javascript chunks of code, mixed up with html. The jsf/xhtml pages can be much cleaner.
    4. Maybe it's just me, but I find myself writing better and more elegant code when using JSF. I also find it easier to refactor, and design my architecture.

Upvotes: 2

Related Questions