SQL Database Design For Developers at php[tek] 2024
Why Have The Specifications Been Based On Java™ Technology? - P Kriens
1. Why Have TheWhy Have The
OSGiOSGi SpecificationsSpecifications
Been Based OnBeen Based On
JavaJava™™ TechnologyTechnology
??
ByBy
Peter Kriens, CEOPeter Kriens, CEO aQuteaQute
OSGiOSGi Technology OfficerTechnology Officer
www.www.aQuteaQute.se.se
2. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 22
ContentContent
Interpreted and Compiled languagesInterpreted and Compiled languages
Detailed look at IssuesDetailed look at Issues
Comparison with .NETComparison with .NET
ConclusionConclusion
3. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 33
Interpreted LanguagesInterpreted Languages
Interpreter/VM isInterpreter/VM is betweenbetween source code and CPUsource code and CPU
Java is an interpreter with a defined executableJava 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
4. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 44
PortabilityPortability
Interpreters are easier to port to other environmentsInterpreters are easier to port to other environments
No Source Code changes requiredNo Source Code changes required
Source code Source code Source code
Compiler javac
VM
Interpreted Compiled Java
CPUCPU CPU
Interpreter
Interpreter VM
Source code
Compiler
CPUCPUCPU
5. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 55
Illegal Access To MemoryIllegal Access To Memory
No Illegal Access: Reduces security threats, ImprovesNo Illegal Access: Reduces security threats, Improves
stabilitystability
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
6. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 66
VersioningVersioning
Solves many version issues: Simpler deploymentSolves many version issues: Simpler deployment
No More: Requires version 5.12.1.4No More: Requires version 5.12.1.4--kwtkwt
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
7. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld 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
8. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 88
PerformancePerformance
PrePre--processing reduces overhead: faster startupprocessing 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
9. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld 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!
JavaJava very wellvery well defined, including rundefined, including run--timetime
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
10. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 1010
Do It Right versus PerformanceDo It Right versus Performance
Cannot performCannot perform hackshacks: security versus performance: security versus performance
Traditional code hasTraditional code has hackshacks that perform wellthat perform well
HacksHacks increase maintenance cost and field problemsincrease maintenance cost and field problems
Source code
memory
= byte= int
Conversion through
casting
Source code
memory
Invalid memory
access checks
Source code
unicode
Use of Unicode
versus bytes
Source code
s meta
Meta information
for diagnostics
Source code
s
Security Checks
security check
11. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 1111
Life Cycle ManagementLife Cycle Management
Loading policy defined in application code: FlexibilityLoading policy defined in application code: Flexibility
Used by theUsed by the OSGiOSGi specificationsspecifications
Policies implemented by application codePolicies implemented by application code
Traditional
run-time
CPU
code
Java
VM
CPU
= Class Loadernetwork
code code
code
12. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld 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 builtFirst language with built--in security architecturein security architecture
Application A
Application B
Application C
method foo SecurityManager
resource x
Verify permissions
for resource x
13. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 1313
But What AboutBut What About
MicrosoftMicrosoft’’s .NETs .NET
??
15. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld 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 theRuns the OSGiOSGi specifications!specifications!
16. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 1616
ConclusionConclusion
PortabilityPortability
Safety and security featuresSafety and security features
Increased productivityIncreased productivity
Class loaders makeClass loaders make OSGiOSGi possiblepossible
Interpreted language is the right choice for theInterpreted language is the right choice for the OSGiOSGi
Should we use Java today [again]?Should we use Java today [again]?
YES!YES!
17. www.aQute.sewww.aQute.se -- 20022002 OSGiOSGi World CongressWorld Congress -- 1717
QuestionsQuestions
??
Contact:Contact:
Peter.Kriens@aQute.sePeter.Kriens@aQute.se