SlideShare a Scribd company logo
Portlet Framework: the Liferay way
Liferay Service Builder, Portlet MVC
Catania, 10/03/2014Riccardo Rotondo
Outline
 Motivations
 ModelView Controller design pattern
 Liferay Service Builder
2
Portlet Framework
 GenericPortlet class is not the only way of developing
portlet.
 Several framework are nowadays available to develop
portlet:
 Struts
 JavaServer Faces
 Spring
3
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: ModelView Controller paradigm helps keeping the
code tidy
4
Model View Controller
Controller
View Model
5
 Model: layer responsible to hold the data and the
business logic to manipulate them. In case you use
Liferay Service Builder to manage your 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 andView layer shouldn’t
communicate each other but interact with the
controller
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
6
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
7
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:8
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:9
Service Builder Architecture Overview
Source:10
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_id=8440
633&fileEntryId=22887097
11
Questions ?
12

More Related Content

What's hot

What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
kanchanmahajan23
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
AndiNurkholis1
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
naral
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
M Ahsan Khan
 
Presentation for project
Presentation for projectPresentation for project
Presentation for project
Frensis47
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
Preetam Palwe
 
Marata
MarataMarata
Session 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI BeansSession 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI Beans
PawanMM
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
Harjinder Singh
 
Struts
StrutsStruts
Struts
s4al_com
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction
Hitesh-Java
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
pavanteja86
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
JayaPrakash.m
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
Vikash Chandra Das
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
Dipika Wadhvani
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Dineesha Suraweera
 

What's hot (16)

What is hibernate?
What is hibernate?What is hibernate?
What is hibernate?
 
Web Programming - 7 Blading Template
Web Programming - 7 Blading TemplateWeb Programming - 7 Blading Template
Web Programming - 7 Blading Template
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
 
Model view controller (mvc)
Model view controller (mvc)Model view controller (mvc)
Model view controller (mvc)
 
Presentation for project
Presentation for projectPresentation for project
Presentation for project
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Marata
MarataMarata
Marata
 
Session 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI BeansSession 43 - Spring - Part 1 - IoC DI Beans
Session 43 - Spring - Part 1 - IoC DI Beans
 
Struts Basics
Struts BasicsStruts Basics
Struts Basics
 
Struts
StrutsStruts
Struts
 
Struts 2 - Introduction
Struts 2 - Introduction Struts 2 - Introduction
Struts 2 - Introduction
 
Struts ppt 1
Struts ppt 1Struts ppt 1
Struts ppt 1
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 

Similar to Portlet Framework: the Liferay way

Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
riround
 
MVC
MVCMVC
MVC
akshin
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
Varsha Krishna
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
Edureka!
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
tola99
 
Hibernate Interview Questions | Edureka
Hibernate Interview Questions | EdurekaHibernate Interview Questions | Edureka
Hibernate Interview Questions | Edureka
Edureka!
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
Sudhakar Sharma
 
P20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptxP20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptx
DrTCVijayaraghavan
 
Spring 2
Spring 2Spring 2
Spring 2
Aruvi Thottlan
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorials
TIB Academy
 
Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!
Sibu Stephen
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
IRJET Journal
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
Ian Carnaghan
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
John Lewis
 
Php Framework
Php FrameworkPhp Framework
Php Framework
cncwebworld
 
Php framework
Php frameworkPhp framework
Php framework
cncwebworld
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh Kumar
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
Prashant Seth
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation II
Reem Alattas
 

Similar to Portlet Framework: the Liferay way (20)

Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
 
MVC
MVCMVC
MVC
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Hibernate Interview Questions | Edureka
Hibernate Interview Questions | EdurekaHibernate Interview Questions | Edureka
Hibernate Interview Questions | Edureka
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
P20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptxP20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptx
 
Spring 2
Spring 2Spring 2
Spring 2
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorials
 
Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 
Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
Php Framework
Php FrameworkPhp Framework
Php Framework
 
Php framework
Php frameworkPhp framework
Php framework
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation II
 

More from riround

Gromacs on Science Gateway
Gromacs on Science GatewayGromacs on Science Gateway
Gromacs on Science Gateway
riround
 
e-Infrastructure & Data Service
e-Infrastructure & Data Servicee-Infrastructure & Data Service
e-Infrastructure & Data Service
riround
 
Catania Science Gateway Framework
Catania Science Gateway FrameworkCatania Science Gateway Framework
Catania Science Gateway Framework
riround
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
riround
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
riround
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portlet
riround
 
Catania Science Gateway Framework
Catania Science Gateway Framework Catania Science Gateway Framework
Catania Science Gateway Framework
riround
 
Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Development
riround
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
riround
 
Science Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related servicesScience Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related services
riround
 

More from riround (10)

Gromacs on Science Gateway
Gromacs on Science GatewayGromacs on Science Gateway
Gromacs on Science Gateway
 
e-Infrastructure & Data Service
e-Infrastructure & Data Servicee-Infrastructure & Data Service
e-Infrastructure & Data Service
 
Catania Science Gateway Framework
Catania Science Gateway FrameworkCatania Science Gateway Framework
Catania Science Gateway Framework
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portlet
 
Catania Science Gateway Framework
Catania Science Gateway Framework Catania Science Gateway Framework
Catania Science Gateway Framework
 
Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Development
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
 
Science Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related servicesScience Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related services
 

Recently uploaded

Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 

Recently uploaded (20)

Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 

Portlet Framework: the Liferay way

  • 1. Portlet Framework: the Liferay way Liferay Service Builder, Portlet MVC Catania, 10/03/2014Riccardo Rotondo
  • 2. Outline  Motivations  ModelView Controller design pattern  Liferay Service Builder 2
  • 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 3
  • 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: ModelView Controller paradigm helps keeping the code tidy 4
  • 5. Model View Controller Controller View Model 5  Model: layer responsible to hold the data and the business logic to manipulate them. In case you use Liferay Service Builder to manage your 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 andView layer shouldn’t communicate each other but interact with the controller
  • 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 6
  • 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 7
  • 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:8
  • 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:9
  • 10. Service Builder Architecture Overview Source:10
  • 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_id=8440 633&fileEntryId=22887097 11