23. 1. Ad Hoc
• Flat, manual class path
• Single name space
• Full visibility and normal
accessibility
• Monolithic
• Highly coupled
• Split Packages
• Add/Shuffle JARs until it works
vrijdag 25 november 11
24. 1. Ad Hoc
• Flat, manual class path
• Single name space
e l l
H
• Full visibility and normal
accessibility
• Monolithic
AR
•
•
Highly coupled
Split Packages J
• Add/Shuffle JARs until it works
vrijdag 25 november 11
25. 2. Managed
• Treat JARs as a module
• JAR Identity
• Naming
• Versioning
• Dependencies
• Repositories
vrijdag 25 november 11
26. 2. Managed
a d
• Treat JARs as a module
n l o
w he t
• JAR Identity
• Naming
D o t
• Versioning
r n e
• Dependencies
n t e
• Repositories
i
vrijdag 25 november 11
27. 3. Contracts
• Interface based design,
POJOs
• Provide contracts for
each connection
between JARs
• Implementation details
inside the JAR
• Versioning on contracts
vrijdag 25 november 11
28. 3. Contracts
•
d e r
a
Interface based design,
o
POJOs
• Provide contracts for
l s
s k
s c
a a
each connection
l h
between JARs
• Implementation details
inside the JAR c
• Versioning on contracts
vrijdag 25 november 11
29. 4. Fences
• Explicitly Import/Export
packages
• Explicitly specify
requirements and capabilities
• Enforce the module
boundaries
• Semantic Versioning
• Side-by-side versioning
supported
vrijdag 25 november 11
30. 4. Fences
• Explicitly Import/Export
packages
• Explicitly specify
requirements and capabilities
o d!
•
•
Enforce the module
boundaries
Semantic Versioning
Go
• Side-by-side versioning
supported
vrijdag 25 november 11
31. 5. Optimize
• Exploit concepts for
modules and contracts
• Delegated Control
• Optimize the code base to
leverage new patterns:
• Extender
• Whiteboard
• Repeat
vrijdag 25 november 11
32. 5. Optimize
• Exploit concepts for
modules and contracts
• Delegated Control
• Optimize the code base to
leverage new patterns:
• Extender
• Whiteboard
• Repeat
vrijdag 25 november 11
33. Today
1.
Ad Hoc
2. 3.
Managed Contracts
4.
Fences
5.
Optimize
vrijdag 25 november 11
34. Today
1.
Ad Hoc Enterprise
DI
vn ,C
m ice ing
2. 3.
Ivy Managed Contracts
gu r
saw sp
jig
4.
Fences
5.
Optimize
vrijdag 25 november 11
35. Today
1.
Ad Hoc Enterprise
DI
vn ,C
m ice ing
2. 3.
Ivy Managed Contracts
gu r OSGi
saw s p
jig
4.
Fences
5.
Optimize
vrijdag 25 november 11
36. Today
1.
Ad Hoc Enterprise
DI
vn ,C
m ice ing
2. 3.
Ivy Managed Contracts
gu r OSGi
saw s p
jig
4.
Fences
5.
Optimize
vrijdag 25 november 11
53. Coupling
modular not Example
modular
type FooImpl foo;
Foo foo = (Foo)
instance Class.forName(“FooImpl”)
.newInstance();
vrijdag 25 november 11
54. Type Coupling
class Client {} class FooImpl{}
vrijdag 25 november 11
55. Type Coupling
class Client {} class FooImpl{}
vrijdag 25 november 11
56. Type Coupling
class Client {} class FooImpl{}
interface Foo{}
vrijdag 25 november 11
57. Type Coupling
class Client {} class FooImpl{}
interface Foo{}
uses implements
vrijdag 25 november 11
58. Type Coupling
class Client {} class FooImpl{}
interface Foo{}
uses implements
get instance
vrijdag 25 november 11
59. Type Coupling
class Client {} class FooImpl{}
o
r ?l
o ut s
n einterface Foo{}
C s
uses implements
Is get instance
vrijdag 25 november 11
60. Instance Coupling
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
61. Instance Coupling
client container impl
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
62. Instance Coupling
client container impl
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
63. Instance Coupling
client container impl
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
64. Instance Coupling
client container impl
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
65. Instance Coupling
client container impl
• New
• Factory
• Inversion of Control
• Broker
vrijdag 25 november 11
66. Instance Coupling
t
o ?
n ?
g ??
client container impl
•
i n r
New
•
•
Factory
S ur a
p l
Inversion of Control
• Broker
o d
M
vrijdag 25 november 11
96. Migration
A B C
D E F
G H I
vrijdag 25 november 11
97. Migration
A B C
D E F
G H I
vrijdag 25 november 11
98. Migration
A B C
D E F
G H I
vrijdag 25 november 11
99. Migration
A B C
D E F
G H I
vrijdag 25 november 11
100. Migration
A B C
D E F
G H I
vrijdag 25 november 11
101. POJOSR
• Developed by Karl Pauls
• JavaOne presentation 24811
• http://pojosr.googlecode.com
• Based on Apache Felix
vrijdag 25 november 11
102. Good Fences
Make Good Neighbors
vrijdag 25 november 11
103. Good Fences
od ul es
Make Good Neighbors
m
vrijdag 25 november 11
104. Conclusion
2010 2003
2017
1996 1989
1982 1982
1975 1968
1961
Amount of software doubling every 7 years
source: http://users.jyu.fi/~koskinen/smcosts.htm
vrijdag 25 november 11
105. 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!
vrijdag 25 november 11
106. 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
vrijdag 25 november 11