SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
1
Göran Ehrsson
Technipelago AB
Cut your Grails App to Pieces
Build Feature Plugins
2
Technipelago AB
3
Custom Business Applications
Different industries
Common requirements
• Customers
• Communication (email)
• Documents
• Tasks
• …
4
The challenge
Customer want something simple but it should
rocket fuel their business process
Customer have looked at standard software but
found show stoppers or budget constraints
Developing from scratch each time would be too
expensive or feature limited
One app with VCS branches for each customer
would end up in maintenance hell
Copy code between projects is extremly bad
5
Say no to copy & paste!
⌘-C
⌘-V
⌘-C
⌘-V
6
Grails Plugins
Plugins extend the platform.

A plugin can:
extend the data model
add services
provide static resources
add command line scripts
…
The Grails platform provides

lots of extension points
7
Create a plugin
grails create-plugin myplugin
!
cd myplugin
grails run-app
A Grails plugin is a regular Grails project with
a plugin descriptor in the root of the project.
class MypluginGrailsPlugin {
def version = ”0.1”
}
8
Installing local plugins
grails maven-install
repositories {
…
mavenLocal()
}
!
plugins {
compile ”:myplugin:0.1”
}
theapp/grails-app/conf/BuildConfig.groovy
8
9
-SNAPSHOT versions
Prior to Grails 2.3 local plugins with -SNAPSHOT
versions was not supported due to ivy limitation
Workarounds:
Increment version number before each release
Delete ivy-cache efter each release
Use a remote repository manager (Artifactory)
Grails 2.3+ uses Aether as dependency resolver and
local -SNAPSHOT versions are supported
10
Publish plugins to your own
Repository Manager
You can use a remote repository manager, like
Archiva, Artifactory or Nexus. Host it yourself or
use an external pay-per-use cloud service.
grails.project.repos.mycompany.url =

"http://repo.mycompany.com/plugins-releases/"
grails.project.repos.mycompany.username = "admin"
grails.project.repos.mycompany.password = "password"
~/.grails/settings.groovy
grails publish-plugin --repository=mycompany
11
Configure

remote repositories
repositories {
…
mavenRepo ”http://repo.mycompany.com/plugins-snapshots/”
}
!
plugins {
compile ”:myplugin:1.0-SNAPSHOT”
}
theapp/grails-app/conf/BuildConfig.groovy
12
Inline plugins
grails.project.dependency.resolution = {
repositories {
…
}
plugins {
//compile ”:myplugin:0.1”
}
}
grails.plugin.location.myplugin = ”../../plugins/myplugin”
theapp/grails-app/conf/BuildConfig.groovy
Inline plugins lets you develop plugins as if the
code were part of the application. Auto-reloading
works so you immediately see changes.
13
Plugin Design
Separation of concern
Keep services and related UI
in separate plugins
Avoid intra-plugin
dependencies
Communicate with events
The application is the director
14
Separation of Concern
Each plugin should focus on one task or domain
A plugin should be tested isolated from others
Boundaries are strong and well defined
It forces the developer to stay inside the box
15
Keep services and UI in separate
plugins
Most of the logic are located in the service layer
You may want to have different user interface
plugins for different requirements
The same service plugin can be used in both the
web-front application and in back-office without
exposing admin UI to web-front
You can use the same service plugin in different
micro service style applications
16
Avoid intra-plugin dependencies
UI-plugins are allowed to talk directly to it’s
associated service plugin, but not the opposite
Place common features in one

or few common plugins.
Other plugins are allowed

to depend on common plugins
17
Communicate with events
Spring has built-in support for both synchronous
(default) and asynchronous events
Spring Integration includes advanced event support
Apache Camel supports Event Message pattern (EIP)
Grails platform-core plugin includes great event
handling
Synchronous, Asynchronous, Event Reply
The Grails events plugin is a evolution of platform-
core events
18
Application is the director
Individual plugins should not know about other
plugins
The Application route events from one plugin to
another
The Application can access all plugins if needed
The Application is the director that coordinate
events
19
Drawbacks
Debugging events can be hard
How to deal with exceptions
Not easy to follow code paths in IDE
20
DEMO
21
Real software…
22
Real Plugins - Demo Application
23
Real Plugins - Demo Application
24
GR8CRM
crm-contact & crm-contact-lite
crm-content & crm-content-ui
crm-task & crm-task-ui
crm-campaign & crm-campaign-ui
crm-product & crm-product-ui
crm-blog & crm-blog-ui
crm-ui-bootstrap
~40 plugins in total
25
Dynamic Associations
If a domain class in a feature plugin need to
associate with a domain instance in another
plugin, use ”dynamic associations”
”crmContact@42”
The framework will lookup the domain instance
when needed
Lookup Spring bean ”crmContact”
Call crmContact.get(42)
26
Summary
Focus on domain model (not persistent entities)
Decouple business logic from user interface
Publish events asynchronously

