j2eevs.net
DESCRIPTION
This presentation gives an idea about comparison of two different software platforms.TRANSCRIPT
J2EE vs .NET J2EE vs .NET
Presentation by(Presentation by(): ):
Saloni TyagiSaloni Tyagi
E-Mail: E-Mail: [email protected][email protected]
mm
Comparing J2EE with .NET
AgendaAgenda
Platform and ProfilePlatform and Profile ComparisonComparison
Layer-by-Layer comparison of the Layer-by-Layer comparison of the infrastructuresinfrastructures
SummarySummary
Comparing J2EE with .NET
Platform and ProfilePlatform and Profile There are the following variants of There are the following variants of
JavaJava JavaCardJavaCard J2ME (Java 2 Platform Micro Edition)J2ME (Java 2 Platform Micro Edition) J2SE (Java 2 Platform Standard Edition)J2SE (Java 2 Platform Standard Edition) J2EE (Java 2 Platform Enterprise Edition)J2EE (Java 2 Platform Enterprise Edition)
Comparing J2EE with .NET
.NET framework.NET framework
..NET UniverseNET Universe .NET framework for Standard .NET framework for Standard
and enterpriseand enterprise .NET Compact framework.NET Compact framework
Consistent Programming modelConsistent Programming model Cross platform supportCross platform support Language interoprabilityLanguage interoprability Automatic management of Automatic management of resourcesresources Ease of deploymentEase of deployment
.NET ARCHITECTURE
OPERATING SYSTEM HARDWARE
COMMON LANGUAGE RUNTIME(CLR)
.NET FRAMEWORK BASE CLASS LIBRARY
WINDOWS FORMS ASP.NET CONSOLE ADO.NET
.NET FRAMEWORK CLASS LIBRARY
COMMON TYPE SYSTEM
COMMON LANGUAGE SPECIFICATION
C# VB.NET VISUAL C++ OTHERS..
WINDOWS PRESENTATION
(WPF)
WINDOWS COMMUNICATION
(WCF)
WINDOWSWORKFLOW
(WWF)
WINDOWS CARDSPACE
LINQ ASP.NET 3.5 ADO.NETADDITIONAL
ENHANCEMENTS..
.NET 3
.0.N
ET 3
.5
Visu
al S
tudio
.NET
.NE
T fra
mew
ork
2.0
and
SP1
Comparing J2EE with .NET
Layer-By-Layer ComparisonLayer-By-Layer Comparison
Comparing J2EE with .NET
The Runtime SystemThe Runtime System
Comparing J2EE with .NET
Java Virtual MachineJava Virtual Machine The JVM is intended for Java and interprets Java The JVM is intended for Java and interprets Java
Byte Code. Byte Code. Just-in-Time compilers exist for different Just-in-Time compilers exist for different
environments and OSsenvironments and OSs
Java
Com
piler
CLASS-Files
Classloader/Verifier JIT
NativeCode
Interpreter
Garbage Collection,
Security Manager‘Multithreading,
...
Comparing J2EE with .NET
.NET Runtime.NET Runtime Common Language Runtime (CLR)Common Language Runtime (CLR) It is intended for any language compiled to the It is intended for any language compiled to the
MSILMSIL Provides integration for several languagesProvides integration for several languages
C#
VB.NET
C++
Perl
Com
piler
MSIL +Metadata
Loader/Verifier JIT
Managed Code
ExecutionGarbage
Collection,Security,
Multithreading,...
Comparing J2EE with .NET
Commonalities and DifferencesCommonalities and Differences
Commonalities:Commonalities: Basic concepts are similarBasic concepts are similar
Differences:Differences: Java is intended for interpretation Java is intended for interpretation Java allows for custom class loaders Java allows for custom class loaders
and security managersand security managers .NET CLR provides a command set .NET CLR provides a command set
that also supports functional that also supports functional languageslanguages
Comparing J2EE with .NET
The Object ModelThe Object Model
Comparing J2EE with .NET
Object Model (Java)Object Model (Java)
Java has primitive types and classes.Java has primitive types and classes. No automatic boxing/ unboxingNo automatic boxing/ unboxing
Types
Primitive Types Reference Types
InterfacesArrays
Classes
Comparing J2EE with .NET
java.lang.Objectjava.lang.Object
The “Mother of all Java classes“The “Mother of all Java classes“public class Object { public Object(); public boolean equals(Object obj); public final Class getClass(); public int hashCode(); public final void notify(); public final void notifyAll(); public String toString(); public final void wait() throws InterruptedException; public final void wait(long timeout) throws InterruptedException; public final void wait(long timeout, int nanos)
throws InterruptedException; protected Object clone() throws CloneNotSupportedException; protected void finalize() throws Throwable;}
Comparing J2EE with .NET
Object Model (.NET)Object Model (.NET)
In .NET, everything is an object In .NET, everything is an object
Types
Value Types Reference Types
System ValueTypes
User ValueTypes
Enumerations
InterfacesPointers
Self-describingTypes
ArraysClasses
Delegates Boxed Values
User-Defined
Comparing J2EE with .NET
System.ObjectSystem.Object
The “mother of all .NET classes“The “mother of all .NET classes“public class Object { public virtual int GetHashCode(); public virtual bool Equals(); public virtual String ToString(); public static bool Equals(object a, object b); public static bool ReferenceEquals(object a, object b); public Type GetType(); protected object MemberWiseClone(); protected virtual Finalize()´;}
Comparing J2EE with .NET
Important Base ClassesImportant Base Classes
.NET.NET JavaJavaGUI Windows.Forms
Web.FormsSWING, AWT
Communication System.Net: Connection, HttpWebRequest, ...
Java.net: Sockets, URL, ...
Container System.Collections: ArrayList, BitArray, Maps, Queue, List, Stack
java.util: Lists, Maps, Sets, Trees, Vectors
No big conceptual differences here.
Comparing J2EE with .NET
Multithreading in .NET and JavaMultithreading in .NET and Java
.NET:.NET: .NET uses delegates for multithreading.NET uses delegates for multithreading There are monitors for synchronizationThere are monitors for synchronization
Java :Java : In java there is a class „Thread“ In java there is a class „Thread“ For synchronization there is synchronized For synchronization there is synchronized
keywordkeyword
Comparing J2EE with .NET
DeploymentDeployment
Comparing J2EE with .NET
Java JAR filesJava JAR files
.jar files are similar to .NET‘s .jar files are similar to .NET‘s assembliesassemblies They can be shared or privateThey can be shared or private They can be signedThey can be signed
They contain They contain types types resourcesresources metadata in manifest filemetadata in manifest file
Comparing J2EE with .NET
Assemblies in .NETAssemblies in .NET
Types:Types: Shared Assemblies Shared Assemblies
They are signed by a keyThey are signed by a key They are versioned!!They are versioned!!
Private Assemblies Private Assemblies private to clientprivate to client Avoid version problemsAvoid version problems ..
Menifest
Resources
metadataTYPE1
IL CODE
TYPE2IL CODE
TYPE3IL CODE
Comparing J2EE with .NET
Commonalities and DifferencesCommonalities and Differences
Commonalities:Commonalities: Assemblies and JAR files provide Assemblies and JAR files provide
“deployment“ components“deployment“ components Differences:Differences:
Much better versioning support in .NET Much better versioning support in .NET (side-by-side execution)(side-by-side execution)
Comparing J2EE with .NET
Database Access in JavaDatabase Access in Java
Java provides JDBC to access Java provides JDBC to access relational datarelational data
ODBCDB
ODBC Driver
JDBC/ODBC Bridge
Driver ManagerConnection
Statement
PreparedStatement
CallableStatement
Resultset
Application
Comparing J2EE with .NET
Database Access in .NETDatabase Access in .NET
In .NET there is ADO.NETIn .NET there is ADO.NET ““connectionless”connectionless”
Data Source
DataSetCommandCommand
Connection
DataReader
DataSet
Client
Managed Provider
Comparing J2EE with .NET
ADO.NETADO.NET
ADO.NET provides way to acessADO.NET provides way to acess XML dataXML data Relational and application dataRelational and application data
ADO.NET architectureADO.NET architecture DisconnectedDisconnected
Comparing J2EE with .NET
Commonalities and DifferencesCommonalities and Differences
Commonalities:Commonalities: Decoupling of the concrete data model Decoupling of the concrete data model
and the userand the user Differences:Differences:
JDBC has a more relational JDBC has a more relational flavor,ADO.NET uses XML flavor,ADO.NET uses XML
JDBC is connection oriented, ADO.NET JDBC is connection oriented, ADO.NET always works non-connected, or offlinealways works non-connected, or offline
.NET DataSets are a kind of In-Memory-.NET DataSets are a kind of In-Memory-Database-Cache.Database-Cache.
Comparing J2EE with .NET
WebWeb
Comparing J2EE with .NET
Java Server Pages and ServletsJava Server Pages and Servlets
Java also allows for server-side Java also allows for server-side scriptingscripting JSPs are based on ServletsJSPs are based on ServletsWeb
ServerClient(1) get a.jsp (2) process
JVM
JSP
OtherComponents
Database
(4) result
(5) HTTP file
Servlet
(3) gen. Servlet Servlet Impl.
Comparing J2EE with .NET
ASP.NET ASP.NET (Server-Side Scripting)(Server-Side Scripting)
ASP.NET Architecture:ASP.NET Architecture:
IIS 5Web
ServerClient
(1) get a.apx (2) process
.NETEngine
.NETAssembly
OtherAssemblies
Database
(3) result
(4) HTTP file
Comparing J2EE with .NET
Login Example Login Example
JAVA LOGINJAVA LOGIN
.NET LOGIN.NET LOGIN
Comparing J2EE with .NET
.NET and/or Java ?.NET and/or Java ?
.NET is a product, Java and J2EE is a .NET is a product, Java and J2EE is a specificationspecification
Java should be used for:Java should be used for: real big systemsreal big systems Platform independencePlatform independence More scalabilityMore scalability
.NET should be used for:.NET should be used for: Window application and GUIWindow application and GUI Language indepedenceLanguage indepedence
Comparing J2EE with .NET
Questions?Questions?
… …....
Comparing J2EE with .NET
The EndThe End
Thank you !!Thank you !!