170 likes | 330 Views
Why Have The OSGi Specifications Been Based On Java™ Technology ? By Peter Kriens, CEO aQute OSGi Technology Officer. www.aQute.se. Content. Interpreted and Compiled languages Detailed look at Issues Comparison with .NET Conclusion. Interpreted. Compiled. Java. Source code.
E N D
Why Have The OSGi Specifications Been Based On Java™ Technology?ByPeter Kriens, CEO aQuteOSGi Technology Officer www.aQute.se
Content • Interpreted and Compiled languages • Detailed look at Issues • Comparison with .NET • Conclusion
Interpreted Compiled Java Source code Source code Source code Compiler javac byte-codes Interpreter VM CPU CPU CPU Interpreted Languages • Interpreter/VM is between source code and CPU • Java is an interpreter with a defined executable format: VM
Source code Compiler Portability Interpreted Compiled Java • Interpreters are easier to port to other environments • No Source Code changes required Source code Source code Source code Compiler javac Interpreter VM Interpreter VM CPU CPU CPU CPU CPU CPU
Illegal Access To Memory Interpreted Compiled Java • No Illegal Access: Reduces security threats, Improves stability • No (more) memory exceptions and buffer overruns Source code Source code Source code Compiler javac Interpreter VM CPU CPU CPU
lib lib lib Versioning Interpreted Compiled Java • Solves many version issues: Simpler deployment • No More: Requires version 5.12.1.4-kwt • Interpreters use symbolic linking: more robust Source code Source code Source code Compiler javac Interpreter VM CPU CPU CPU
Type Problems Detection Interpreted Compiled Java • Early detection of bugs: improved productivity • Accidental and intended type violations • Java finds all type errors, and many early Source code Source code Source code Compiler javac Interpreter VM CPU CPU CPU
Performance Interpreted Compiled Java • Pre-processing reduces overhead: faster startup • Compiled code is most efficient • JIT techniques can reduce the performance gap Source code Source code Source code Compiler javac Interpreter VM CPU CPU CPU
Interpreted Compiled Java Source code Source code Source code mod mod mod mod mod mod Interpreter Compiler VM rt.jar A-lib B-lib A-lib B-lib Too Many Libraries ... • Foundation library: One App for all platforms! • Problems increase exponentially! • Java very well defined, including run-time
Conversion through casting Invalid memory access checks Use of Unicode versus bytes Meta information for diagnostics Security Checks Source code Source code Source code Source code Source code = int = byte security check memory memory unicode s meta s Do It Right versus Performance • Cannot perform hacks: security versus performance • Traditional code has hacks that perform well • Hacks increase maintenance cost and field problems
Traditional Java code network = Class Loader code code run-time VM code CPU CPU Life Cycle Management • Loading policy defined in application code: Flexibility • Used by the OSGi specifications • Policies implemented by application code
Security • Language includes security check: Safe code • Prevents against viruses and worms • First language with built-in security architecture Application A Verify permissions for resource x Application B Application C method foo SecurityManager resource x
But What About Microsoft’s .NET ?
What is .NET? Windows CE .NET SOAP .NET Passport C# Windows Forms ADO.NET Visual Studio .NET CLI CLR Microsoft .NET speech ASP.NET Web Services Visual Basic .NET .NET Framework
Java versus .NET CLI/CLR • Java VM technology is similar to .NET C# • But the Java environment is: • More mature • Not controlled by a single vendor: JCP • Applicable for embedded devices • Coherent environment (single syntax) • Exists for virtually every OS in existence, today • Runs the OSGi specifications!
Conclusion • Portability • Safety and security features • Increased productivity • Class loaders make OSGi possible • Interpreted language is the right choice for the OSGi • Should we use Java today [again]? • YES!
Questions ? Contact: Peter.Kriens@aQute.se