5

We are in the phase of evaluating some of the frameworks for portlet development. As of now I know of below 3 options. I would like to know your experiences with them and others

  1. Struts 2
  2. Spring Portlet MVC
  3. Liferay 6.x MVC Framework

Please try to share Pros/Cons in following areas along with what you think is important

  • Speed of development
  • Maintenance
  • Ease of development with Geo Distributed teams

Please suggest any other frameworks which can be used as alternative with some pros/cons

Kzvi
  • 519
  • 1
  • 6
  • 17

4 Answers4

5

From my point of view, using MVCPortlet and JSPs without Spring-mvc or Struts is suitable enough only for a simple portlet. I would definitely try at least a sample portlet to see how it works if developers haven't done portlets.

The only advantage of using Struts is that the Portal itself is heavily using it because spring-portlet-mvc is relatively new. So that you can learn a lot from variety of examples. Otherwise the technology afaik is dying (regarding portlet development) and if you haven't been working with Struts, the better option for you would be go for spring-portlet. I've been using spring-portlet for more than a year, and I must say that I was amazed how well integrated it is into portlet container and what features are implemented there. You can do practically everything as with spring-mvc (servlet spec), except for some minor support that I found redundant anyway.

Speed of development an experience developer that knows spring-mvc can create a robust application with only a few spring controllers.

Maintenance The amount of source code is significantly lesser with spring then struts. Spring-portlet has implemented 268 JSR, so that it saves couple of workarounds.

Ease of development with Geo Distributed teams I sense you are going for something bigger, so that ask developers about their experience with Spring and Struts and make your choice. Anyway, Liferay is a pretty robust portal solution and to "learn" it and find a way to use it properly is more important issue than how to develop portlets.

Also be interested in developers knowledge of Javascript. If they don't know JS much or you don't have front-end developers, I would probably give a shot to Vaadin or GWT portlets. However Liferay has a very good client-side support and you'll see that a lot of things can be done on client-side in Liferay. JSP tag libraries provides a significant amount of dynamic behavior and Alloy JS framework that is built on top of YUI provides you with a nice environment and it is not hard to use.

EDIT: The comparison of Struts vs. Spring is regarding portlet specification, where (my opinion) struts support is an old Volkswagen and spring is Bentley continental gt :-)

ALSO: The key tool for Liferay portlet development is so called ServiceBuilder, which is a code generator, that generates a significant part of your persistence layer, remote service layer based on domain model and metadata. If you choose to use it, your portlet is automatically Spring based. And I'd recommend to use it, because once you try it, you won't let it go. For instance, to create Ajax calls from client-side to remote services is a question of 2 minutes to set it up and be able to call them and even get the return value. Hibernate setup is fully optimized and ready to use after you run servicebuilder. And much, much more.