(synchronously if you must)
Let the application be just a container for plugins
Put customer unique code and message routing
rules in the application

(or in a separate plugin unique for each app)
27
References
http://gr8crm.github.io
https://github.com/goeh
https://github.com/technipelago
(all plugins open sourced under the Apache 2.0 License)
@goeh
goran@technipelago.se
http://www.technipelago.se
https://www.linkedin.com/in/gehrsson

Contenu connexe

Tendances

Simulating Different-Network Speeds using JMETER
Simulating Different-Network Speeds using JMETERSimulating Different-Network Speeds using JMETER
Simulating Different-Network Speeds using JMETERAgile Testing Alliance
 
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer TestingDerek Chan
 
Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardNeotys_Partner
 
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
JIRA Performance Testing in Pictures - Edward Bukoski Michael MarchJIRA Performance Testing in Pictures - Edward Bukoski Michael March
JIRA Performance Testing in Pictures - Edward Bukoski Michael MarchAtlassian
 
Patterns of a "Good" Test Automation Framework, Locators & Data
Patterns of a "Good" Test Automation Framework, Locators & DataPatterns of a "Good" Test Automation Framework, Locators & Data
Patterns of a "Good" Test Automation Framework, Locators & DataAgile Testing Alliance
 
A Prophet in Production Shiri Hochhauser
A Prophet in Production   Shiri HochhauserA Prophet in Production   Shiri Hochhauser
A Prophet in Production Shiri HochhauserDevOpsDays Tel Aviv
 
WiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOpsWiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOpsAgile Testing Alliance
 
Code review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourCode review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourDenis Santos
 
Performance test on Carrefour
Performance test on CarrefourPerformance test on Carrefour
Performance test on CarrefourDenis Santos
 
Continuous integration practices to improve the software quality
Continuous integration practices to improve the software qualityContinuous integration practices to improve the software quality
Continuous integration practices to improve the software qualityFabricio Epaminondas
 
Parallel run selenium tests in a good way
Parallel run selenium tests in a good  wayParallel run selenium tests in a good  way
Parallel run selenium tests in a good wayCOMAQA.BY
 
ATAGTR2017 Batch Workload Modelling and Performance Optimization
ATAGTR2017 Batch Workload Modelling and Performance Optimization ATAGTR2017 Batch Workload Modelling and Performance Optimization
ATAGTR2017 Batch Workload Modelling and Performance Optimization Agile Testing Alliance
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...European SharePoint Conference
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksOutSystems
 
Info Card - Techical Debt Management
Info Card  - Techical Debt ManagementInfo Card  - Techical Debt Management
Info Card - Techical Debt ManagementFabricio Epaminondas
 
QA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integrationQA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integrationSujit Ghosh
 
PAC 2019 virtual Philip Webb
PAC 2019 virtual Philip Webb PAC 2019 virtual Philip Webb
PAC 2019 virtual Philip Webb Neotys
 
The Agile Process - Taming Your Process To Work For You
The Agile Process - Taming Your Process To Work For YouThe Agile Process - Taming Your Process To Work For You
The Agile Process - Taming Your Process To Work For YouNowell Strite
 
Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015Wolfgang Gottesheim
 
Solving micro-services and one site problem
Solving micro-services and one site problemSolving micro-services and one site problem
Solving micro-services and one site problemaragavan
 

Tendances (20)

Simulating Different-Network Speeds using JMETER
Simulating Different-Network Speeds using JMETERSimulating Different-Network Speeds using JMETER
Simulating Different-Network Speeds using JMETER
 
#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing#speakgeek - Pragmatic Batch Process Management & Developer Testing
#speakgeek - Pragmatic Batch Process Management & Developer Testing
 
Andreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a StandardAndreas Grabner - Performance as Code, Let's Make It a Standard
Andreas Grabner - Performance as Code, Let's Make It a Standard
 
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
JIRA Performance Testing in Pictures - Edward Bukoski Michael MarchJIRA Performance Testing in Pictures - Edward Bukoski Michael March
JIRA Performance Testing in Pictures - Edward Bukoski Michael March
 
Patterns of a "Good" Test Automation Framework, Locators & Data
Patterns of a "Good" Test Automation Framework, Locators & DataPatterns of a "Good" Test Automation Framework, Locators & Data
Patterns of a "Good" Test Automation Framework, Locators & Data
 
