SlideShare a Scribd company logo
Liferay in Real Projects
Common mistakes on Liferay projects and
ways how to avoid them
Aleš Rybák
Portal Specialist / Consultant
IBA CZ, s. r. o.
Typical problems
●

Disfunctions and
non-standard behaviour

●

Poor performance

●

●

Stability problems

●
●

●

Security vulnerabilities
Overloading of integrated
systems
Usability issues

●

●

●

●

Liferay's potential not fully
leveraged
Maintenance and service
continuity is expensive
Multi vendor env.
doesn't exist
Hard to implement
changes
Low business flexibility
Change needed, but how?
What the customer does see
What the customer doesn't see

Themes
Integrations
Customizations

Portlets
Databases
Jobs
Audit
Problem areas
●

Architecture & design

●

Build & release

●

Code & technical realization
–

Unit tests

–

Frameworks

●

Insufficient knowledge about Liferay Portal (not only)

●

Governance & processes
Absence of Information architecture
●

●

Gap between applications
and customer's needs /
final state
Only developed portlets
and customizations. Let
the customer to do the
rest.

●
●

●

●

Content first
Connection between
technology and real world
problems
Define structure of
content and context for
applications
Base for usability
Misusing Liferay plugins
●

Use plugins for the right purpose
–

portlet plugin for new functionality

–

themes and layouts for L&F

–

hooks for JSP changes, mild changes via exposed APIs

–

ext plugin for more drastical changes

●

Use as non-invasive approaches as possible

●

Avoid JS hooks
Portlet decomposition
●

God portlet / Über-portlet
–
–

●

one big portlet doing
everything
one portlet placed several
times in portal with different
configuration

●

●

●

One portlet per use-case is
good start
merge some to avoid evidently
unnecessary IPC
this needs experience and
sort of sense

Hard to
–

change

–

reuse

–

optimize

●

when checking roles consider
division into more smaller
portlets for each role
Outnumbered by JavaScript libs
“Exotic” infrastructure
●

Well tested
–

Linux

●

Non-standard deploys

●

“Enterprise stack”
–

Liferay EE

–

Oracle DB

–
–

MySQL & Oracle

–

IBM Websphere AS

–
●

Tomcat
Apache

–

MS Windows Server

