SlideShare a Scribd company logo
Make Software Modular!
And… Efficient?s
An Empirical Evaluation of OSGi Dependencies Best Practices
Lina Ochoa, Thomas Degueule & Jurgen Vinju
Mining Software Repositories (MSR) 2018
CWI - S.W.A.T.
“Engineers are very pragmatic; they
may admire beauty, but they seek
utility. I tried to find an explanation
of why “beauty” was useful.”
- David L. Parnas
2
Modularity in software
Non-modular software Modular software
3
How modularity works in Java
language?
4
Modularity in Java + OSGi
Bundle-ManifestVersion: 2
Bundle-Name: Lib1
Bundle-SymbolicName: a.lib1
Bundle-Version: 1.2.2.release-2
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.package1;version=“0.0.1”
Import-Package: org.package3;version=“[1.1,1.5]”
Require-Bundle: a.lib3;bundle-version=“2.1.1”
DynamicImport-Package: org.test1
org.package1
org.package2
A B
C D E
lib.jar [Java]
MANIFEST.MF [OSGi]
5
Bundle
28 headers
Modularity in Java + OSGi
pkg.students.api
pkg.students.impl
6
bund.math
pkg.math.api
pkg.math.impl
bund.studentsbund.sort
pkg.sort.api
pkg.sort.impl Require-Bundle Import-Package
OSGi document:
450 pages!
Which OSGi best practices are
advised?
7
Systematic review
Google
search
Select based on
keyword
occurrences
Remove
duplicates
Select based
on relevance
268 156 87 21
((good OR bad OR best) AND (practices OR design)) OR smell
8
OSGi-endorsed
web resources
OSGi best practices
B1: Prefer package-level dependencies
B2: Use versions when possible
B3: Export only needed packages
B4: Minimize dependencies
B5: Import all needed packages
B6: Avoid dynamic package imports
B7: Separate implementation, API, and OSGi-
specific packages
B8: Use semantic versioning
B9: Avoid splitting packages
B10: Declare additional dependencies in the
bundle classpath
B11: Import exported API packages
9
B1: Prefer package-level dependencies
10
pkg.students.api
pkg.students.impl
bund.othersort
pkg.sort.api
pkg.sort.otherimpl
bund.studentsbund.sort
pkg.sort.api
pkg.sort.impl Import-PackageRequire-BundleImport-Package
Are OSGi best practices being
followed?
11
Best practices in practice
B1
• 58% of the bundles use Require-Bundle.
B2
• 85% Require-Bundle, 59% Import-Package, and 25%
Export-Package dependencies are versioned.
B3
• 15% of exported packages are imported through
Import-Package.
12
372 bundles
Do OSGi best practices have an
impact on the system efficiency?
13
Studied corpus
14
Transform
Compare
Benchmark
C0
C6
C1
R6
R1
ResultsCorpora
…
…
372 bundles
Rascal MPL
Is classpath size impacted?
15
15.4% 23.3%
Is performance impacted?
16
-13.3%
12.8%
“I tried to find an explanation of
why “beauty” was useful.”
- David L. Parnas
17
Make Software Modular! And… Efficient?
An Empirical Evaluation of OSGi Dependencies Best Practices (MSR 2018)
Lina Ochoa
lina.ochoa@cwi.nl
Thomas Degueule
thomas.degueule@cwi.nl
Jurgen Vinju
jurgen.vinju@cwi.nl
18
11 OSGi best practices
Best practices are not widely
followed
Best practices impact in classpath size
(0-23%) and performance (±13%)
“Modularity without regret.”

More Related Content

Similar to An Empirical Evaluation of OSGi Dependencies Best Practices

Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
OdessaJS Conf
 

Similar to An Empirical Evaluation of OSGi Dependencies Best Practices (20)

Koha vs abcd
Koha vs abcdKoha vs abcd
Koha vs abcd
 
Core java
Core javaCore java
Core java
 
Presentation5
Presentation5Presentation5
Presentation5
 
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
Plugins 2.0 & OSGi Gotchas - Atlassian Summit 2010
 
Improvements in the OOo Release
Improvements in the OOo ReleaseImprovements in the OOo Release
Improvements in the OOo Release
 
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...
 
From monolith web app to micro-frontends
From monolith web app to micro-frontendsFrom monolith web app to micro-frontends
From monolith web app to micro-frontends
 
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
Rustam Aliyev and Ivan Martynov - From monolith web app to micro-frontends – ...
 
Java
JavaJava
Java
 
MODULE_1_The History and Evolution of Java.pptx
MODULE_1_The History and Evolution of Java.pptxMODULE_1_The History and Evolution of Java.pptx
MODULE_1_The History and Evolution of Java.pptx
 
