SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Baselining with OSGi 
enRoute 
Peter Kriens
Baselining with enRoute 
• Why baselining? 
• Semantic versions 
• Consumers & Providers 
• Reports 
• IDE Support 
• Demo
Why Baselining?
3.80
DISCLAIMER! 
No children were harmed 
for the next image …
Need more reasons?
UnsupportedClassVersionError 
UnsatisfiedLinkError 
NoSuchFieldException 
TypeNotPresentException 
NoSuchFieldError 
LinkageError 
AbstractMethodError 
IllegalAccessError 
NoClassDefFoundError 
InstantiationError 
NoSuchMethodException 
NoSuchMethodError 
ClassNotFoundException
Semantic Versioning
MINOR 
1.2.3.qual 
MAJOR 
MICRO 
who cares?
1.2.3 Change to: 
MAJOR 
MINOR 
MICRO 
2.0.0 breaks everybody 
1.3.0 backward compatible 
1.2.4 no semantic change
Compatibility as in 
binary compatibility
Binary Compatibility 
• Reimplementing existing methods, constructors, and initializers to improve performance. 
• Changing methods or constructors to return values on inputs for which they previously either 
threw exceptions that normally should not occur or failed by going into an infinite loop or 
causing a deadlock. 
• Adding new fields, methods, or constructors to an existing class or interface. 
• Deleting private fields, methods, or constructors of a class. 
• When an entire package is updated, deleting default (package-only) access fields, methods, or 
constructors of classes and interfaces in the package. 
• Reordering the fields, methods, or constructors in an existing type declaration. 
• Moving a method upward in the class hierarchy. 
• Reordering the list of direct superinterfaces of a class or interface. 
• Inserting new class or interface types in the type hierarchy.
One example …
class SomeCode { 
public interface Foo { 
void foo(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
void bar(Foo f) { 
f.foo(); 
} 
}
class SomeCode { 
public interface Foo { 
void foo(); 
void bar(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
void bar(Foo f) { 
f.foo(); 
} 
} 
⊗
class SomeCode { 
interface Foo { 
void bar(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
void bar(Foo f) { 
f.foo(); 
} 
} 
⊗ 
⊗
All interfaces are created 
equal but some interfaces are 
more equal than others …
Consumer Contract Provider 
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement. 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer
consumer contract provider
• Consumers – Changes to the contract are usually 
backward compatible. Only MAJOR changes 
require a new implementation. 
• Providers – Almost any change to the contract 
requires a new implementation. MAJOR and 
MINOR changes require a new implementation.
[1.2,2) 1.2.3 [1.2,1.3) 
consumer contract provider 
1.3.0 
contract 
2.0.0 
contract
Consumer Contract Provider 
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer!
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
[1.2,1.3) 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer! 
[1.2,2) 
Provider Type 
Consumer Type
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
[1.2,1.3) 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer! 
[1.2,2) 
Provider Type 
Consumer Type
@ProviderType 
public interface EventAdmin { 
@ConsumerType 
public interface EventHandler { 
void handleEvent(Event event); 
} 
void sendEvent(Event event); 
void postEvent(Event event); 
}
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
[1.2,1.3) 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer! 
[1.2,2) 12.023.03 ⊗ ⊗
“We encourage development systems to 
provide facilities that alert developers to the 
impact of changes on pre-existing binaries that 
cannot be recompiled.” 
— Java Language Specification
So we did …
maven bndtools ant 
jpm gradle 
[{…},{…},{…},…] 
bndlib 
older newer
bndtools
web
* com.liferay.portal.kernel.dao.search MINOR 6.2.0 6.2.0 6.3.0 VERSION INCREASE 
REQUIRED 
< class com.liferay.portal.kernel.dao.search.DisplayTerms 
+ method isSearch() 
+ return boolean 
!! 
com.liferay.portal.kernel.dao.search MINOR 6.3.0 6.2.0 6.3.0 - 
< class com.liferay.portal.kernel.dao.search.DisplayTerms 
+ method isSearch() 
+ return boolean 
- version 6.2.0 
+ version 6.3.0 
ant
[INFO] PACKAGE_NAME DELTA CUR_VER BASE_VER REC_VER WARNINGS 
[INFO] = ================================================== ========== ========== ========== ========== ========== 
[INFO] * com.example.stuff changed 5.7.1 5.7.1 5.7.2 Version increase 
required 
[INFO] ~ class com.example.stuff.SomeImporter 
[INFO] ~ annotated org.apache.felix.scr.annotations.Properties 
[INFO] + property value=[org.apache.felix.scr.annotations.Property:TYPE:CLASS:] 
[INFO] - property value=[org.apache.felix.scr.annotations.Property:TYPE:CLASS:] 
maven
Drums …
Conclusion
Pretty Cool, eh!
Q&A

Weitere ähnliche Inhalte

Ähnlich wie OSGi Semantic Versioning with Baselining in enRoute - P Kriens

Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
Kalica Wadhwa
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
Yury M
 
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
Stowarzyszenie Jakości Systemów Informatycznych (SJSI)
 

Ähnlich wie OSGi Semantic Versioning with Baselining in enRoute - P Kriens (20)

myslide1
myslide1myslide1
myslide1
 
myslide6
myslide6myslide6
myslide6
 
NewSeriesSlideShare
NewSeriesSlideShareNewSeriesSlideShare
NewSeriesSlideShare
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
Crossroads of Asynchrony and Graceful Degradation
Crossroads of Asynchrony and Graceful DegradationCrossroads of Asynchrony and Graceful Degradation
Crossroads of Asynchrony and Graceful Degradation
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
[TestWarez 2017] Behavior Driven Development in a complex environment - Consu...
 
Rounds tips & tricks
Rounds tips & tricksRounds tips & tricks
Rounds tips & tricks
 
Essential Tools for Modern PHP
Essential Tools for Modern PHPEssential Tools for Modern PHP
Essential Tools for Modern PHP
 
Level Up With Parallelism in FME Server
Level Up With Parallelism in FME ServerLevel Up With Parallelism in FME Server
Level Up With Parallelism in FME Server
 
Visual Basic –User Interface- V
Visual Basic –User Interface- VVisual Basic –User Interface- V
Visual Basic –User Interface- V
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
 
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to MicroservicesLessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
 
Design Pattern For C# Part 1
Design Pattern For C# Part 1Design Pattern For C# Part 1
Design Pattern For C# Part 1
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at Etsy
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
Journey toward3rdplatform
Journey toward3rdplatformJourney toward3rdplatform
Journey toward3rdplatform
 

Mehr von mfrancis

Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 

Mehr von mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

OSGi Semantic Versioning with Baselining in enRoute - P Kriens