KISS, use “exotic”
components only if you
know what you're doing
(usually you don't)

●

Compatibility problems

●

Extra knowledge required

●

WAS & WebLogic
–

things which take 10 minutes
on Tomcat can take hours
Build
Optimal solution
mvn clean install
...
BUILD SUCCESSFUL

Reality
●
●

●
●

●

●

For anything else have
documentation and e.g.
maven profile
Use CI / automatic builds

Missing artifacts
Need to build each module
separately
Always needs to connect to VPN
Side effects (e.g. deleting files
on servers, accessing DB)

●

Environment variables needed

●

OS dependency
Snapshot version in production
●

Supplier isn't tagging releases

●

All changes go to the trunk which is only source

●

Customer has no idea
–

what is deployed on production

–

what to test / accept

–

whether reported bugs are fixed

–

what's the state of the project

●

Very good excuse for supplier

●

FIX: release new versions with change log
Code and file system anarchy
●
●

●
●

●

Mess everywhere
Every single thing in code is
done in different way

●

Unification

●

Automatization
–

No rules for VCS
Ad-hoc file/class/... naming
and structures (depends on
creator's fantasy)
Backups into different
places – no one knows if
they are still valid/needed

●

Scripts / tools for most
tasks

In the code - do things
in a same way even
though it's not the best
way!
Code style
●

“How to write unmaintainable code”
–

http://mindprod.com/jgloss/unmain.html

–

if you follow all these rules religiously, you will even
guarantee yourself a lifetime of employment, since no one
but you has a hope in hell of maintaining the code
Code style 2
●
●

High complexity – thousands of SLOC per method
Unreadable code (sometimes it's better to remove all comments
and reformat all sources automatically)

●

Wrong decomposition and unclear structure

●

Cyclic dependencies

●

Massive duplication

●

Unreachable code

●

Code commented-out

●

Bypassing conventions

●

and many more (also in next slides)
Code and style 3
●

Static controls of the code
–

CheckStyle

–

PMD

–

FindBugs

–

SonarQube

●

Read the book

●

Have guidelines

●

Do quick code reviews
and refactorings
Thread danger (the evil brother of Thread safety)
public class MyPortlet extends GenericPortlet {
private PageData data; // to be displayed in JSP
public void processAction(actionReq, actionResp) {
data = prepareData(req);
}
public void doView(renderReq, renderResp) {
dispatchToJSP(renderReq, renderResp, data);
}
...
}
Resources wasting
●

Not closing streams

●

Not closing connections

●

Missing cleanup actions
(e. g. temp files)

●

●

Use tested mature
frameworks where
possible
Use static analysis
Logging
●

●
●

●
●

Logging too many
messages and
unimportant info

●
●

Crucial info is missing
Missing context info (e.g.
user ID, request ID, etc.)
Logging private data
Not using
LOG.ifDebugEnabled()

●
●

Define rules for logging
Logs are most used (and
sometimes the only) way
to find out what went
wrong on production
If using Log4J use LogMF
Read and analyze your
logs – optimize the
logging levels
Exceptions
●

catching Throwable

●

disposing caught Exceptions
–

not wrapping exceptions

●

exception-driven development

●

overusing of controlled Exceptions

●

FIX: just don't ;-)
Unit tests

FIXES:
●
define, what to test and how and stick to it
●
make tests standard part of your delivery
Unit tests

FIXES:
●
define, what to test and how and stick to it
●
make tests standard part of your delivery
Portlets mistakes
●

Big data in session

●

Stateful portlets

●

●

unnecessary
weird

Friendly URLs

●

start with standard pure
Java portlets (read
JSR-286 standard)

–

IPC
–

Learn how to develop
portlets
–

processAction instead
render
–

●

●

look if framework you
are using has support
for portlets or portlet
bridge

Stick with best practices
Frameworks non-usage
●

●

Reinventing the wheel in
code

●

Developing my own
framework
–

–

formatting dates

–

controllers

–

file handling

Apache Commons

–
●

Spring

–

UI

Standards & RI

–

JMS

–

–

cache

–

Look for suitable
framework first

Other sources

Select the mature
supported one
JPA / Hibernate
●

Doing in Java what DB should do (e. g. list size)

●

Combination with pure JDBC
–

problem with 2nd level cache

●

Cascades

●

Explicit entity refresh

●

Many requests
–

very often can be optimized
Security

OWASP Top 10 is the minimum
Liferay users, roles, groups, permissions...
●

One of the most used Liferay's APIs

●

“Patterns”
–

one role per user
●

–

one global role per organization
●

–

only for small number of users
define and use organization roles

one role per document
●

never ever do this
Liferay clustering
●

Sessions

●

Indexes

●

Caches

●

File storage

●

Timers

●

Underlying apps. & other
frameworks

●

web.xml
–

●

distributable

Session objects
–

serializable
Business knowledge of Liferay
●
●

Unable to provide consultancy in required or any quality
Customer is able to maneuver supplier into unnecessary
drastic customizations
–

“bender and narrower”
Technical knowledge of Liferay
●

Many customizations are done programmatically
–
–

●

changes in Java code, JSPs, sometimes across whole
solution including interfaces
some of these changes can be done via configuration

Examples
–

Registration

–

no-cache headers

–

Changes of tag libs
Undefined competences
●

Hidden responsibilities
and costs for customer
–

portal platform

–

application servers

–

connected systems

–

monitoring and
maintenance

●

●

Define what is and what
isn't part of the project
Identify risks and owners
Final advices
●

●

Copy-paste code from StackOverflow
– it's in acceptable quality
Don't make tags or release any versions
(this one is final)!

●

Read “how to write unmaintainable code” and follow it

●

Never test your code!

●

Write your own frameworks! The more, the better.
–

Never test your frameworks!

●

Be agile! = Never write any documentation!

●

Act like fools and just don't care!
●

●

Copy-paste code from StackOverflow
– it's in acceptable quality
Don't make tags or release any versions
(this one is final)!

●

Read “how to write unmaintainable code” and follow it

●

Never test your code!

●

Write your own frameworks! The more, the better.
–

Never test your frameworks!

●

Be agile! = Never write any documentation!

●

Act like fools and just don't care!

●

Don't blame Liferay for another application's problems!
visit us
www.ibacz.eu
follow us
@IBACZ
the end

More Related Content

What's hot

Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content management
Ambientia
 
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Milen Dyankov
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Denis Signoretto
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
Thành Nguyễn
 
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Crafter Software
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal Introduction
Nguyen Tung
 
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting visionLiferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
Jorge Ferrer
 
Overview of Liferay 7 Technology
Overview of Liferay 7 TechnologyOverview of Liferay 7 Technology
Overview of Liferay 7 Technology
Azilen Technologies Pvt. Ltd.
 
Liferay 7
Liferay 7Liferay 7
Liferay 7
Son Nguyen
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferaydaveayan
 
Liferay and Cloud
Liferay and CloudLiferay and Cloud
Liferay and Cloud
Miguel Pastor
 
Making a decision between Liferay and Drupal
Making a decision between Liferay and DrupalMaking a decision between Liferay and Drupal
Making a decision between Liferay and Drupal
InfoAxon Technologies Limited
 
Liferay on docker
Liferay on dockerLiferay on docker
Liferay on docker
Geeta Raghu Vamsi Kotipalli
 
2014 Liferay Roadshow Ambientia Finland
2014  Liferay Roadshow Ambientia Finland2014  Liferay Roadshow Ambientia Finland
2014 Liferay Roadshow Ambientia Finland
Ruud Kluivers
 
Liferay plugin customization to change the behavior in portal
Liferay plugin customization to change the behavior in portalLiferay plugin customization to change the behavior in portal
Liferay plugin customization to change the behavior in portal
Aegis Software Canada
 
Liferay Portal Customizing to Business Needs
Liferay Portal Customizing to Business NeedsLiferay Portal Customizing to Business Needs
Liferay Portal Customizing to Business Needs
InfoAxon Technologies Limited
 
Liferay DXP Training
Liferay DXP TrainingLiferay DXP Training
Liferay DXP Training
Elyes Makhlouf
 
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Chris Sparshott
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
Azilen Technologies Pvt. Ltd.
 
What's new in WebSphere Portal 8 roundtable 27 september 2012
What's new in WebSphere Portal 8 roundtable 27 september 2012What's new in WebSphere Portal 8 roundtable 27 september 2012
What's new in WebSphere Portal 8 roundtable 27 september 2012
MooijBert
 

What's hot (20)

Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content management
 
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
Moved to https://slidr.io/azzazzel/leveraging-osgi-to-create-extensible-plugi...
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
 
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
 
Liferay Portal Introduction
Liferay Portal IntroductionLiferay Portal Introduction
Liferay Portal Introduction
 
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting visionLiferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
 
Overview of Liferay 7 Technology
Overview of Liferay 7 TechnologyOverview of Liferay 7 Technology
Overview of Liferay 7 Technology
 
Liferay 7
Liferay 7Liferay 7
Liferay 7
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
 
Liferay and Cloud
Liferay and CloudLiferay and Cloud
Liferay and Cloud
 
Making a decision between Liferay and Drupal
Making a decision between Liferay and DrupalMaking a decision between Liferay and Drupal
Making a decision between Liferay and Drupal
 
Liferay on docker
Liferay on dockerLiferay on docker
Liferay on docker
 
2014 Liferay Roadshow Ambientia Finland
2014  Liferay Roadshow Ambientia Finland2014  Liferay Roadshow Ambientia Finland
2014 Liferay Roadshow Ambientia Finland
 
Liferay plugin customization to change the behavior in portal
Liferay plugin customization to change the behavior in portalLiferay plugin customization to change the behavior in portal
Liferay plugin customization to change the behavior in portal
 
Liferay Portal Customizing to Business Needs
Liferay Portal Customizing to Business NeedsLiferay Portal Customizing to Business Needs
Liferay Portal Customizing to Business Needs
 
Liferay DXP Training
Liferay DXP TrainingLiferay DXP Training
Liferay DXP Training
 
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
Integrating IBM Web Sphere Portal With Web Analytic Hosted And Non Hosted Sit...
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
What's new in WebSphere Portal 8 roundtable 27 september 2012
What's new in WebSphere Portal 8 roundtable 27 september 2012What's new in WebSphere Portal 8 roundtable 27 september 2012
What's new in WebSphere Portal 8 roundtable 27 september 2012
 

Similar to Liferay portals in real projects

OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
OutSystems
 
Spring batch overivew
Spring batch overivewSpring batch overivew
Spring batch overivew
Chanyeong Choi
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
Fwdays
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
Dmytro Semenov
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)
ncoghlan_dev
 
on log messages
on log messageson log messages
on log messages
Laurence Chen
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
Justin Filip
 
Path dependent-development (PyCon India)
Path dependent-development (PyCon India)Path dependent-development (PyCon India)
Path dependent-development (PyCon India)
ncoghlan_dev
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
OdessaJS Conf
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Theo Jungeblut
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Theo Jungeblut
 
Ad109 - XPages Performance and Scalability
Ad109 - XPages Performance and ScalabilityAd109 - XPages Performance and Scalability
Ad109 - XPages Performance and Scalability
ddrschiw
 
µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015
Izzet Mustafaiev
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
Yshay Yaacobi
 
Scaling Magento
Scaling MagentoScaling Magento
Scaling Magento
Copious
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
Blend Interactive
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
Pekka Klärck
 
DevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsDevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsFedir RYKHTIK
 

Similar to Liferay portals in real projects (20)

OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
 
Sdlc
SdlcSdlc
Sdlc
 
Spring batch overivew
Spring batch overivewSpring batch overivew
Spring batch overivew
 
Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"Viktor Turskyi "Effective NodeJS Application Development"
Viktor Turskyi "Effective NodeJS Application Development"
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)Path Dependent Development (PyCon AU)
Path Dependent Development (PyCon AU)
 
