Portlet Framework: the
Liferay way
Liferay Service Builder, Portlet
MVC
Riccardo Rotondo

Tutorial on Science Gateways, Ro...
Outline

 Motivations
 Model View Controller design pattern
 Liferay Service Builder

Riccardo Rotondo
Tutorial on Scie...
Portlet Framework

 GenericPortlet class is not the only way of
developing portlet.
 Several framework are nowadays avai...
Liferay MVCPortlet
 Make use of a subset of the classical MVC
Framework
 Easier to use
 Faster learning curve
 Less co...
Model View Controller
 Model: layer responsible to hold the data and
the business logic to manipulate them. In case
you u...
Difference from the GenericPortlet

 Unnecessary implementation of doView() and
doEdit() and any others porlet API
 Clas...
Portlet accessing data

 Several reasons to use a database behind a
portlet
 Java Programming offers different approach ...
Drawback in Hibernate direct usage
 Development of
independent portlets using
Hibernate/JPA appears to
work, but the runt...
The Service Builder Solution

Service Builder provides a
single point to share code
(DB access and business
logic) to inde...
Service Builder Architecture Overview

Source:

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
References
 Liferay in Action: http://www.manning.com/sezov/
 Liferay Service Builder:
 http://www.liferay.com/it/commu...
Questions ?

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Nächste SlideShare
Wird geladen in …5
×

Portlet Framework: the Liferay way

656 Aufrufe

Veröffentlicht am

Liferay Service Builder, Portlet MVC

Veröffentlicht in: Bildung
0 Kommentare
1 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe
Aufrufe insgesamt
656
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
11
Aktionen
Geteilt
0
Downloads
21
Kommentare
0
Gefällt mir
1
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie

Portlet Framework: the Liferay way

  1. 1. Portlet Framework: the Liferay way Liferay Service Builder, Portlet MVC Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  2. 2. Outline  Motivations  Model View Controller design pattern  Liferay Service Builder Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  3. 3. Portlet Framework  GenericPortlet class is not the only way of developing portlet.  Several framework are nowadays available to develop portlet:  Struts  JavaServer Faces  Spring Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  4. 4. Liferay MVCPortlet  Make use of a subset of the classical MVC Framework  Easier to use  Faster learning curve  Less configuration files to deal with and to synchronize with java sources  MVC: Model View Controller paradigm helps keeping the code tidy Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  5. 5. Model View Controller  Model: layer responsible to hold the data and the business logic to manipulate them. In case you use Liferay Service Builder to manage your Controller data, it works at the model layer level.  View: layer containing the rules to display data to the users (typically the JSP pages)  Controller: layer behaving as traffic director. Determine which action will be executed according users input. Model and View layer shouldn’t communicate each other but interact View controller Model with the Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  6. 6. Difference from the GenericPortlet  Unnecessary implementation of doView() and doEdit() and any others porlet API  Class is simpler, it contains just the action methods  In case you really want to use any portlet API they are available, MVCPorlet is a subclass of the GenericPortlet class Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  7. 7. Portlet accessing data  Several reasons to use a database behind a portlet  Java Programming offers different approach to deal with data  Object-relation mapping framework allow database access in a robust way. Java offers Persistence API (JPA) for database access  Liferay uses Hibernate to manage all its data Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  8. 8. Drawback in Hibernate direct usage  Development of independent portlets using Hibernate/JPA appears to work, but the runtime implications are not immediately recognizable: • Stale caches because of multiple writers. • Server resource consumption for multiple DB connections, memory usage for runtime copies of Hib/JPA objects. • Synchronization issues (two portlets given new Hib/JPA config but one forgotten). Source: Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  9. 9. The Service Builder Solution Service Builder provides a single point to share code (DB access and business logic) to independent portlets, resolving the caching, resource, and synchronization issues. Source: Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  10. 10. Service Builder Architecture Overview Source: Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  11. 11. References  Liferay in Action: http://www.manning.com/sezov/  Liferay Service Builder:  http://www.liferay.com/it/community/wiki//wiki/Main/Service+Builder  https://www.liferay.com/c/document_library/get_file?p_l_i d=8440633&fileEntryId=22887097 Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  12. 12. Questions ? Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013

×