What are the popular features of java?
What are the popular features of java?What are the popular features of java?
What are the popular features of java?
 
Gap search system
Gap search systemGap search system
Gap search system
 
OOP_chapter _1.pptx
OOP_chapter _1.pptxOOP_chapter _1.pptx
OOP_chapter _1.pptx
 
Managing modular software for your nu get, c++ and java development
Managing modular software for your nu get, c++ and java developmentManaging modular software for your nu get, c++ and java development
Managing modular software for your nu get, c++ and java development
 
Java@intro to java
Java@intro to javaJava@intro to java
Java@intro to java
 
java slides
java slidesjava slides
java slides
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
 
OSGI Modularity
OSGI ModularityOSGI Modularity
OSGI Modularity
 
Lucene, Solr and java 9 - opportunities and challenges
Lucene, Solr and java 9 - opportunities and challengesLucene, Solr and java 9 - opportunities and challenges
Lucene, Solr and java 9 - opportunities and challenges
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 

Recently uploaded (20)

Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Breaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdfBreaking the Code : A Guide to WhatsApp Business API.pdf
Breaking the Code : A Guide to WhatsApp Business API.pdf
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
AI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning FrameworkAI/ML Infra Meetup | Perspective on Deep Learning Framework
AI/ML Infra Meetup | Perspective on Deep Learning Framework
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 

An Empirical Evaluation of OSGi Dependencies Best Practices

  • 1. Make Software Modular! And… Efficient?s An Empirical Evaluation of OSGi Dependencies Best Practices Lina Ochoa, Thomas Degueule & Jurgen Vinju Mining Software Repositories (MSR) 2018 CWI - S.W.A.T.
  • 2. “Engineers are very pragmatic; they may admire beauty, but they seek utility. I tried to find an explanation of why “beauty” was useful.” - David L. Parnas 2
  • 3. Modularity in software Non-modular software Modular software 3
  • 4. How modularity works in Java language? 4
  • 5. Modularity in Java + OSGi Bundle-ManifestVersion: 2 Bundle-Name: Lib1 Bundle-SymbolicName: a.lib1 Bundle-Version: 1.2.2.release-2 Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.package1;version=“0.0.1” Import-Package: org.package3;version=“[1.1,1.5]” Require-Bundle: a.lib3;bundle-version=“2.1.1” DynamicImport-Package: org.test1 org.package1 org.package2 A B C D E lib.jar [Java] MANIFEST.MF [OSGi] 5 Bundle 28 headers
  • 6. Modularity in Java + OSGi pkg.students.api pkg.students.impl 6 bund.math pkg.math.api pkg.math.impl bund.studentsbund.sort pkg.sort.api pkg.sort.impl Require-Bundle Import-Package OSGi document: 450 pages!
  • 7. Which OSGi best practices are advised? 7
  • 8. Systematic review Google search Select based on keyword occurrences Remove duplicates Select based on relevance 268 156 87 21 ((good OR bad OR best) AND (practices OR design)) OR smell 8 OSGi-endorsed web resources
  • 9. OSGi best practices B1: Prefer package-level dependencies B2: Use versions when possible B3: Export only needed packages B4: Minimize dependencies B5: Import all needed packages B6: Avoid dynamic package imports B7: Separate implementation, API, and OSGi- specific packages B8: Use semantic versioning B9: Avoid splitting packages B10: Declare additional dependencies in the bundle classpath B11: Import exported API packages 9
  • 10. B1: Prefer package-level dependencies 10 pkg.students.api pkg.students.impl bund.othersort pkg.sort.api pkg.sort.otherimpl bund.studentsbund.sort pkg.sort.api pkg.sort.impl Import-PackageRequire-BundleImport-Package
  • 11. Are OSGi best practices being followed? 11
  • 12. Best practices in practice B1 • 58% of the bundles use Require-Bundle. B2 • 85% Require-Bundle, 59% Import-Package, and 25% Export-Package dependencies are versioned. B3 • 15% of exported packages are imported through Import-Package. 12 372 bundles
  • 13. Do OSGi best practices have an impact on the system efficiency? 13
  • 15. Is classpath size impacted? 15 15.4% 23.3%
  • 17. “I tried to find an explanation of why “beauty” was useful.” - David L. Parnas 17
  • 18. Make Software Modular! And… Efficient? An Empirical Evaluation of OSGi Dependencies Best Practices (MSR 2018) Lina Ochoa lina.ochoa@cwi.nl Thomas Degueule thomas.degueule@cwi.nl Jurgen Vinju jurgen.vinju@cwi.nl 18 11 OSGi best practices Best practices are not widely followed Best practices impact in classpath size (0-23%) and performance (±13%) “Modularity without regret.”