Why OSGi?
-
Upload
bjhargrave -
Category
Technology
-
view
9.555 -
download
1
description
Transcript of Why OSGi?
![Page 1: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/1.jpg)
Why OSGi?BJ Hargrave, IBM
Peter Kriens, aQute
![Page 2: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/2.jpg)
Agenda
• Why OSGi?
• The Dream
• Looking for Shoulders
• Java & Packages
• OSGi Bundles & Services
• Conclusion
![Page 3: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/3.jpg)
Why OSGi?
![Page 4: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/4.jpg)
Why OSGi?
Scriptorium
![Page 5: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/5.jpg)
… because there should be a better way to develop software ...
Why OSGi?
![Page 6: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/6.jpg)
Why OSGi?
2010 2003
1996 1989
1982 1982
1975 1968
1961
Amount of software doubling every 7 yearssource: http://users.jyu.fi/~koskinen/smcosts.htm
![Page 7: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/7.jpg)
Why OSGi?
2010 2003
1996 1989
1982 1982
1975 1968
1961
2017
Amount of software doubling every 7 yearssource: http://users.jyu.fi/~koskinen/smcosts.htm
![Page 8: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/8.jpg)
The Dream
![Page 9: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/9.jpg)
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
G
B
E
H
C
F
I
![Page 10: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/10.jpg)
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
B
E
H
C
F
I
![Page 11: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/11.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
B
![Page 12: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/12.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
![Page 13: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/13.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
![Page 14: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/14.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
F
I
![Page 15: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/15.jpg)
Ba Bb
The Dream
D
A
G
E
H
C
F
I
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
![Page 16: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/16.jpg)
Ba Bb
The Dream
D
A
G
E
H
C
FF
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
![Page 17: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/17.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
![Page 18: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/18.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
Ba Bb
D
A
G
E
H
C
F
![Page 19: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/19.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
![Page 20: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/20.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
![Page 21: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/21.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
![Page 22: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/22.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
C
FF
I v2.0
S;1.1.0
F
![Page 23: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/23.jpg)
Ba Bb
The Dream
• Adaptive
• Flexible
• Contracts
• Robust
• Secure
• Evolution
• Distributed
D
A
G
E
H
FF
I v2.0
S;1.1.0
F
![Page 24: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/24.jpg)
Cambridge in the 50’s
![Page 25: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/25.jpg)
“As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought.”
“… the realization came over me with full force that a good part of the remainder of my life was going to be spent finding errors in my own programs.”
Maurice Wilkes
Cambridge in the 50’s
![Page 26: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/26.jpg)
Subroutines
![Page 27: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/27.jpg)
Subroutines
Subroutines
![Page 28: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/28.jpg)
Subroutines
• Subroutine:
• Focus on what, not how
• Encapsulate the implementation details
• Formalized the input data (arguments)
• Formalized the output (return values)
![Page 29: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/29.jpg)
Subroutines
• Abstraction
• Easier to understand
• Less Code
• Fewer Errors
• Sharing
• Simpler Maintenance (depends …)
![Page 30: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/30.jpg)
Subroutines
![Page 31: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/31.jpg)
Functions
![Page 32: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/32.jpg)
Functions
Function
![Page 33: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/33.jpg)
Functions
Input(arguments)
Function
![Page 34: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/34.jpg)
Functions
Input(arguments)
Output(return)
Function
![Page 35: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/35.jpg)
Functions
Input(arguments)
Output(return)
Private
Function
![Page 36: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/36.jpg)
Then Systems Grew
![Page 37: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/37.jpg)
Then Systems Grew
![Page 38: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/38.jpg)
Spaghetti Code
![Page 39: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/39.jpg)
Pittsburg 70’s
![Page 40: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/40.jpg)
Pittsburg 70’s
“ … modularization as a mechanism for improving the flexibility and comprehensibility of a system while allowing the shortening of its development time.”
David Parnas
![Page 41: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/41.jpg)
Modules
![Page 42: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/42.jpg)
Modules
Module
![Page 43: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/43.jpg)
Modules
ImportedFunctions
ExportedFunctions
Private Functions
Module
![Page 44: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/44.jpg)
Then Systems Grew
![Page 45: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/45.jpg)
Then Systems Grew
![Page 46: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/46.jpg)
Sharing Proved Hard
![Page 47: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/47.jpg)
Sharing Proved Hard
![Page 48: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/48.jpg)
Sharing Proved Hard
![Page 49: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/49.jpg)
Palo Alto 80’s
![Page 50: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/50.jpg)
Palo Alto 80’s“Objects support modularity - the functioning of an object does not depend on the internal details of another object. The complexity of the system is reduced by this minimization of interdependencies of system components.”
Smalltalk Team
![Page 51: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/51.jpg)
Objects
![Page 52: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/52.jpg)
Objects
ImportedMembers
ExportedMembers
Private Members
Type
![Page 53: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/53.jpg)
Objects
• Objects/Classes => Modules +
• Instantiation (private data per instance)
• Inheritance
• Polymorphism
![Page 54: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/54.jpg)
Then Systems Grew
![Page 55: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/55.jpg)
Then Systems Grew
![Page 56: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/56.jpg)
C++
![Page 57: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/57.jpg)
Menlo Park 90’s
![Page 58: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/58.jpg)
Menlo Park 90’s
![Page 59: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/59.jpg)
Packages
“Chapter 7 describes the structure of a program, which is organized into packages similar to the modules of Modula.”
Java Language Specification
![Page 60: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/60.jpg)
Packages
ImportedTypes
ExportedTypes
Private Types
Packages
![Page 61: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/61.jpg)
Then Systems Grew
![Page 62: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/62.jpg)
Then Systems Grew
![Page 63: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/63.jpg)
And Distributed
![Page 64: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/64.jpg)
And Distributed
![Page 65: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/65.jpg)
And Multiplied
![Page 66: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/66.jpg)
And Multiplied
![Page 67: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/67.jpg)
Small Java App ...
![Page 68: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/68.jpg)
Worldwide 00’s
![Page 69: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/69.jpg)
Worldwide 00’s
![Page 70: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/70.jpg)
Worldwide 00’s
![Page 71: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/71.jpg)
Next Level of Modularity
![Page 72: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/72.jpg)
Next Level of Modularity
Functions
![Page 73: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/73.jpg)
Next Level of Modularity
Functions
Classes/Objects
![Page 74: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/74.jpg)
Next Level of Modularity
Functions
Classes/Objects
Packages
![Page 75: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/75.jpg)
Next Level of Modularity
Functions
Classes/Objects
Packages
Bundles
![Page 76: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/76.jpg)
Next Level of Modularity
Functions
Classes/Objects
Packages
Bundles
![Page 77: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/77.jpg)
Bundles
ImportedPackages
ExportedPackages
Private Packages
Bundle(JAR file)
![Page 78: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/78.jpg)
Type Coupling
![Page 79: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/79.jpg)
Type Coupling
![Page 80: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/80.jpg)
Download the Internet
![Page 81: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/81.jpg)
Type Coupling
![Page 82: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/82.jpg)
Type Coupling
substitutablepackages= API
![Page 83: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/83.jpg)
Instance Coupling
Provider BundleConsumer Bundle
![Page 84: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/84.jpg)
Instance Coupling
API Bundle
Provider BundleConsumer Bundle
![Page 85: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/85.jpg)
Instance Coupling
API Bundle
Provider BundleConsumer Bundle
need aninstance ...
![Page 86: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/86.jpg)
Instance Coupling
API Bundle
Provider BundleConsumer Bundle
need aninstance ... X
![Page 87: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/87.jpg)
Instance Coupling
![Page 88: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/88.jpg)
Instance Coupling
API Bundle
Provider BundleConsumer Bundle
Service
![Page 89: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/89.jpg)
A Dream Come True
D
A
G
B
E
H
C
F
I
![Page 90: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/90.jpg)
… because it is a better way to develop software ...
Why OSGi?
![Page 91: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/91.jpg)
Conclusion
2010 2003
1996 1989
1982 1982
1975 1968
1961
2017
Amount of software doubling every 7 yearssource: http://users.jyu.fi/~koskinen/smcosts.htm
![Page 92: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/92.jpg)
OSGi
• Legacy and backward compatibility is important
• Modularizing is hard
• Many popular Java patterns are fundamentally not modular
• In the next 7 years, we double the amount of software
• Investment in modularity has a great ROI!
![Page 93: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/93.jpg)
OSGi Alliance• The OSGi Alliance is a non-profit that has the
vision to develop a Java component model to ease software development
• Comprehensive framework specification
• Service specifications
• An active community
• Repository
• Tools
![Page 94: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/94.jpg)
Join!
• Help us to achieve our vision to make software simpler to develop
• Provide Requirements
• Develop specifications
• Help the community
• OSGi Alliance restructured to provide lower-cost membership levels
![Page 95: Why OSGi?](https://reader033.fdocuments.in/reader033/viewer/2022052906/558bd091d8b42ac2448b4606/html5/thumbnails/95.jpg)
Q&A