why have the osgi specifications been based on java technology ? by peter kriens, ceo aqute osgi...

17
Why Have The Why Have The OSGi Specifications OSGi Specifications Been Based On Been Based On Java™ Technology Java™ Technology ? ? By By Peter Kriens, CEO aQute Peter Kriens, CEO aQute OSGi Technology Officer OSGi Technology Officer www.aQute.s www.aQute.s e e

Upload: jaden-jackson

Post on 26-Mar-2015

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

Why Have The Why Have The OSGi Specifications OSGi Specifications

Been Based On Been Based On Java™ TechnologyJava™ Technology

??ByBy

Peter Kriens, CEO aQutePeter Kriens, CEO aQuteOSGi Technology OfficerOSGi Technology Officer

www.aQute.swww.aQute.see

Page 2: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 22

ContentContent

Interpreted and Compiled languagesInterpreted and Compiled languages Detailed look at IssuesDetailed look at Issues Comparison with .NETComparison with .NET ConclusionConclusion

Page 3: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 33

Interpreted LanguagesInterpreted Languages

Interpreter/VM is Interpreter/VM is betweenbetween source code and CPU source code and CPU Java is an interpreter with a defined executable Java is an interpreter with a defined executable

format: VMformat: VM

Compiled

Source code

Compiler

CPU

Java

Source code

javac

VM

CPU

Interpreted

Source code

CPU

Interpreter

byte-codes

Page 4: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 44

PortabilityPortability

Interpreters are easier to port to other Interpreters are easier to port to other environmentsenvironments

No Source Code changes requiredNo Source Code changes required

Source code Source code Source code

Compiler javac

VM

Interpreted Compiled Java

CPUCPU CPU

InterpreterInterpreter VM

Source code

Compiler

CPUCPUCPU

Page 5: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 55

Illegal Access To MemoryIllegal Access To Memory

No Illegal Access: Reduces security threats, No Illegal Access: Reduces security threats, Improves stabilityImproves stability

No (more) memory exceptions and buffer overrunsNo (more) memory exceptions and buffer overruns

Compiler

Interpreted Compiled Java

CPUCPU CPU

Interpreter

javac

VM

Source code Source code Source code

Page 6: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 66

VersioningVersioning

Solves many version issues: Simpler deploymentSolves many version issues: Simpler deployment No More: Requires version 5.12.1.4-kwtNo More: Requires version 5.12.1.4-kwt Interpreters use symbolic linking: more robustInterpreters use symbolic linking: more robust

Compiler

Interpreted Compiled Java

CPUCPU CPU

Interpreter

javac

VM

Source code Source code Source code

lib liblib

Page 7: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 77

Type Problems DetectionType Problems Detection

Early detection of bugs: improved productivityEarly detection of bugs: improved productivity Accidental and intended type violationsAccidental and intended type violations Java finds all type errors, and many earlyJava finds all type errors, and many early

Compiler

Interpreted Compiled Java

CPUCPU CPU

Interpreter

javac

VM

Source code Source code Source code

Page 8: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 88

PerformancePerformance

Pre-processing reduces overhead: faster startupPre-processing reduces overhead: faster startup Compiled code is most efficientCompiled code is most efficient JIT techniques can reduce the performance gapJIT techniques can reduce the performance gap

Compiler

Interpreted Compiled Java

CPUCPU CPU

Interpreter

javac

VM

Source code Source code Source code

Page 9: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 99

Too Many Libraries ...Too Many Libraries ...

Foundation library: One App for all platforms!Foundation library: One App for all platforms! Problems increase exponentially!Problems increase exponentially! Java Java very wellvery well defined, including run-time defined, including run-time

Interpreted

Source code

mod

Interpreter

A-lib

mod

B-lib

Compiled

Source code

mod mod

Compiler

A-lib B-lib

Java

Source code

mod mod

VM

rt.jar

Page 10: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1010

Do It Right versus Do It Right versus PerformancePerformance

Cannot perform Cannot perform hackshacks: security versus performance: security versus performance Traditional code has Traditional code has hackshacks that perform well that perform well HacksHacks increase maintenance cost and field problems increase maintenance cost and field problems

Source code

memory

= byte= int

Conversion through casting

Source code

memory

Invalid memoryaccess checks

Source code

unicode

Use of Unicodeversus bytes

Source code

s meta

Meta informationfor diagnostics

Source code

s

Security Checks

security check

Page 11: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1111

Life Cycle ManagementLife Cycle Management

Loading policy defined in application code: FlexibilityLoading policy defined in application code: Flexibility Used by the OSGi specificationsUsed by the OSGi specifications Policies implemented by application codePolicies implemented by application code

Traditional

run-time

CPUcode

Java

VM

CPU

= Class Loadernetwork

code code

code

Page 12: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1212

SecuritySecurity

Language includes security check: Safe codeLanguage includes security check: Safe code Prevents against viruses and wormsPrevents against viruses and worms First language with built-in security architectureFirst language with built-in security architecture

Application A

Application B

Application C

method foo SecurityManager

resource x

Verify permissionsfor resource x

Page 13: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1313

But What AboutBut What About

Microsoft’s .NETMicrosoft’s .NET

??

Page 14: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1414

What is .NET?What is .NET?

Page 15: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1515

Java versus .NET CLI/CLRJava versus .NET CLI/CLR

Java VM technology is similar to .NET C#Java VM technology is similar to .NET C# But the Java environment is:But the Java environment is:

– More matureMore mature– Not controlled by a single vendor: JCPNot controlled by a single vendor: JCP– Applicable for embedded devicesApplicable for embedded devices– Coherent environment (Coherent environment (singlesingle syntax) syntax)– Exists for virtually every OS in existence, Exists for virtually every OS in existence, todaytoday

– Runs the OSGi specifications!Runs the OSGi specifications!

Page 16: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1616

ConclusionConclusion

Portability Portability Safety and security featuresSafety and security features Increased productivityIncreased productivity Class loaders make OSGi possibleClass loaders make OSGi possible Interpreted language is the right choice Interpreted language is the right choice

for the OSGifor the OSGi Should we use Java today [again]?Should we use Java today [again]? YES!YES!

Page 17: Why Have The OSGi Specifications Been Based On Java Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer

www.aQute.sewww.aQute.se - 2002 OSGi World - 2002 OSGi World Congress - Congress - 1717

QuestionsQuestions

??

Contact:Contact:[email protected]@aQute.

sese