A Prophet in Production Shiri Hochhauser
A Prophet in Production   Shiri HochhauserA Prophet in Production   Shiri Hochhauser
A Prophet in Production Shiri Hochhauser
 
WiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOpsWiKi Based Automation Testing: Fitness & DevOps
WiKi Based Automation Testing: Fitness & DevOps
 
Code review automation and functional tests on Carrefour
Code review automation and functional tests on CarrefourCode review automation and functional tests on Carrefour
Code review automation and functional tests on Carrefour
 
Performance test on Carrefour
Performance test on CarrefourPerformance test on Carrefour
Performance test on Carrefour
 
Continuous integration practices to improve the software quality
Continuous integration practices to improve the software qualityContinuous integration practices to improve the software quality
Continuous integration practices to improve the software quality
 
Parallel run selenium tests in a good way
Parallel run selenium tests in a good  wayParallel run selenium tests in a good  way
Parallel run selenium tests in a good way
 
ATAGTR2017 Batch Workload Modelling and Performance Optimization
ATAGTR2017 Batch Workload Modelling and Performance Optimization ATAGTR2017 Batch Workload Modelling and Performance Optimization
ATAGTR2017 Batch Workload Modelling and Performance Optimization
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous Tasks
 
Info Card - Techical Debt Management
Info Card  - Techical Debt ManagementInfo Card  - Techical Debt Management
Info Card - Techical Debt Management
 
QA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integrationQA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integration
 
PAC 2019 virtual Philip Webb
PAC 2019 virtual Philip Webb PAC 2019 virtual Philip Webb
PAC 2019 virtual Philip Webb
 
The Agile Process - Taming Your Process To Work For You
The Agile Process - Taming Your Process To Work For YouThe Agile Process - Taming Your Process To Work For You
The Agile Process - Taming Your Process To Work For You
 
Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015Industry Keynote at Large Scale Testing Workshop 2015
Industry Keynote at Large Scale Testing Workshop 2015
 
Solving micro-services and one site problem
Solving micro-services and one site problemSolving micro-services and one site problem
Solving micro-services and one site problem
 

Similaire à Cut your Grails application to pieces - build feature plugins

Scaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdfScaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdfKatamaRajuBandigari1
 
不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradlesam chiu
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service UniverseBjörn Kimminich
 
Cloud-native Java EE-volution
Cloud-native Java EE-volutionCloud-native Java EE-volution
Cloud-native Java EE-volutionQAware GmbH
 
CIP Developing Curator Tool Wizards
CIP Developing Curator Tool WizardsCIP Developing Curator Tool Wizards
CIP Developing Curator Tool WizardsEdwin Rojas
 
Use AppDynamics SDK to Integrate with your Applications - AppSphere16
Use AppDynamics SDK to Integrate with your Applications - AppSphere16Use AppDynamics SDK to Integrate with your Applications - AppSphere16
Use AppDynamics SDK to Integrate with your Applications - AppSphere16AppDynamics
 
Cloud-native Patterns
Cloud-native PatternsCloud-native Patterns
Cloud-native PatternsVMware Tanzu
 
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Alexandre Roman
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Henning Jacobs
 
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIY
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIYWhy Pay for Open Source Linux? Avoid the Hidden Cost of DIY
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIYEnterprise Management Associates
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Henning Jacobs
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)Igalia
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patternsakqaanoraks
 
Developer Nirvana with IBM Bluemix™
Developer Nirvana with IBM Bluemix™Developer Nirvana with IBM Bluemix™
Developer Nirvana with IBM Bluemix™IBM
 
Magic with groovy & grails
Magic with groovy & grailsMagic with groovy & grails
Magic with groovy & grailsGeorge Platon
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework BasicMario Romano
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Natalia Efimtseva
 

Similaire à Cut your Grails application to pieces - build feature plugins (20)

Scaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdfScaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdf
 
不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle不只自動化而且更敏捷的Android開發工具 gradle
不只自動化而且更敏捷的Android開發工具 gradle
 
Exploring the GitHub Service Universe
Exploring the GitHub Service UniverseExploring the GitHub Service Universe
Exploring the GitHub Service Universe
 
Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
 
Cloud-native Java EE-volution
Cloud-native Java EE-volutionCloud-native Java EE-volution
Cloud-native Java EE-volution
 
CIP Developing Curator Tool Wizards
CIP Developing Curator Tool WizardsCIP Developing Curator Tool Wizards
CIP Developing Curator Tool Wizards
 
ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!ICONUK 2015 - Gradle Up!
ICONUK 2015 - Gradle Up!
 
