View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Liferay Module FrameworkWhy modularity mattersMiguel Ángel Pastor Olivar
A little bit about meWorking at the "infrastructure" sideCloud computing and distributed systemsInterests in concurrent and distributed programming.Functional programming advocate!Scala, OSGI and AspectJ enthusiast. Erlang aficionadoEmail: miguel.pastor at liferay dot comTwitter handler: miguelinlas3
What does modularity mean?Systems composed of relatively small self-contained unitsClear interfaces defined between them
The need for modularityLarge systems are extremely complex to develop andmaintainHighly coupled systemsCloud computing Multiple deployments are co-locatedFootprint and performanceDistributed development
Complexity vs costCost unmanageable Small focused pieces Complexity
What are you looking for?ModulesDeployment mechanismDependency managementDynamismEncapsulationVersioning
“Inside” benefitsDecoupled and highly focused componentsEasier development processSimplify current implementations/patternsEasier to implement new featuresHighly focused teamsEasier distributed development
“Outside” benefitsMore frequent delivery of new features or improvementsLess bugs due to higher degree of focusQuicker and simpler delivery of patches for bugs and securityissuesRobustnessFootprint
Becoming real!OSGI (Open Service Gateway Initiatives) as foundationCurrently in development. Available in 6.2Lets see some insights!
OSGI features/benefits Reduce complexity Developing bundles Dynamism Real world is dynamic; deal with it! Deployment mechanism Determine how components are installed and managed Dynamic updates Do not bring down the whole system
OSGI features/benefits Versioning Multiple versions of the same component Small and fast About 300K jar file Non intrusive. Runs everywhere. Widely used Eclipse, Glassfish, JBoss, Virgo RT, . . .
OSGI architecture Services S e Lifecycle c Bundles u r i Modules t y Executing environment Java Virtual Machine Operating system
OSGI architecture Bundles OSGI components Services Connecting in a dynamic way. POJOs. Life-cycle How to install, start, stop, update and uninstall bundles
OSGI architecture Modules About encapsulating and importing/exporting code Security All aspects related to security Execution environment What methods and classes are available
Main points Embedded OSGI framework Ideally should be “agnostic” HTTP Service implementation Backwards compatible Enabled by a configuration property
100000 feet architecture Webapp Server Plugin A Plugin B Traditional deployment mechanism Liferay Portal OSGI container OSGI based plugins Plugin X Plugin Y
How it works? AutoDeploy listeners Deployment Folder Web Bundle Processor Monitored by the OSGI framework Blocked Valid WAB bundle Web Bundle Processor Container notifies the deployer OSGI Container Web Bundle Deployer
Leveraging all the power! The module admin portlet