Effective use of Spring in Liferay
Chandan Sharma
 Why use Framework (Spring)
 Use of Spring Framework in Liferay
 How can we use Spring in Liferay
 Pros and Cons
 Q n A
Effective use of Spring in Liferay
 Framework take care of infrastructure and let
you focus on your unique functionality.
 Spring is one of the popular framework.
 Flexible and Lightweight
 Spring MVC is Request Oriented web
framework
 Spring provides many sub frameworks to
make development easier Like IOC, AOP,
Spring Portlet MVC framework etc.
Effective use of Spring in Liferay
 Include support for numerous common view
technologies :
◦ JSP, JSTL, XSLT, Velocity, FreeMarker, Tiles, PDF,
Excel, JasperReport
 Easy to implement new view Technologies
 Interceptors for wrapping other concerns
around controller execution (AOP)
 Exception Resolvers to catch exception
coming out of controllers and mapping to
appropriate views
Effective use of Spring in Liferay
 Liferay Uses Spring in many modules
◦ Spring.configs in portal.properties
 Service builder generates code and
configuration of Spring for using the service
layer
◦ Injecting Dependency in service layer
◦ Hibernate
◦ Infrastructure
◦ Workflow
◦ Mail
◦ Memchached and more….
Effective use of Spring in Liferay
 Using Spring Portlet MVC
 We can create our own service layer or
override the Liferay Existing Spring
configuration
◦ When we use multiple database from the same
portal
◦ When we are writing the Junit Test cases for Service
Layer
◦ Use in hook and Ext based on configuration change
And More…
Effective use of Spring in Liferay
 Any Spring Programmer can use easily no
more learning required
 Spring IOC take care of object Lifecycle
 Get the power of annotation and sub module
 Spring MVC portlet Framwork provide
configuration based portlet we can map more
than one controller to one portlet
 Multiple view technologies can be used easily
 Use Intercepters using AOP at any layer using
xml configuration
Effective use of Spring in Liferay
 Learning of new Framwork
 In Liferay you cannot inject any depencies
from the Spring MVC context into beans held
in the ServiceBuilder context. Becaues of
context are different
 If you are using Liferay Service Builder then
you have to use XXXLocalServiceUtil()
 Some of the Portlet mode is not implemented
in Spring MVC portlet like Help and About.
Effective use of Spring in Liferay
 Portlet in Action
 Spring in Action
 http://static.springsource.org/spring/docs/3
.0.x/reference/portlet.html
 Useful Blogs
Effective use of Spring in Liferay
Effective use of Spring in Liferay
Chandan Sharma
chandansharmamca@gmail.com
http://chandansharmamca.wordpress.com

Spring presentation

  • 1.
    Effective use ofSpring in Liferay Chandan Sharma
  • 2.
     Why useFramework (Spring)  Use of Spring Framework in Liferay  How can we use Spring in Liferay  Pros and Cons  Q n A Effective use of Spring in Liferay
  • 3.
     Framework takecare of infrastructure and let you focus on your unique functionality.  Spring is one of the popular framework.  Flexible and Lightweight  Spring MVC is Request Oriented web framework  Spring provides many sub frameworks to make development easier Like IOC, AOP, Spring Portlet MVC framework etc. Effective use of Spring in Liferay
  • 4.
     Include supportfor numerous common view technologies : ◦ JSP, JSTL, XSLT, Velocity, FreeMarker, Tiles, PDF, Excel, JasperReport  Easy to implement new view Technologies  Interceptors for wrapping other concerns around controller execution (AOP)  Exception Resolvers to catch exception coming out of controllers and mapping to appropriate views Effective use of Spring in Liferay
  • 5.
     Liferay UsesSpring in many modules ◦ Spring.configs in portal.properties  Service builder generates code and configuration of Spring for using the service layer ◦ Injecting Dependency in service layer ◦ Hibernate ◦ Infrastructure ◦ Workflow ◦ Mail ◦ Memchached and more…. Effective use of Spring in Liferay
  • 6.
     Using SpringPortlet MVC  We can create our own service layer or override the Liferay Existing Spring configuration ◦ When we use multiple database from the same portal ◦ When we are writing the Junit Test cases for Service Layer ◦ Use in hook and Ext based on configuration change And More… Effective use of Spring in Liferay
  • 7.
     Any SpringProgrammer can use easily no more learning required  Spring IOC take care of object Lifecycle  Get the power of annotation and sub module  Spring MVC portlet Framwork provide configuration based portlet we can map more than one controller to one portlet  Multiple view technologies can be used easily  Use Intercepters using AOP at any layer using xml configuration Effective use of Spring in Liferay
  • 8.
     Learning ofnew Framwork  In Liferay you cannot inject any depencies from the Spring MVC context into beans held in the ServiceBuilder context. Becaues of context are different  If you are using Liferay Service Builder then you have to use XXXLocalServiceUtil()  Some of the Portlet mode is not implemented in Spring MVC portlet like Help and About. Effective use of Spring in Liferay
  • 9.
     Portlet inAction  Spring in Action  http://static.springsource.org/spring/docs/3 .0.x/reference/portlet.html  Useful Blogs Effective use of Spring in Liferay
  • 10.
    Effective use ofSpring in Liferay Chandan Sharma chandansharmamca@gmail.com http://chandansharmamca.wordpress.com