Use AppDynamics SDK to Integrate with your Applications - AppSphere16
Use AppDynamics SDK to Integrate with your Applications - AppSphere16Use AppDynamics SDK to Integrate with your Applications - AppSphere16
Use AppDynamics SDK to Integrate with your Applications - AppSphere16
 
Cloud-native Patterns
Cloud-native PatternsCloud-native Patterns
Cloud-native Patterns
 
Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)Cloud-native Patterns (July 4th, 2019)
Cloud-native Patterns (July 4th, 2019)
 
Django in the Real World
Django in the Real WorldDjango in the Real World
Django in the Real World
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - DevOpsCo...
 
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIY
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIYWhy Pay for Open Source Linux? Avoid the Hidden Cost of DIY
Why Pay for Open Source Linux? Avoid the Hidden Cost of DIY
 
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
Why we don’t use the Term DevOps: the Journey to a Product Mindset - Destinat...
 
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
HTML5 on the AGL demo platform with Chromium and WAM (AGL AMM March 2021)
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Developer Nirvana with IBM Bluemix™
Developer Nirvana with IBM Bluemix™Developer Nirvana with IBM Bluemix™
Developer Nirvana with IBM Bluemix™
 
Magic with groovy & grails
Magic with groovy & grailsMagic with groovy & grails
Magic with groovy & grails
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
 

Plus de GR8Conf

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle GR8Conf
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerGR8Conf
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with GroovyGR8Conf
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with GebGR8Conf
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidGR8Conf
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the DocksGR8Conf
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean CodeGR8Conf
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3GR8Conf
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGR8Conf
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEBGR8Conf
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCGR8Conf
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshopGR8Conf
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spockGR8Conf
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedGR8Conf
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGR8Conf
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8confGR8Conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineGR8Conf
 

Plus de GR8Conf (20)

DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle Creating and testing REST contracts with Accurest Gradle
Creating and testing REST contracts with Accurest Gradle
 
Mum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developerMum, I want to be a Groovy full-stack developer
Mum, I want to be a Groovy full-stack developer
 
Metaprogramming with Groovy
Metaprogramming with GroovyMetaprogramming with Groovy
Metaprogramming with Groovy
 
Scraping with Geb
Scraping with GebScraping with Geb
Scraping with Geb
 
How to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and AndroidHow to create a conference android app with Groovy and Android
How to create a conference android app with Groovy and Android
 
Ratpack On the Docks
Ratpack On the DocksRatpack On the Docks
Ratpack On the Docks
 
Groovy Powered Clean Code
Groovy Powered Clean CodeGroovy Powered Clean Code
Groovy Powered Clean Code
 
Ratpack and Grails 3
 Ratpack and Grails 3 Ratpack and Grails 3
Ratpack and Grails 3
 
Grails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloudGrails & DevOps: continuous integration and delivery in the cloud
Grails & DevOps: continuous integration and delivery in the cloud
 
Functional testing your Grails app with GEB
Functional testing your Grails app with GEBFunctional testing your Grails app with GEB
Functional testing your Grails app with GEB
 
Deploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPCDeploying, Scaling, and Running Grails on AWS and VPC
Deploying, Scaling, and Running Grails on AWS and VPC
 
The Grails introduction workshop
The Grails introduction workshopThe Grails introduction workshop
The Grails introduction workshop
 
Idiomatic spock
Idiomatic spockIdiomatic spock
Idiomatic spock
 
The Groovy Ecosystem Revisited
The Groovy Ecosystem RevisitedThe Groovy Ecosystem Revisited
The Groovy Ecosystem Revisited
 
Groovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examplesGroovy 3 and the new Groovy Meta Object Protocol in examples
Groovy 3 and the new Groovy Meta Object Protocol in examples
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 
Grooscript gr8conf
Grooscript gr8confGrooscript gr8conf
Grooscript gr8conf
 
CRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual MachineCRaSH the shell for the Java Virtual Machine
CRaSH the shell for the Java Virtual Machine
 

