Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
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 
Linka...
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. 
• Changin...
One example …
class SomeCode { 
public interface Foo { 
void foo(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
void bar(Foo f) ...
class SomeCode { 
public interface Foo { 
void foo(); 
void bar(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
voi...
class SomeCode { 
interface Foo { 
void bar(); 
} 
class FooImpl implements Foo { 
void foo(); 
} 
void bar(Foo f) { 
f.fo...
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! 
A...
consumer contract provider
• Consumers – Changes to the contract are usually 
backward compatible. Only MAJOR 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! 
...
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
[1.2,1.3) 
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!...
@ProviderType 
public interface EventAdmin { 
@ConsumerType 
public interface EventHandler { 
void handleEvent(Event event...
org.osgi.service.eventadmin 
Event! 
Admin! 
Implement.! 
[1.2,1.3) 
Event Admin 
Event Handler 
Event! 
Admin! 
Observer!...
“We encourage development systems to 
provide facilities that alert developers to the 
impact of changes on pre-existing b...
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.kern...
[INFO] PACKAGE_NAME DELTA CUR_VER BASE_VER REC_VER WARNINGS 
[INFO] = ================================================== =...
Drums …
Conclusion
Pretty Cool, eh!
Q&A
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
OSGi Semantic Versioning with Baselining in enRoute - P Kriens
Próxima SlideShare
Cargando en…5
×

OSGi Semantic Versioning with Baselining in enRoute - P Kriens

1.027 visualizaciones

Publicado el

OSGi Community Event 2014

Abstract:
Most people consider versions tedious and boring. And they are right! However, that does not make them less important. Unless you always compile all your code together and never have to go back in time, versions are the threads that keep the systems together in a stable way. That is, if people did not make those stupid mistakes with versions ...

Meet semantic versioning and baselining. Semantic versions provide a framework to automate version handling. This framework is used in bnd(tools) to automate most version handling.

This presentation will show what OSGi semantic versions are and its extension to also semantically version contracts. It will demonstrate the bnd(tools) support which is part of enRoute to detect semantic version violations in real time as well as in the continuous build.

Speaker Bio:
Peter Kriens is an independent consultant since 1990.He currently works for the OSGi Alliance and jpm4j. During the eighties he developed advanced distributed systems for newspapers based on microcomputers based on, at the time very novel, object oriented technologies. For this experience in Objects he was hired by a number of international companies, including Adobe, Intel, Ericsson, IBM, and many others. During his work at Ericsson Research in 1998 he got involved with the OSGi specification; Later he became the primary editor for these specifications. In 2005 he was awarded the OSGi Fellows title. After taking a sabbatical in 2012 to develop jpm4j he returned to the OSGi Alliance to help increasing adoption. He is Dutch but decided to live in France.

Publicado en: Tecnología
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

OSGi Semantic Versioning with Baselining in enRoute - P Kriens

  1. 1. Baselining with OSGi enRoute Peter Kriens
  2. 2. Baselining with enRoute • Why baselining? • Semantic versions • Consumers & Providers • Reports • IDE Support • Demo
  3. 3. Why Baselining?
  4. 4. 3.80
  5. 5. DISCLAIMER! No children were harmed for the next image …
  6. 6. Need more reasons?
  7. 7. UnsupportedClassVersionError UnsatisfiedLinkError NoSuchFieldException TypeNotPresentException NoSuchFieldError LinkageError AbstractMethodError IllegalAccessError NoClassDefFoundError InstantiationError NoSuchMethodException NoSuchMethodError ClassNotFoundException
  8. 8. Semantic Versioning
  9. 9. MINOR 1.2.3.qual MAJOR MICRO who cares?
  10. 10. 1.2.3 Change to: MAJOR MINOR MICRO 2.0.0 breaks everybody 1.3.0 backward compatible 1.2.4 no semantic change
  11. 11. Compatibility as in binary compatibility
  12. 12. 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.
  13. 13. One example …
  14. 14. class SomeCode { public interface Foo { void foo(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } }
  15. 15. class SomeCode { public interface Foo { void foo(); void bar(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } } ⊗
  16. 16. class SomeCode { interface Foo { void bar(); } class FooImpl implements Foo { void foo(); } void bar(Foo f) { f.foo(); } } ⊗ ⊗
  17. 17. All interfaces are created equal but some interfaces are more equal than others …
  18. 18. Consumer Contract Provider org.osgi.service.eventadmin Event! Admin! Implement. Event Admin Event Handler Event! Admin! Observer
  19. 19. consumer contract provider
  20. 20. • 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.
  21. 21. [1.2,2) 1.2.3 [1.2,1.3) consumer contract provider 1.3.0 contract 2.0.0 contract
  22. 22. Consumer Contract Provider org.osgi.service.eventadmin Event! Admin! Implement.! Event Admin Event Handler Event! Admin! Observer!
  23. 23. 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
  24. 24. 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
  25. 25. @ProviderType public interface EventAdmin { @ConsumerType public interface EventHandler { void handleEvent(Event event); } void sendEvent(Event event); void postEvent(Event event); }
  26. 26. org.osgi.service.eventadmin Event! Admin! Implement.! [1.2,1.3) Event Admin Event Handler Event! Admin! Observer! [1.2,2) 12.023.03 ⊗ ⊗
  27. 27. “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
  28. 28. So we did …
  29. 29. maven bndtools ant jpm gradle [{…},{…},{…},…] bndlib older newer
  30. 30. bndtools
  31. 31. web
  32. 32. * 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
  33. 33. [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
  34. 34. Drums …
  35. 35. Conclusion
  36. 36. Pretty Cool, eh!
  37. 37. Q&A

×