Skip to main content

Architectural view of comparing framework Internals

Architectural view of comparing frameworks Internals of Java and .NET. In this article i would compare code loading process in java and .Net. I would also highlight few of the differences.


Code Loading in Java

The Java platform is based on a virtual machine that abstracts the underlying operating system and makes it possible to safely run programs across heterogeneous computing platforms. The Java virtual machine interprets portable byte code delivered in the form of class files. Class files are dynamically loaded into the virtual machine following an explicit search order. The actual run-time mechanism used to load classes in the virtual machine  is an instance of the ClassLoader class, which is a special class used by the Java platform to load  other classes. All class loaders have a parent class loader, except for the bootstrap class loader. By default, child class loaders delegate class load requests to their parent class loader and only if the parent does not find the class will the child search for the class itself. When a Java application is started, the application's main class is loaded with a default application class loader instance, which ultimately delegates to the boot class loader. It is possible for applications to provide custom subclasses of ClassLoader to perform specialized searches for classes, such as searching remote repositories. It is through class loaders and class loader customization that Java popularized or, at the very least, brought dynamic code loading to the masses.


Code Loading in .NET


Microsoft's .NET platform is similar to the Java platform in many respects, but some significant differences do exist. First, the .NET virtual machine was designed to supports multiple programming languages (e.g., C#, J#, VB.NET, and Visual C++ .NET), whereas the Java virtual machine was only designed to support Java, although other languages for it do exist (e.g., SmalltalkJVM, Groovy, Jython, JRuby, and Nice). In .NET, all languages run on the Common Language Runtime (CLR). The CLR uses a portable language format, called the Microsoft Intermediate Language (MSIL), which is analogous to Java's byte code. High-level languages are compiled into MSIL, which is then compiled into the native code of the underlying computing platform at load time, similar to how Just-In-Time (JIT) compiling works in Java. Unlike anything in Java, the CLR is able to retain assemblies in a Global Assembly Cache (GAC) for later reuse and version management. The official .NET platform is from Microsoft. Microsoft also provides a “shared source” implementation, called Rotor.
In .NET, applications and their components are packaged into assemblies. An assembly is .NET's unit of reuse, versioning, security, and deployment. An assembly is one or more files representing types and resources and is described by a manifest. An assembly manifest is represented in XML and contains information such as version number, natural language, and content hashes. Hashes come into play when calculating an assembly's signature using public key cryptography, which is also referred to as the strong name of the assembly and it is used for identification and security purposes. Assemblies can be dynamically loaded,
but, unlike Java class packages contained in JAR files, it is not possible to load individual types or classes
from an assembly.


  • In Java, the unit of code loading is a class; in .NET, the assembly is the unit of code loading, which may contain many types.
  • In Java, the compiler does not record explicit dependencies among classes, which can be arbitrarily resolved at run time; in .NET, assembly dependencies are explicitly recorded at compile time, making them difficult to resolve differently at run time
  • In Java, the class search order is nearly completely customizable via  class loaders; in .NET, class/assembly searched order controlled by more sophisticated policies that complicate implementing custom search orders.
  • In Java, the deployment unit does not form part of the class name; in .NET, the assembly name forms part of the contained type names, ultimately reducing provider substitutability.

Comments

Popular posts from this blog

ABOD and its PyOD python module

Angle based detection By  Hans-Peter Kriegel, Matthias Schubert, Arthur Zimek  Ludwig-Maximilians-Universität München  Oettingenstr. 67, 80538 München, Germany Ref Link PyOD By  Yue Zhao   Zain Nasrullah   Department of Computer Science, University of Toronto, Toronto, ON M5S 2E4, Canada  Zheng Li jk  Northeastern University Toronto, Toronto, ON M5X 1E2, Canada I am combining two papers to summarize Anomaly detection. First one is Angle Based Outlier Detection (ABOD) and other one is python module that  uses ABOD along with over 20 other apis (PyOD) . This is third part in the series of Anomaly detection. First article exhibits survey that covered length and breadth of subject, Second article highlighted on data preparation and pre-processing.  Angle Based Outlier Detection. Angles are more stable than distances in high dimensional spaces for example the popularity of cosine-based sim...

Ownership at Large

 Open Problems and Challenges in Ownership Management -By John Ahlgren, Maria Eugenia Berezin, Kinga Bojarczuk, Elena Dulskyte, Inna Dvortsova, Johann George, Natalija Gucevska, Mark Harman, Shan He, Ralf Lämmel, Erik Meijer, Silvia Sapora, and Justin Spahr-Summers Facebook Inc.  Software-intensive organizations rely on large numbers of software assets of different types, e.g., source-code files, tables in the data warehouse, and software configurations. Who is the most suitable owner of a given asset changes over time, e.g., due to reorganization and individual function changes. New forms of automation can help suggest more suitable owners for any given asset at a given point in time. By such efforts on ownership health, accountability of ownership is increased. The problem of finding the most suitable owners for an asset is essentially a program comprehension problem: how do we automatically determine who would be best placed to understand, maintain, ev...

Hybrid Approach to Automation, RPA and Machine Learning

- By Wiesław Kopec´, Kinga Skorupska, Piotr Gago, Krzysztof Marasek  Polish-Japanese Academy of Information Technology Paper Link Courtesy DZone   Abstract One of the more prominent trends within Industry 4.0 is the drive to employ Robotic Process Automation (RPA), especially as one of the elements of the Lean approach.     The full implementation of RPA is riddled with challenges relating both to the reality of everyday business operations, from SMEs to SSCs and beyond, and the social effects of the changing job market. To successfully address these points there is a need to develop a solution that would adjust to the existing business operations and at the same time lower the negative social impact of the automation process. To achieve these goals we propose a hybrid, human-centred approach to the development of software robots. This design and  implementation method combines the Living Lab approach with empowerment through part...