Dernier

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Dernier (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Cut your Grails application to pieces - build feature plugins

  • 1. 1 Göran Ehrsson Technipelago AB Cut your Grails App to Pieces Build Feature Plugins
  • 3. 3 Custom Business Applications Different industries Common requirements • Customers • Communication (email) • Documents • Tasks • …
  • 4. 4 The challenge Customer want something simple but it should rocket fuel their business process Customer have looked at standard software but found show stoppers or budget constraints Developing from scratch each time would be too expensive or feature limited One app with VCS branches for each customer would end up in maintenance hell Copy code between projects is extremly bad
  • 5. 5 Say no to copy & paste! ⌘-C ⌘-V ⌘-C ⌘-V
  • 6. 6 Grails Plugins Plugins extend the platform.
 A plugin can: extend the data model add services provide static resources add command line scripts … The Grails platform provides
 lots of extension points
  • 7. 7 Create a plugin grails create-plugin myplugin ! cd myplugin grails run-app A Grails plugin is a regular Grails project with a plugin descriptor in the root of the project. class MypluginGrailsPlugin { def version = ”0.1” }
  • 8. 8 Installing local plugins grails maven-install repositories { … mavenLocal() } ! plugins { compile ”:myplugin:0.1” } theapp/grails-app/conf/BuildConfig.groovy 8
  • 9. 9 -SNAPSHOT versions Prior to Grails 2.3 local plugins with -SNAPSHOT versions was not supported due to ivy limitation Workarounds: Increment version number before each release Delete ivy-cache efter each release Use a remote repository manager (Artifactory) Grails 2.3+ uses Aether as dependency resolver and local -SNAPSHOT versions are supported
  • 10. 10 Publish plugins to your own Repository Manager You can use a remote repository manager, like Archiva, Artifactory or Nexus. Host it yourself or use an external pay-per-use cloud service. grails.project.repos.mycompany.url =
 "http://repo.mycompany.com/plugins-releases/" grails.project.repos.mycompany.username = "admin" grails.project.repos.mycompany.password = "password" ~/.grails/settings.groovy grails publish-plugin --repository=mycompany
  • 11. 11 Configure
 remote repositories repositories { … mavenRepo ”http://repo.mycompany.com/plugins-snapshots/” } ! plugins { compile ”:myplugin:1.0-SNAPSHOT” } theapp/grails-app/conf/BuildConfig.groovy
  • 12. 12 Inline plugins grails.project.dependency.resolution = { repositories { … } plugins { //compile ”:myplugin:0.1” } } grails.plugin.location.myplugin = ”../../plugins/myplugin” theapp/grails-app/conf/BuildConfig.groovy Inline plugins lets you develop plugins as if the code were part of the application. Auto-reloading works so you immediately see changes.
  • 13. 13 Plugin Design Separation of concern Keep services and related UI in separate plugins Avoid intra-plugin dependencies Communicate with events The application is the director
  • 14. 14 Separation of Concern Each plugin should focus on one task or domain A plugin should be tested isolated from others Boundaries are strong and well defined It forces the developer to stay inside the box
  • 15. 15 Keep services and UI in separate plugins Most of the logic are located in the service layer You may want to have different user interface plugins for different requirements The same service plugin can be used in both the web-front application and in back-office without exposing admin UI to web-front You can use the same service plugin in different micro service style applications
  • 16. 16 Avoid intra-plugin dependencies UI-plugins are allowed to talk directly to it’s associated service plugin, but not the opposite Place common features in one
 or few common plugins. Other plugins are allowed
 to depend on common plugins
  • 17. 17 Communicate with events Spring has built-in support for both synchronous (default) and asynchronous events Spring Integration includes advanced event support Apache Camel supports Event Message pattern (EIP) Grails platform-core plugin includes great event handling Synchronous, Asynchronous, Event Reply The Grails events plugin is a evolution of platform- core events
  • 18. 18 Application is the director Individual plugins should not know about other plugins The Application route events from one plugin to another The Application can access all plugins if needed The Application is the director that coordinate events
  • 19. 19 Drawbacks Debugging events can be hard How to deal with exceptions Not easy to follow code paths in IDE
  • 22. 22 Real Plugins - Demo Application
  • 23. 23 Real Plugins - Demo Application
  • 24. 24 GR8CRM crm-contact & crm-contact-lite crm-content & crm-content-ui crm-task & crm-task-ui crm-campaign & crm-campaign-ui crm-product & crm-product-ui crm-blog & crm-blog-ui crm-ui-bootstrap ~40 plugins in total
  • 25. 25 Dynamic Associations If a domain class in a feature plugin need to associate with a domain instance in another plugin, use ”dynamic associations” ”crmContact@42” The framework will lookup the domain instance when needed Lookup Spring bean ”crmContact” Call crmContact.get(42)
  • 26. 26 Summary Focus on domain model (not persistent entities) Decouple business logic from user interface Publish events asynchronously
 (synchronously if you must) Let the application be just a container for plugins Put customer unique code and message routing rules in the application
 (or in a separate plugin unique for each app)
  • 27. 27 References http://gr8crm.github.io https://github.com/goeh https://github.com/technipelago (all plugins open sourced under the Apache 2.0 License) @goeh goran@technipelago.se http://www.technipelago.se https://www.linkedin.com/in/gehrsson