on log messages
on log messageson log messages
on log messages
 
Moodle Development Best Pracitces
Moodle Development Best PracitcesMoodle Development Best Pracitces
Moodle Development Best Pracitces
 
Path dependent-development (PyCon India)
Path dependent-development (PyCon India)Path dependent-development (PyCon India)
Path dependent-development (PyCon India)
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
Debugging,Troubleshooting & Monitoring Distributed Web & Cloud Applications a...
 
Ad109 - XPages Performance and Scalability
Ad109 - XPages Performance and ScalabilityAd109 - XPages Performance and Scalability
Ad109 - XPages Performance and Scalability
 
µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015µServices Architecture @ EPAM WOW 2015
µServices Architecture @ EPAM WOW 2015
 
DDD with Behat
DDD with BehatDDD with Behat
DDD with Behat
 
Not my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructureNot my problem - Delegating responsibility to infrastructure
Not my problem - Delegating responsibility to infrastructure
 
Scaling Magento
Scaling MagentoScaling Magento
Scaling Magento
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
DevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and ProjectsDevOps for TYPO3 Teams and Projects
DevOps for TYPO3 Teams and Projects
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Liferay portals in real projects

  • 1. Liferay in Real Projects Common mistakes on Liferay projects and ways how to avoid them Aleš Rybák Portal Specialist / Consultant IBA CZ, s. r. o.
  • 2.
  • 3.
  • 4.
  • 5. Typical problems ● Disfunctions and non-standard behaviour ● Poor performance ● ● Stability problems ● ● ● Security vulnerabilities Overloading of integrated systems Usability issues ● ● ● ● Liferay's potential not fully leveraged Maintenance and service continuity is expensive Multi vendor env. doesn't exist Hard to implement changes Low business flexibility
  • 7. What the customer does see
  • 8. What the customer doesn't see Themes Integrations Customizations Portlets Databases Jobs
  • 10. Problem areas ● Architecture & design ● Build & release ● Code & technical realization – Unit tests – Frameworks ● Insufficient knowledge about Liferay Portal (not only) ● Governance & processes
  • 11. Absence of Information architecture ● ● Gap between applications and customer's needs / final state Only developed portlets and customizations. Let the customer to do the rest. ● ● ● ● Content first Connection between technology and real world problems Define structure of content and context for applications Base for usability
  • 12. Misusing Liferay plugins ● Use plugins for the right purpose – portlet plugin for new functionality – themes and layouts for L&F – hooks for JSP changes, mild changes via exposed APIs – ext plugin for more drastical changes ● Use as non-invasive approaches as possible ● Avoid JS hooks
  • 13. Portlet decomposition ● God portlet / Über-portlet – – ● one big portlet doing everything one portlet placed several times in portal with different configuration ● ● ● One portlet per use-case is good start merge some to avoid evidently unnecessary IPC this needs experience and sort of sense Hard to – change – reuse – optimize ● when checking roles consider division into more smaller portlets for each role
  • 15. “Exotic” infrastructure ● Well tested – Linux ● Non-standard deploys ● “Enterprise stack” – Liferay EE – Oracle DB – – MySQL & Oracle – IBM Websphere AS – ● Tomcat Apache – MS Windows Server KISS, use “exotic” components only if you know what you're doing (usually you don't) ● Compatibility problems ● Extra knowledge required ● WAS & WebLogic – things which take 10 minutes on Tomcat can take hours
  • 16. Build Optimal solution mvn clean install ... BUILD SUCCESSFUL Reality ● ● ● ● ● ● For anything else have documentation and e.g. maven profile Use CI / automatic builds Missing artifacts Need to build each module separately Always needs to connect to VPN Side effects (e.g. deleting files on servers, accessing DB) ● Environment variables needed ● OS dependency
  • 17. Snapshot version in production ● Supplier isn't tagging releases ● All changes go to the trunk which is only source ● Customer has no idea – what is deployed on production – what to test / accept – whether reported bugs are fixed – what's the state of the project ● Very good excuse for supplier ● FIX: release new versions with change log
  • 18. Code and file system anarchy ● ● ● ● ● Mess everywhere Every single thing in code is done in different way ● Unification ● Automatization – No rules for VCS Ad-hoc file/class/... naming and structures (depends on creator's fantasy) Backups into different places – no one knows if they are still valid/needed ● Scripts / tools for most tasks In the code - do things in a same way even though it's not the best way!
  • 19. Code style ● “How to write unmaintainable code” – http://mindprod.com/jgloss/unmain.html – if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code
  • 20. Code style 2 ● ● High complexity – thousands of SLOC per method Unreadable code (sometimes it's better to remove all comments and reformat all sources automatically) ● Wrong decomposition and unclear structure ● Cyclic dependencies ● Massive duplication ● Unreachable code ● Code commented-out ● Bypassing conventions ● and many more (also in next slides)
  • 21. Code and style 3 ● Static controls of the code – CheckStyle – PMD – FindBugs – SonarQube ● Read the book ● Have guidelines ● Do quick code reviews and refactorings
  • 22. Thread danger (the evil brother of Thread safety) public class MyPortlet extends GenericPortlet { private PageData data; // to be displayed in JSP public void processAction(actionReq, actionResp) { data = prepareData(req); } public void doView(renderReq, renderResp) { dispatchToJSP(renderReq, renderResp, data); } ... }
  • 23. Resources wasting ● Not closing streams ● Not closing connections ● Missing cleanup actions (e. g. temp files) ● ● Use tested mature frameworks where possible Use static analysis
  • 24. Logging ● ● ● ● ● Logging too many messages and unimportant info ● ● Crucial info is missing Missing context info (e.g. user ID, request ID, etc.) Logging private data Not using LOG.ifDebugEnabled() ● ● Define rules for logging Logs are most used (and sometimes the only) way to find out what went wrong on production If using Log4J use LogMF Read and analyze your logs – optimize the logging levels
  • 25. Exceptions ● catching Throwable ● disposing caught Exceptions – not wrapping exceptions ● exception-driven development ● overusing of controlled Exceptions ● FIX: just don't ;-)
  • 26. Unit tests FIXES: ● define, what to test and how and stick to it ● make tests standard part of your delivery
  • 27. Unit tests FIXES: ● define, what to test and how and stick to it ● make tests standard part of your delivery
  • 28. Portlets mistakes ● Big data in session ● Stateful portlets ● ● unnecessary weird Friendly URLs ● start with standard pure Java portlets (read JSR-286 standard) – IPC – Learn how to develop portlets – processAction instead render – ● ● look if framework you are using has support for portlets or portlet bridge Stick with best practices
  • 29. Frameworks non-usage ● ● Reinventing the wheel in code ● Developing my own framework – – formatting dates – controllers – file handling Apache Commons – ● Spring – UI Standards & RI – JMS – – cache – Look for suitable framework first Other sources Select the mature supported one
  • 30. JPA / Hibernate ● Doing in Java what DB should do (e. g. list size) ● Combination with pure JDBC – problem with 2nd level cache ● Cascades ● Explicit entity refresh ● Many requests – very often can be optimized
  • 31. Security OWASP Top 10 is the minimum
  • 32. Liferay users, roles, groups, permissions... ● One of the most used Liferay's APIs ● “Patterns” – one role per user ● – one global role per organization ● – only for small number of users define and use organization roles one role per document ● never ever do this
  • 33. Liferay clustering ● Sessions ● Indexes ● Caches ● File storage ● Timers ● Underlying apps. & other frameworks ● web.xml – ● distributable Session objects – serializable
  • 34. Business knowledge of Liferay ● ● Unable to provide consultancy in required or any quality Customer is able to maneuver supplier into unnecessary drastic customizations – “bender and narrower”
  • 35. Technical knowledge of Liferay ● Many customizations are done programmatically – – ● changes in Java code, JSPs, sometimes across whole solution including interfaces some of these changes can be done via configuration Examples – Registration – no-cache headers – Changes of tag libs
  • 36. Undefined competences ● Hidden responsibilities and costs for customer – portal platform – application servers – connected systems – monitoring and maintenance ● ● Define what is and what isn't part of the project Identify risks and owners
  • 38. ● ● Copy-paste code from StackOverflow – it's in acceptable quality Don't make tags or release any versions (this one is final)! ● Read “how to write unmaintainable code” and follow it ● Never test your code! ● Write your own frameworks! The more, the better. – Never test your frameworks! ● Be agile! = Never write any documentation! ● Act like fools and just don't care!
  • 39. ● ● Copy-paste code from StackOverflow – it's in acceptable quality Don't make tags or release any versions (this one is final)! ● Read “how to write unmaintainable code” and follow it ● Never test your code! ● Write your own frameworks! The more, the better. – Never test your frameworks! ● Be agile! = Never write any documentation! ● Act like fools and just don't care! ● Don't blame Liferay for another application's problems!