lisak
  • 21,611
  • 40
  • 152
  • 243
  • 1
    Are you referring to Struts or Struts 2? I've noticed a lot of Spring documentation (ver 2.5) compares their software to Stuts1. I can not see any indications of S2, dying. – Quaternion Feb 25 '11 at 01:15
  • @Quaternion: I'm referring to this: http://portals.apache.org/bridges/multiproject/portals-bridges-struts/index.html which is the bottleneck of using Struts together with Portlet specification and Portlet containers in general – lisak Feb 25 '11 at 12:19
  • The request comes into MainServlet of the portal container and the portlet bridge serves as some sort of adapter for Portlet. It is really complicated thing to explain, but I was using both these "bridge" techniques for a pretty long time and what Struts offers to support portlets cannot be even remotely compared to what spring-portlet-mvc came up with. You doesn't even find the difference between servlet/portlet development. This is where Struts failed, so that Liferay had to come up with specific StrutsPortlet solution, that is only available for Core Portal development, not for plugin dev. – lisak Feb 25 '11 at 12:31
  • @Edgar - Thanks for your response. I was looking for exactly what you have mentioned. I had almost same opinion about Strus2 vs Spring MVC. I liked Spring approach but wanted to get more thoughts, your answers certainly will helps me make better decisions. I did not mark it as accepted answer yet since I want to get more opinion. I wanted to ask about Liferay Service Builder in a separate thread since it was more of a code generation approach and I was thinking about comparing it with AndroMDA. Let me post another question and we can discuss that aspect in a separate thread. – Kzvi Feb 25 '11 at 17:53
  • @Edgar, S2 and S1 are not at all the same product. The two are about as related as JavaScript and Java, that is they aren't. The provided link shows it was published "21 December 2007" since S2 was released 2008 I wouldn't bother reading much after that. – Quaternion Feb 25 '11 at 18:13
  • @Edgar - I have posted another thread about ServiceBuilder and code generation options, I would be glad to hear your thoughts on it [Comaprison of Liferay ServiceBuilder to other Code generation tools like AndroMDA](http://stackoverflow.com/questions/5121073/comaprison-of-liferay-servicebuilder-to-other-code-generation-tools-like-andromda) – Kzvi Feb 25 '11 at 18:29
  • 1
    @Quaternion: well we are talking about portlet development here, take a look at this http://www.liferay.com/community/forums/-/message_boards/message/378595 and you'll see the strength of struts2 support for portlet specification and portlet containers. It is obviously better use Struts1 and struts-portlet-bridge and better stay off struts2.. – lisak Feb 25 '11 at 19:17
  • @Edgar, if you read that thread it shows a number of people have successfully integrated the S2 and Liferay. Struts1 can not be recommended for future development, if you are in doubt of this you an ask the struts mailing list where it will be be clearly stated that S1 is only being maintained for historical reasons and is pretty much sitting in the water and has been for years. I've seen developers voice that S1 should not be used for any new projects, but if you know different... – Quaternion Feb 25 '11 at 19:37
2

It's Really depend on your requirements, since liferay MVCPortlet are just simple sub-classes of the javax.portlet.GenericPortlet, i dont think it's a fair comparison between web framework such as Strut 2 or Spring MVC.

I suggest using Spring MVC or Struts 2 for 168 & 268 JSR portlet if you want cross portlet-container portability or if you have more complex presentation requirements, you should find a list of the pro and cons of the two framework everywhere .

If you requirement are very simple then go with liferay MVCPortlet or even the JSPPortlet.

Chuck Mah
  • 638
  • 6
  • 9
  • Thanks for your quick reply.If I understood it right, Using a good Framework would be almost same advantageous in long run as it is in case of a servlet world? – Kzvi Feb 24 '11 at 22:32
  • Yes, i think you can see it that way, i use Spring MVC and i don't really know about strut2 portlet.But, I know liferay use plain old Strut 1 portlet internally, if you except to do a lot of liferay customization maybe you could take a look at it. – Chuck Mah Feb 25 '11 at 14:04
2

I have used 2) and 3) but not 1) - I'm not a fan of Struts.

Spring MVC gives you the power of Spring and plugs seamlessly into a Spring back-end as well as allowing the ability to wire to the Liferay Spring services. Provided you use MVC correctly and separate Controller concerns into separate Action classes then this is an extremely scalable and flexible choice and works well when coupled with Liferay.

Liferay's MVCPortlet provides much less in terms of flexibility but when used properly it is still highly scalable and a very useful choice. It also ties in to the Liferay IDE/Liferay Development Studio which provides benefits during development. If you have access to the Liferay Developer training then there is extensive coverage on Day 2.

Overall Spring has the greater benefits but also comes with the larger learning curve and greater risk of doing things incorrectly and hits you harder when done badly. Liferay's MVCPortlets done badly end up looking like vanilla portlets and as such is the lesser evil. Personally I use MVCPortlets for small tasks and Spring MVC for the larger ones.

In both cases 'doing it well' involves correct use of the framwork and annotations.

Liferay also supports Vaardin and have released the new Mail Portlet using it. I haven't used Vaardin but certainly plan on it and have heard good things so far.

David O'Meara
  • 2,983
  • 25
  • 38
0

From the ease-of-development point, I think the Vaadin is one of the best. The new Liferay IDE 1.2 already includes the Vaadin support making it very easy to start with it.

The same goes for application maintenance and APIs. With Vaadin the application code is simply Java code and that makes it easy to divide the work, and maintain the existing code (OOP benefits).

Already a good number of "add-ons" for Vaadin that demonstrate how the Java code can be "componentized" and development split across the organization(s).

Only downside comes from the fact that the Vaadin libraries are shared with all the Vaadin- portlets in a portal, which means they should use the same Vaadin version to keep the deployment easier.

Anyway, I'd say quite good match for your needs.

eeq
  • 2,108
  • 12
  • 21