  • 1. Baselining with OSGi enRoute Peter Kriens
  • 2. Baselining with enRoute • Why baselining? • Semantic versions • Consumers & Providers • Reports • IDE Support • Demo
  • 4.
  • 6. DISCLAIMER! No children were harmed for the next image …
  • 7.
  • 9. UnsupportedClassVersionError UnsatisfiedLinkError NoSuchFieldException TypeNotPresentException NoSuchFieldError LinkageError AbstractMethodError IllegalAccessError NoClassDefFoundError InstantiationError NoSuchMethodException NoSuchMethodError ClassNotFoundException
  • 10.
  • 12. MINOR 1.2.3.qual MAJOR MICRO who cares?
  • 13. 1.2.3 Change to: MAJOR MINOR MICRO 2.0.0 breaks everybody 1.3.0 backward compatible 1.2.4 no semantic change
  • 14. Compatibility as in binary compatibility
  • 15. Binary Compatibility • Reimplementing existing methods, constructors, and initializers to improve performance. • Changing methods or constructors to return values on inputs for which they previously either threw exceptions that normally should not occur or failed by going into an infinite loop or causing a deadlock. • Adding new fields, methods, or constructors to an existing class or interface. • Deleting private fields, methods, or constructors of a class. • When an entire package is updated, deleting default (package-only) access fields, methods, or constructors of classes and interfaces in the package. • Reordering the fields, methods, or constructors in an existing type declaration. • Moving a method upward in the class hierarchy. • Reordering the list of direct superinterfaces of a class or interface. • Inserting new class or interface types in the type hierarchy.
  • 17. class SomeCode { public interface Foo { void foo(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } }
  • 18. class SomeCode { public interface Foo { void foo(); void bar(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } } ⊗
  • 19. class SomeCode { interface Foo { void bar(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } } ⊗ ⊗
  • 20. All interfaces are created equal but some interfaces are more equal than others …
  • 21. Consumer Contract Provider org.osgi.service.eventadmin Event! Admin! Implement. Event Admin Event Handler Event! Admin! Observer
  • 23. • Consumers – Changes to the contract are usually backward compatible. Only MAJOR changes require a new implementation. • Providers – Almost any change to the contract requires a new implementation. MAJOR and MINOR changes require a new implementation.
  • 24. [1.2,2) 1.2.3 [1.2,1.3) consumer contract provider 1.3.0 contract 2.0.0 contract
  • 25. Consumer Contract Provider org.osgi.service.eventadmin Event! Admin! Implement.! Event Admin Event Handler Event! Admin! Observer!
  • 26. org.osgi.service.eventadmin Event! Admin! Implement.! [1.2,1.3) Event Admin Event Handler Event! Admin! Observer! [1.2,2) Provider Type Consumer Type
  • 27. org.osgi.service.eventadmin Event! Admin! Implement.! [1.2,1.3) Event Admin Event Handler Event! Admin! Observer! [1.2,2) Provider Type Consumer Type
  • 28. @ProviderType public interface EventAdmin { @ConsumerType public interface EventHandler { void handleEvent(Event event); } void sendEvent(Event event); void postEvent(Event event); }
  • 29. org.osgi.service.eventadmin Event! Admin! Implement.! [1.2,1.3) Event Admin Event Handler Event! Admin! Observer! [1.2,2) 12.023.03 ⊗ ⊗
  • 30. “We encourage development systems to provide facilities that alert developers to the impact of changes on pre-existing binaries that cannot be recompiled.” — Java Language Specification
  • 31. So we did
  • 32. maven bndtools ant jpm gradle [{…},{…},{…},…] bndlib older newer
  • 33.
  • 34.
  • 36. web
  • 37. * com.liferay.portal.kernel.dao.search MINOR 6.2.0 6.2.0 6.3.0 VERSION INCREASE REQUIRED < class com.liferay.portal.kernel.dao.search.DisplayTerms + method isSearch() + return boolean !! com.liferay.portal.kernel.dao.search MINOR 6.3.0 6.2.0 6.3.0 - < class com.liferay.portal.kernel.dao.search.DisplayTerms + method isSearch() + return boolean - version 6.2.0 + version 6.3.0 ant
  • 38. [INFO] PACKAGE_NAME DELTA CUR_VER BASE_VER REC_VER WARNINGS [INFO] = ================================================== ========== ========== ========== ========== ========== [INFO] * com.example.stuff changed 5.7.1 5.7.1 5.7.2 Version increase required [INFO] ~ class com.example.stuff.SomeImporter [INFO] ~ annotated org.apache.felix.scr.annotations.Properties [INFO] + property value=[org.apache.felix.scr.annotations.Property:TYPE:CLASS:] [INFO] - property value=[org.apache.felix.scr.annotations.Property:TYPE:CLASS:] maven
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 50. Q&A