Liferay Developer Best Practices for a Successful Deployment

14,617 views
14,222 views

Published on

Liferay is one of the leading open source portals in today’s market. However, it’s more than just a portal, it’s also a framework. And with good frameworks, comes flexibility, and with flexibility comes the need to understand and follow best practices.

This webcast will share lessons learned and best practices gathered from some of our very own customer Liferay implementations. The presentation will cover the gamut of a Liferay implementation lifecycle.

Published in: Technology, Business
3 Comments
34 Likes
Statistics
Notes
  • I am 1year experience guy.Can anyone provide link or can give explanation why liferay hook is best practice than portal-ext.properties for overriding portal properties
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • It's really good presentation on best practices..Thanks for sharing...
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Its great... and easy to understand.....!!!! Cheers up mannnn!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
14,617
On SlideShare
0
From Embeds
0
Number of Embeds
856
Actions
Shares
0
Downloads
8
Comments
3
Likes
34
Embeds 0
No embeds

No notes for slide

Liferay Developer Best Practices for a Successful Deployment

  1. 1. Liferay Developer Best Practices March 31 st 2011 Rivet Logic Corporation 1800 Alexander Bell Drive Suite 400 Reston, VA 20191 Ph: 703.955.3480 Fax: 703.234.7711 Presented By Alaaeldin El-Nattar Principal Architect Rivet Logic Corporation
  2. 2. Rivet Logic Overview <ul><li>Award-winning professional services focused on enabling: </li></ul><ul><ul><li>Collaboration and Community Platforms </li></ul></ul><ul><ul><li>Enterprise and Web Content Management </li></ul></ul><ul><ul><li>Next Generation Websites </li></ul></ul><ul><li>Using Leading Open Source Software </li></ul><ul><li>Company Facts </li></ul><ul><ul><li>Founded 2005, Consistently Profitable, Employee-owned </li></ul></ul><ul><ul><li>Headquartered in Reston, VA </li></ul></ul><ul><ul><li>Regional Offices in Boston, New York City, LA </li></ul></ul><ul><ul><li>Near-shore Development Center in Costa Rica </li></ul></ul><ul><ul><li>40+ Consultants </li></ul></ul>Copyright © 2008. Rivet Logic Corporation. All rights reserved.
  3. 3. Rivet Logic and Liferay <ul><li>Certified Partner since 2006 </li></ul><ul><li>Conduct all Public Training on East Coast USA </li></ul><ul><li>Contributor (software, documentation, forums, training material) </li></ul><ul><li>Host of first ever East Coast User Conference in 2009 </li></ul><ul><li>20+ Liferay projects underway or completed </li></ul>Copyright © 2008. Rivet Logic Corporation. All rights reserved.
  4. 4. Best Practices <ul><li>What are best practices? </li></ul><ul><ul><li>“ A best practice is a technique, method, process, activity, incentive, or reward that is believed to be more effective at delivering a particular outcome than any other technique, method, process, etc. when applied to a particular condition or circumstance. ” – Wikipedia </li></ul></ul><ul><li>Why is it not easy to follow them? </li></ul><ul><li>Why should we follow them? </li></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  5. 5. Motivation <ul><li>Better maintenance </li></ul><ul><li>Better flexibility </li></ul><ul><li>Higher confidence </li></ul><ul><li>A great differentiator </li></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  6. 6. Liferay Best Practices <ul><li>Best practices at three levels </li></ul><ul><ul><li>Architecture </li></ul></ul><ul><ul><li>Design/Development </li></ul></ul><ul><ul><li>Deployment/Operations </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  7. 7. Copyright © 2009. Rivet Logic Corporation. All rights reserved. ARCHITECTURE
  8. 8. Architecture Best Practices <ul><li>Essentials </li></ul><ul><ul><li>Understanding Liferay’s architecture and roadmap </li></ul></ul><ul><ul><li>Ability to map real life IA into Communities/Organizations </li></ul></ul><ul><ul><li>Use what you have </li></ul></ul><ul><ul><ul><li>Organization hierarchies can be very useful </li></ul></ul></ul><ul><ul><li>Educate the client </li></ul></ul><ul><ul><ul><li>e.g. Control Panel is powerful but one must be told why </li></ul></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  9. 9. Architecture Best Practices <ul><li>Disciplines </li></ul><ul><ul><li>Do your best to understand the client’s business model </li></ul></ul><ul><ul><ul><li>Walk and talk like they do </li></ul></ul></ul><ul><ul><ul><li>Terminology matters </li></ul></ul></ul><ul><ul><li>Be 100% transparent </li></ul></ul><ul><ul><li>Be “Agile” </li></ul></ul><ul><ul><li>Maintain a clear upgrade path </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  10. 10. Copyright © 2009. Rivet Logic Corporation. All rights reserved. DESIGN / DEVELOPMENT
  11. 11. Design/Development Best Practices <ul><li>Use Expandos for extending models where possible </li></ul><ul><ul><li>Quick apps can be written using the Liferay WCM and Expandos </li></ul></ul><ul><ul><li>Think about the pros and cons </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. Note: This list is not in any particular order http://www.liferay.com/web/raymond.auge/blog/-/blogs/expandos-ii-refactor-of-a-previous-post-for-6-0
  12. 12. Design/Development Best Practices <ul><li>Don’t forget that you can use custom SQL in your plugins </li></ul><ul><ul><li>Consider caching if custom query is called often </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4912728 http://www.liferay.com/community/wiki/-/wiki/Main/Service+Builder+Finders
  13. 13. Design/Development Best Practices <ul><li>Portlet resource permissions in Plugin SDK </li></ul><ul><ul><li>Important for portlet flexibility </li></ul></ul><ul><ul><li>Understand the three portlet permission levels </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4887808
  14. 14. Design/Development Best Practices <ul><li>You can access Liferay services directly in velocity </li></ul><ul><ul><li>No need for custom velocity variables </li></ul></ul><ul><ul><li>Helps when building WCM applications </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4885934
  15. 15. Design/Development Best Practices <ul><li>Before you customize look at portal.properties </li></ul><ul><li>Use hooks to override properties if you can </li></ul><ul><li>If hooks don’t allow you to override a property use portal-ext.properties </li></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  16. 16. Design/Development Best Practices <ul><li>Localization is made simple by Liferay </li></ul><ul><li>Any database column can be localized </li></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4857873 <column name=&quot;title&quot; type=&quot;String&quot; localized=&quot;true&quot; />
  17. 17. Design/Development Best Practices <ul><li>Understand how Liferay counters work </li></ul><ul><li>Look at com/liferay/counter/service.xml </li></ul><ul><li>Override if necessary </li></ul><ul><ul><li>See counter-spring.xml </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4850927 http://www.liferay.com/community/forums/-/message_boards/message/4841385
  18. 18. Design/Development Best Practices <ul><li>Know when/how to share services between portlets </li></ul><ul><li>Place service JAR in WEB-INF/lib of each plugin </li></ul><ul><ul><li>Allows for hot deployable plugins </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/community/forums/-/message_boards/message/4686465 http://www.liferay.com/web/juan.fernandez/blog/-/blogs/liferay-modules-communication
  19. 19. Design/Development Best Practices <ul><li>Know how to upgrade your portlets </li></ul><ul><ul><li>Use Liferay’s UpgradeProcess </li></ul></ul><ul><ul><li>Use a hook plugin and an Upgrade class </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://www.liferay.com/web/ryan.park/blog/-/blogs/implementing-upgradingprocess-for-your-liferay-portlets!?_33_redirect=%2Fweb%2Fryan.park%2Fblog
  20. 20. Design/Development Best Practices <ul><li>Build your integration layers as services </li></ul><ul><ul><li>Use Service Builder </li></ul></ul><ul><ul><li>Standardize development methodology </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  21. 21. Design/Development Best Practices <ul><li>Understand the pros and cons of search/indexing options </li></ul><ul><ul><li>Solr vs Local Index </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. http://issues.liferay.com/browse/LPS-15006 http://svn.liferay.com/changelog/plugins?cs=71516
  22. 22. Copyright © 2009. Rivet Logic Corporation. All rights reserved. DEPLOYMENT / OPERATIONS
  23. 23. Deployment/Ops Best Practices <ul><li>Document everything </li></ul><ul><ul><li>DEV vs QA vs PROD </li></ul></ul><ul><ul><li>HINT: Use properties files per environment </li></ul></ul><ul><ul><ul><li>portal-dev.properties </li></ul></ul></ul><ul><ul><ul><li>portal-qa.properties </li></ul></ul></ul><ul><ul><ul><li>portal-prod.properties </li></ul></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  24. 24. Deployment/Ops Best Practices <ul><li>Deploy Liferay as a service </li></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><ul><li>Tomcat can be installed as a service </li></ul></ul></ul><ul><ul><li>Unix </li></ul></ul><ul><ul><ul><li>Use init scripts </li></ul></ul></ul><ul><ul><ul><li>Distro dependant </li></ul></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  25. 25. Deployment/Ops Best Practices <ul><li>Know how to do hardware sizing </li></ul><ul><ul><li>Ask the right questions </li></ul></ul><ul><ul><ul><li>How many concurrent users </li></ul></ul></ul><ul><ul><ul><li>What are the real life use cases </li></ul></ul></ul><ul><ul><li>Translate use cases to Liferay functionality </li></ul></ul><ul><ul><li>Map functionality to resource utilization </li></ul></ul><ul><ul><ul><li>File system </li></ul></ul></ul><ul><ul><ul><li>Database </li></ul></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. ?
  26. 26. Deployment/Ops Best Practices <ul><li>Performance tuning </li></ul><ul><ul><li>Profile the portal </li></ul></ul><ul><ul><li>Tweak the JVM </li></ul></ul><ul><ul><li>Have a scalability plan </li></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  27. 27. Deployment/Ops Best Practices <ul><li>High-Availability deployment quirks </li></ul><ul><ul><li>Clustered cache is affected by underlying network </li></ul></ul><ul><ul><li>HTTP session replication is usually overkill </li></ul></ul><ul><ul><ul><li>Educate the client </li></ul></ul></ul>Copyright © 2010. Rivet Logic Corporation. All rights reserved. You can count on me
  28. 28. Summary <ul><li>Best practices span the entire software development lifecycle </li></ul><ul><li>Try to keep up </li></ul><ul><ul><li>Liferay is always changing </li></ul></ul><ul><li>Always promote best practices </li></ul>Copyright © 2009. Rivet Logic Corporation. All rights reserved.
  29. 29. Q & A Copyright © 2010. Rivet Logic Corporation. All rights reserved.
  30. 30. <ul><li>rivetlogic.com </li></ul><ul><li>blogs.rivetlogic.com </li></ul><ul><li>forge.rivetlogic.com </li></ul><ul><li>youtube.com/rivetlogic </li></ul><ul><li>twitter.com/rivetlogic </li></ul>Learn more… Copyright © 2010. Rivet Logic Corporation. All rights reserved.

×