SlideShare une entreprise Scribd logo
1  sur  98
Comparing J2EE with .NET  - ACCU 2002 - Slides (mostly   ) by Michael Stal, Senior Principal Engineer SIEMENS AG, Dept. CT SE 2 E-Mail:  mailto:Michael.Stal@mchp.siemens.de Web:  http:// www.stal.de Markus Voelter, CTO, MATHEMA AG [email_address] http://www.voelter.de
Goal ,[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Frameworks Workflow Engine Web-based and -related Protocols (HTTP, SMTP, ...) Service Description, Discovery, Integration (UDDI) Service Description (WSDL) Service Context (Who, Where, When, Why, ....) Virtual Machine Micro/Macro Services  Integration Layer Legacy Backend Server Mainframe Frontend Layer (Web Server)   Web Service User/Provider Core Services (Calendar, Preferences, Transactions, ...) Core elements of Web Frameworks  Clients
.NET – The Microsoft Way of Life .NET Devices  TabletPC, PocketPC, .... .NET Servers  SQL Server, Biztalk, Commerce, Exchange, Mobile Information,  Host Integration, Application Center .NET Foundation Services (Hailstorm)   Passport, Calendar, Directory & Search, Notification & Messaging,  Personalization, Web-Store/XML, Dynamic Delivery of Software and Services Common Language Runtime   (Memory Management, Common Type System, Lifecycle Monitor) .NET Framework & Tools Base Classes   (ADO.NET, XML, Threading, IO, ....) ASP.NET (Web Services, Web Forms, ASP.NET Application Services) Windows Forms (Controls, Drawing,  Windows  Application Services)
Sun ONE (Open Net Environment) Service Interface Service Container (J2EE, EJB, JSP,  J2SE, J2ME,  MIDP, Java Card) Process  Management Service  Integration (SQL, JDBC, XML,  XSLT, XP, JMS,  RMI, J2EE Connectors, ...) Service Platform Smart Management (SNMP, CIM, WBEM, JMX) Smart Delivery (XML, HTML, XHTML, WML, VoiceXML, XSLT, HTTP, SSL, XP, SOAP, WSDL, UDDI, ebXML, ...) Web Services Smart Process (ebXML, XAML) Smart Policy (LDAP, Kerberos, PKI, OASIS Security)) Service Creation and Assembly (JB, JSP, EJB)
Layer-By-Layer Comparison
Hello World Example ,[object Object],using System; namespace MyNameSpace { public class MyClass { public static void Main(String [] args) { Console.WriteLine(„Hello, C#!“); } } }  package MyPackage; public class MyClass { public static void main(String [] args) { System.out.println(„Hello, Java!“); } }
Layers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Runtime System
.NET Runtime ,[object Object],[object Object],[object Object],[object Object],C# VB.NET C++ Perl Compiler MSIL + Metadata Loader/ Verifier JIT Managed  Code Execution Garbage  Collection, Security, Multithreading, ...
Java Virtual Machine ,[object Object],[object Object],[object Object],Java Compiler CLASS- Files Classloader/ Verifier JIT Native Code Hotspot Interpreter Garbage  Collection, Security Manager Call-in+Call-out, Multithreading, ...
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Object Model
Object Model (.NET) ,[object Object],Types Value Types Reference Types System Value Types User Value Types Enumerations Interfaces Pointers Self-describing Types Arrays Classes Delegates Boxed Values User-Defined
System.Object ,[object Object],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()´; }
Object Model (.NET) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Model (Java) ,[object Object],[object Object],Types Primitive Types Reference Types Interfaces Arrays Classes
java.lang.Object ,[object Object],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; }
Object Model (Java) ,[object Object],[object Object],Integer i_ref = new Integer(7); List l = ... l.add( i_ref );
.NET-Types that are not available in Java ,[object Object],class MyClass { ... public void somebodyTurnedOnTheLight( int which ) { ... } } class AnotherClass { ... public delegate void LightTurnedOn(int which); public event LightTurnedOn OnLightTurnedOn; ... OnLightTurnedOn+= new    LightTurnedOn(MyClass.somebodyTurnedOnTheLight); }
.NET-Types that are not available in Java cont‘d ,[object Object],[object Object],[object Object],[object Object],[object Object],public struct Name { public String First; public String Last; } int [2][] a; a[0] = new int[]{1}; a[1] = new int[]{1,2}; int [,] a = new int[2,2]; enum Color : byte { RED = 1, BLUE = 2, GREEN = 3 };
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Metainformation ,[object Object],[object Object],[object Object],[object Object]
.NET Examples  ,[object Object],[object Object],[object Object],[AuthorIs(„Michael“)] class MyClass { ... } [AttributeUsage(AttributeTargets.All)] public class AuthorIsAttribute : Attribute { private string m_Name; public AuthorIsAttribute(string name) { m_Name = name;} }
.NET Examples cont‘d ,[object Object],using System; using System.Reflection; namespace ComponentClient { class Client { static void Main(string[] args) {   Assembly a = Assembly.LoadFrom("Component.dll");   Type [] allTypes = a.GetTypes();   Type t = allTypes[0];   object o = Activator.CreateInstance(t);   MethodInfo mi = t.GetMethod("algorithm");   double d = (double) mi.Invoke(o, new object[]{21.0}); } } }
Java Example ,[object Object],[object Object],import java.lang.reflect.*; try { Class c = Class.forName(„MyPrintComponent“); Object o = c.newInstance(); Method m = c.getMethod(„print“, new Class[]{ String.class }); m.invoke(o, new Object[]{„Hallo, Java!“}); } catch (Exception e) { // handle it here }
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Statements ,[object Object],[object Object],[object Object],string name = address.name; switch (name) { case “Maier”: Console.WriteLine(“Nice to meet you, Hans!”); break; case “Mueller”, case “Huber”: Console.WriteLine(“You owe me some money!”); break; default: Console.WriteLine(“I don’t know you”); break; }
Statements (cont‘d) ,[object Object],[object Object],[object Object],foreach (Elem i in MyContainer) { Console.WriteLine(i); } ... class  MyContainer : IEnumerable, IEnumerator { public  IEnumerator GetEnumerator() { return  (IEnumerator) this ; } public   void  Reset() { ... } public bool MoveNext() { ... } public object Current { get  { ... } } }
Statements (cont‘d) ,[object Object],[object Object],for (Iterator i = MyContainer.iterator(); i.hasNext();)  doSomething(i.next()); ... class  MyContainer implements Iterator { public boolean hasNext() {…} public Object next() {...} public void remove() {...} public Iterator iterator() { return this; } }
Statements (cont‘d) ,[object Object],[object Object],Class MyClass { ... public double x { set { if (x < 0)  throw new ArgumentException (“< 0”); m_x = value;  } get { return m_x;  } } ... // User:  MyClass m = new MyClass(); m.x = 22;
Statements (cont‘d) ,[object Object],[object Object],[object Object],object[17] = 22; // In class: Int [] m_a; public double this[int pos] { get { return m_a[pos]; } set { m_a[pos]  = value; } }
Statements (cont‘d) ,[object Object],[object Object],public static Point operator+(Point op1, Point op2) { return new Point(op1.x+op2.x,op1.y+op2.y); } ... Point p = new Point(1,2) + new Point(2,3);
Statements (cont‘d) ,[object Object],[object Object],class Test { public void Print(int i) { Console.WriteLine(i); } public void Inc(ref int i) { i++; } public int SetInitial(out int i) { i = 42; } ... } Test t = ...; int i; t.SetInitial(out i); t.Inc(ref i); t.Print();
Statements (cont‘d) ,[object Object],[object Object],[object Object],[object Object],public int insert(int i) throws OverLimitException; { … }  // only way to tell you about  // OverLimitException thrown below  public int insert(int i) { … }
Important Base Classes No big conceptual differences here. Java.net: Sockets, URL, ... System.Net: Connection, HttpWebRequest, ... Kommunikation java.util: Lists, Maps, Sets, Trees, Vectors System.Collections: ArrayList, BitArray, Maps, Queue, List, Stack Container SWING, AWT Windows.Forms Web.Forms GUI Java .NET
Multithreading
Multithreading in .NET ,[object Object],[object Object],[object Object],[object Object],class GlobalData { int m_Value; public int Value { set { lock(this) { m_Value = value; } } } } class Worker { GlobalData m_Global; public Worker(GlobalData global) {m_Global = global; } public void loop() { m_global.Value = 42; Thread.Sleep(100); } } // somewhere else: GlobalData g = new GlobalData(); Thread t = new Thread(new ThreadStart(new Worker().loop)); t.Start(); t.Join(); 1
Multithreading in Java ,[object Object],[object Object],class GlobalData { int m_Value; public synchronized int setValue { return m_Value; } } class Worker implements Runnable { GlobalData m_Global; public Worker(GlobalData global) { m_Global = global; } public void run() { m_Global.setValue(42); Thread.sleep(100); } } // somewhere else: GlobalData g = new GlobalData(); Thread t = new Thread(new Worker()); t.start(); t.join(); 1
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deployment
Assemblies in .NET ,[object Object],Manifest Module 1 Resources Type 1 IL-Code Type 2 IL-Code Type 3 IL-Code name version Sharedname Hash Files Referenced Assemblies Types Security Custom Attributes Product Information Metadata
Assemblies in .NET ,[object Object],[object Object],[object Object],[object Object],[object Object]
Java JAR files ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object]
Component Models
Server-Side Components in .NET ,[object Object],[object Object],[object Object]
Java Component Models ,[object Object],[object Object],[object Object],[object Object],public class MyJavaBean { private int color; public void setColor(int v) { color = v; } public int getColor() { return color; } // a lot of more ... } // BeanInfo class not shown here!
Server Components in Java ,[object Object],Client 3) Use bean Naming Service 1) lookup home JNDI 4) remove Application Server (Container) Remote Bean Interface Remote Bean Home Interface 2”) find bean 2) create bean Bean Instance EnterpriseBean EJB Context 4 ejbCreate ejb... Deployment Descriptor EJB Jar bean-methods EJB Home EJB Object new EJB Run-time
Server Components in Java cont‘d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Database Access in .NET ,[object Object],[object Object],Data Source DataSetCommand Command Connection DataReader DataSet Client Managed Provider
.NET-Beispiel using System; using System.Data; using System.Data.SqlClient; string myConnection =  “ server=myserver;uid=sa;pw d=;database=StockTickerDB”; string myCommand = “SELECT * from StockTable”; SqlDataSetCommand datasetCommand = new  SqlDataSetCommand(myCommand, myConnection); DataSet myDataSet = new DataSet(); datasetCommand.FillDataSet(myDataSet, “StockTable”); DataTable myTable =ds.Tables[“StockTable”]; foreach (DataRow row in myTable.Rows) { Console.WriteLine(“Value of {0} is {1}”,  row[“LongName”], row[“Value”]); }
ADO.NET ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Database Access in Java ,[object Object],ODBC DB ODBC Driver JDBC/ ODBC Bridge Driver Manager Connection Statement Prepared Statement Callable Statement Resultset Application
Java Example import java.sql.*; // without error handling: Class.forName(„sun.jdbc.odbc.JdbcOdbcDriver“); Connection  con=DriverManager.getConnection(„jdbc:odbc:stocks,““,““); Statement stmt = con.CreateStatement(); ResultSet rs = stmt.executeQuery(„SELECT * from stocks“); while (rs.next()) { System.out.println(rs.getString(„COMPANYNAME“)); } rs.close(); stmt.close(); con.close();
Database Access in Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XML
XML and .NET ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
XML and .NET cont‘d ,[object Object],[object Object],[object Object],[object Object]
XML und Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remoting ,[object Object]
Remoting in .NET Application Domain B Client Formatters Channels Envoy Sinks Real Proxy Transparent Proxy Servant Formatters Channels Server Context Sinks Object Context Sinks Network Application Domain A
Remoting in .NET (cont‘d) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Remoting in .NET (cont‘d) ,[object Object],[object Object]
Remoting in Java ,[object Object],[object Object],[object Object],Stub/Skeleton-Layer Client Server Stub Skeleton Remote Reference Manager Transport Layer
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web
ASP.NET  (Server-Side Scripting) ,[object Object],IIS 5 Web Server Client (1) get a.apx (2) process .NET Engine .NET Assembly Other Assemblies Database (3) result (4) HTTP file
ASP.NET Example ,[object Object]
ASP.NET Example (cont‘d) <%@ Page language=&quot;c#&quot;  Codebehind=&quot;WebForm1.aspx.cs&quot;  AutoEventWireup=&quot;false&quot; Inherits=&quot;LoginPage.WebForm1&quot; %> <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; > <HTML> <body> <form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;> <asp:Label id=&quot;TitleLabel&quot; runat=&quot;server&quot;>Please specify your name and password</asp:Label> <br> <asp:Label id=&quot;LoginLabel&quot; runat=&quot;server&quot;>Login</asp:Label> <br> <asp:TextBox id=&quot;LoginText&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;RequiredFieldValidator&quot; runat=&quot;server&quot; ErrorMessage=&quot;You need to specify your name&quot; ControlToValidate=&quot;LoginText&quot;></asp:RequiredFieldValidator> <br> <asp:Label id=&quot;PasswordLabel&quot; runat=&quot;server&quot;>Password</asp:Label> <br> <asp:TextBox  id=&quot;PasswordText&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <br> <asp:Button id=&quot;EnterButton&quot; runat=&quot;server&quot; Text=&quot;Open the entrance&quot; ToolTip=&quot;Press this after you have specified login and password&quot;></asp:Button> <br> <asp:Label id=&quot;MessageText&quot; runat=&quot;server&quot;></asp:Label> </form> </body> </HTML>
ASP.NET Example (cont‘d) // lot of details omitted namespace LoginPage { public class WebForm1 : System.Web.UI.Page { protected TextBox PasswordText, LoginText; protected Button EnterButton; protected Label  MessageLabel; private void InitializeComponent() {  this.EnterButton.Click +=    new System.EventHandler(this.EnterButton_Click); this.Load += new System.EventHandler(this.Page_Load); } private void EnterButton_Click(object sender, System.EventArgs e) { if (!(LoginText.Text.Equals(&quot;aladdin&quot;) &&    PasswordText.Text.Equals(&quot;sesam&quot;))) {   MessageLabel.Text = &quot; Wrong name or password!&quot;; } else {   Session[&quot;user&quot;] = &quot;aladdin&quot;;   Response.Redirect(&quot;UserArea.aspx&quot;); } } } }
Java Server Pages and Servlets ,[object Object],[object Object],Web Server Client (1) get a.jsp (2) process JVM JSP Other Components Database (4) result (5) HTTP file Servlet (3) gen. Servlet Servlet Impl.
Java Example
Java Example ,[object Object],// Datei MyPerson.java package MyPackage; import java.lang.*; public class MyPerson { public String getFirstName() { return &quot;Michael&quot;; } public String getLastName() { return &quot;Stal&quot;; } } // Datei MyTest.jsp: <HTML> <BODY> <jsp:useBean id=&quot;person&quot; scope=&quot;session&quot; class=&quot;MyPackage.MyPerson&quot;/> Your name is: <br> <jsp:getProperty name=&quot;person&quot; property=&quot;firstName&quot;/> <br> <jsp:getProperty name=&quot;person&quot; property=&quot;lastName&quot;/> </BODY> </HTML>
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Web Services in .NET ,[object Object],namespace WebService1 { public class Service1 : System.Web.Services.WebService { // lot of stuff omitted [WebMethod] public double DM_to_Euro(double value) {  return value / 1.95583; } [WebMethod] public double Euro_to_DM(double value) { return  value * 1.95583; } } }
Web Services in .NET (forts.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],localhost.Service1 s1 = new localhost.Service1(); double result = s1.Euro_to_DM(200);
Web Services in Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Commonalities and Differences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
More Enterprise APIs
Enterprise APIs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Legacy-Integration ,[object Object],[object Object],[object Object]
Interoperability ,[object Object],[object Object],class PInvokeTest { [DllImport(&quot;user32.dll&quot;)] static extern int MessageBoxA(int hWnd, string m, string c, int t);  static void Main(string[] args) { MessageBoxA(0, &quot;Hello DLL&quot;, &quot;My Window&quot;, 0); } }
Interoperability cont‘d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Mobile and Embedded
Profiles and devices ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Profiles and devices cont‘d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Profiles and devices cont‘d ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Selecting one of the two
.NET and/or Java ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
.NET and/or Java ? ,[object Object],[object Object],[object Object],#pragma once using namespace System; // .NET mit C++ namespace CPPBase { public __gc class CPPBaseClass { public: virtual System::String __gc* Echo(System::String __gc *s); }; } System::String __gc * CPPBase::CPPBaseClass::Echo(System::String __gc *s) { return  s; }
.NET and/or Java ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Management Summary - 1 Currently not yet completely integrated Consistent XML-Support JSP/Servlets ASP.NET Server Pages Enterprise JavaBeans COM+ Server Components RMI/CORBA, JMS, Web Services (standard compliant) .NET Remoting, MSMQ, Web Services (no ebXML) Communication middleware (RPC, Messaging, Web) Java  + possibly others C#, C++, Eiffel#, VB, .... Languages Specification and many implementations Product Line Status Sun + JCP-Partner Microsoft Controller/Owner Java .NET
Management Summary - 2 CORBA, JMS COM/COM+ (COM Interop) InteropMiddleware JCA Host Integration Server Legacy Integration Swing/AWT Windows.Forms Web.Forms GUI-Libs Java JVM .NET CLR Runtime  JNI PInvoke Interop (call-in/call-out) Many many classes on java.* Many many classes on System.* Base libraries JDBC / SQLJ and others ADO.NET (ADO) Database access Java .NET
The End Thank you very much!!

Contenu connexe

Tendances

Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
CIB Egypt
 
Java session01
Java session01Java session01
Java session01
Niit Care
 

Tendances (20)

Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)Training on java niit (sahil gupta 9068557926)
Training on java niit (sahil gupta 9068557926)
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
 
Learn Java Part 1
Learn Java Part 1Learn Java Part 1
Learn Java Part 1
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 
Java lab lecture 1
Java  lab  lecture 1Java  lab  lecture 1
Java lab lecture 1
 
Java lab zero lecture
Java  lab  zero lectureJava  lab  zero lecture
Java lab zero lecture
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Visual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 OverviewVisual Studio 2010 and .NET Framework 4.0 Overview
Visual Studio 2010 and .NET Framework 4.0 Overview
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platforms
 
.Net slid
.Net slid.Net slid
.Net slid
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
What is-java
What is-javaWhat is-java
What is-java
 
Java essential notes
Java essential notesJava essential notes
Java essential notes
 
Java session01
Java session01Java session01
Java session01
 
Java Tutorial to Learn Java Programming
Java Tutorial to Learn Java ProgrammingJava Tutorial to Learn Java Programming
Java Tutorial to Learn Java Programming
 
Java ms harsha
Java ms harshaJava ms harsha
Java ms harsha
 
Programming in Java
Programming in JavaProgramming in Java
Programming in Java
 

En vedette

A Portable Approach for Bidirectional Integration between a Logic and a Stati...
A Portable Approach for Bidirectional Integration between a Logic and a Stati...A Portable Approach for Bidirectional Integration between a Logic and a Stati...
A Portable Approach for Bidirectional Integration between a Logic and a Stati...
Sergio Castro
 
Java Serialization
Java SerializationJava Serialization
Java Serialization
imypraz
 
Java Reflection Explained Simply
Java Reflection Explained SimplyJava Reflection Explained Simply
Java Reflection Explained Simply
Ciaran McHale
 
Reflection in java
Reflection in javaReflection in java
Reflection in java
upen.rockin
 

En vedette (20)

J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
 
Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?Java v/s .NET - Which is Better?
Java v/s .NET - Which is Better?
 
Java vs .Net
Java vs .NetJava vs .Net
Java vs .Net
 
Java j2ee
Java j2eeJava j2ee
Java j2ee
 
Soa chapter 5
Soa chapter 5Soa chapter 5
Soa chapter 5
 
A Portable Approach for Bidirectional Integration between a Logic and a Stati...
A Portable Approach for Bidirectional Integration between a Logic and a Stati...A Portable Approach for Bidirectional Integration between a Logic and a Stati...
A Portable Approach for Bidirectional Integration between a Logic and a Stati...
 
2 ModéLe Mvc
2 ModéLe Mvc2 ModéLe Mvc
2 ModéLe Mvc
 
Tp java ee.pptx
Tp java ee.pptxTp java ee.pptx
Tp java ee.pptx
 
Tutoriel J2EE
Tutoriel J2EETutoriel J2EE
Tutoriel J2EE
 
Java beans
Java beansJava beans
Java beans
 
Reflection and Introspection
Reflection and IntrospectionReflection and Introspection
Reflection and Introspection
 
Java Serialization
Java SerializationJava Serialization
Java Serialization
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
javabeans
javabeansjavabeans
javabeans
 
Java Reflection Explained Simply
Java Reflection Explained SimplyJava Reflection Explained Simply
Java Reflection Explained Simply
 
Java Beans
Java BeansJava Beans
Java Beans
 
Reflection in java
Reflection in javaReflection in java
Reflection in java
 
Thin client
Thin clientThin client
Thin client
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Javabeans
JavabeansJavabeans
Javabeans
 

Similaire à .NET Vs J2EE

Fundamentals of oop lecture 2
Fundamentals of oop lecture 2Fundamentals of oop lecture 2
Fundamentals of oop lecture 2
miiro30
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 

Similaire à .NET Vs J2EE (20)

J2EEvs.NET
J2EEvs.NETJ2EEvs.NET
J2EEvs.NET
 
Short intro to scala and the play framework
Short intro to scala and the play frameworkShort intro to scala and the play framework
Short intro to scala and the play framework
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Introduction to Visual Studio.NET
Introduction to Visual Studio.NETIntroduction to Visual Studio.NET
Introduction to Visual Studio.NET
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
basic_java.ppt
basic_java.pptbasic_java.ppt
basic_java.ppt
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Introduction to clojure
Introduction to clojureIntroduction to clojure
Introduction to clojure
 
EnScript Workshop
EnScript WorkshopEnScript Workshop
EnScript Workshop
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
Fundamentals of oop lecture 2
Fundamentals of oop lecture 2Fundamentals of oop lecture 2
Fundamentals of oop lecture 2
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
 
Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)Building nTier Applications with Entity Framework Services (Part 1)
Building nTier Applications with Entity Framework Services (Part 1)
 
Getting started with Clojure
Getting started with ClojureGetting started with Clojure
Getting started with Clojure
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
C#ppt
C#pptC#ppt
C#ppt
 
Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009Scala Talk at FOSDEM 2009
Scala Talk at FOSDEM 2009
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

.NET Vs J2EE

  • 1. Comparing J2EE with .NET - ACCU 2002 - Slides (mostly  ) by Michael Stal, Senior Principal Engineer SIEMENS AG, Dept. CT SE 2 E-Mail: mailto:Michael.Stal@mchp.siemens.de Web: http:// www.stal.de Markus Voelter, CTO, MATHEMA AG [email_address] http://www.voelter.de
  • 2.
  • 3.
  • 4. Web Frameworks Workflow Engine Web-based and -related Protocols (HTTP, SMTP, ...) Service Description, Discovery, Integration (UDDI) Service Description (WSDL) Service Context (Who, Where, When, Why, ....) Virtual Machine Micro/Macro Services Integration Layer Legacy Backend Server Mainframe Frontend Layer (Web Server) Web Service User/Provider Core Services (Calendar, Preferences, Transactions, ...) Core elements of Web Frameworks Clients
  • 5. .NET – The Microsoft Way of Life .NET Devices TabletPC, PocketPC, .... .NET Servers SQL Server, Biztalk, Commerce, Exchange, Mobile Information, Host Integration, Application Center .NET Foundation Services (Hailstorm) Passport, Calendar, Directory & Search, Notification & Messaging, Personalization, Web-Store/XML, Dynamic Delivery of Software and Services Common Language Runtime (Memory Management, Common Type System, Lifecycle Monitor) .NET Framework & Tools Base Classes (ADO.NET, XML, Threading, IO, ....) ASP.NET (Web Services, Web Forms, ASP.NET Application Services) Windows Forms (Controls, Drawing, Windows Application Services)
  • 6. Sun ONE (Open Net Environment) Service Interface Service Container (J2EE, EJB, JSP, J2SE, J2ME, MIDP, Java Card) Process Management Service Integration (SQL, JDBC, XML, XSLT, XP, JMS, RMI, J2EE Connectors, ...) Service Platform Smart Management (SNMP, CIM, WBEM, JMX) Smart Delivery (XML, HTML, XHTML, WML, VoiceXML, XSLT, HTTP, SSL, XP, SOAP, WSDL, UDDI, ebXML, ...) Web Services Smart Process (ebXML, XAML) Smart Policy (LDAP, Kerberos, PKI, OASIS Security)) Service Creation and Assembly (JB, JSP, EJB)
  • 8.
  • 9.
  • 11.
  • 12.
  • 13.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37. Important Base Classes No big conceptual differences here. Java.net: Sockets, URL, ... System.Net: Connection, HttpWebRequest, ... Kommunikation java.util: Lists, Maps, Sets, Trees, Vectors System.Collections: ArrayList, BitArray, Maps, Queue, List, Stack Container SWING, AWT Windows.Forms Web.Forms GUI Java .NET
  • 39.
  • 40.
  • 41.
  • 43.
  • 44.
  • 45.
  • 46.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54. .NET-Beispiel using System; using System.Data; using System.Data.SqlClient; string myConnection = “ server=myserver;uid=sa;pw d=;database=StockTickerDB”; string myCommand = “SELECT * from StockTable”; SqlDataSetCommand datasetCommand = new SqlDataSetCommand(myCommand, myConnection); DataSet myDataSet = new DataSet(); datasetCommand.FillDataSet(myDataSet, “StockTable”); DataTable myTable =ds.Tables[“StockTable”]; foreach (DataRow row in myTable.Rows) { Console.WriteLine(“Value of {0} is {1}”, row[“LongName”], row[“Value”]); }
  • 55.
  • 56.
  • 57. Java Example import java.sql.*; // without error handling: Class.forName(„sun.jdbc.odbc.JdbcOdbcDriver“); Connection con=DriverManager.getConnection(„jdbc:odbc:stocks,““,““); Statement stmt = con.CreateStatement(); ResultSet rs = stmt.executeQuery(„SELECT * from stocks“); while (rs.next()) { System.out.println(rs.getString(„COMPANYNAME“)); } rs.close(); stmt.close(); con.close();
  • 58.
  • 59.
  • 60. XML
  • 61.
  • 62.
  • 63.
  • 64.
  • 65. Remoting in .NET Application Domain B Client Formatters Channels Envoy Sinks Real Proxy Transparent Proxy Servant Formatters Channels Server Context Sinks Object Context Sinks Network Application Domain A
  • 66.
  • 67.
  • 68.
  • 69.
  • 70. Web
  • 71.
  • 72.
  • 73. ASP.NET Example (cont‘d) <%@ Page language=&quot;c#&quot; Codebehind=&quot;WebForm1.aspx.cs&quot; AutoEventWireup=&quot;false&quot; Inherits=&quot;LoginPage.WebForm1&quot; %> <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; > <HTML> <body> <form id=&quot;Form1&quot; method=&quot;post&quot; runat=&quot;server&quot;> <asp:Label id=&quot;TitleLabel&quot; runat=&quot;server&quot;>Please specify your name and password</asp:Label> <br> <asp:Label id=&quot;LoginLabel&quot; runat=&quot;server&quot;>Login</asp:Label> <br> <asp:TextBox id=&quot;LoginText&quot; runat=&quot;server&quot;></asp:TextBox> <asp:RequiredFieldValidator id=&quot;RequiredFieldValidator&quot; runat=&quot;server&quot; ErrorMessage=&quot;You need to specify your name&quot; ControlToValidate=&quot;LoginText&quot;></asp:RequiredFieldValidator> <br> <asp:Label id=&quot;PasswordLabel&quot; runat=&quot;server&quot;>Password</asp:Label> <br> <asp:TextBox id=&quot;PasswordText&quot; runat=&quot;server&quot; TextMode=&quot;Password&quot;></asp:TextBox> <br> <asp:Button id=&quot;EnterButton&quot; runat=&quot;server&quot; Text=&quot;Open the entrance&quot; ToolTip=&quot;Press this after you have specified login and password&quot;></asp:Button> <br> <asp:Label id=&quot;MessageText&quot; runat=&quot;server&quot;></asp:Label> </form> </body> </HTML>
  • 74. ASP.NET Example (cont‘d) // lot of details omitted namespace LoginPage { public class WebForm1 : System.Web.UI.Page { protected TextBox PasswordText, LoginText; protected Button EnterButton; protected Label MessageLabel; private void InitializeComponent() { this.EnterButton.Click += new System.EventHandler(this.EnterButton_Click); this.Load += new System.EventHandler(this.Page_Load); } private void EnterButton_Click(object sender, System.EventArgs e) { if (!(LoginText.Text.Equals(&quot;aladdin&quot;) && PasswordText.Text.Equals(&quot;sesam&quot;))) { MessageLabel.Text = &quot; Wrong name or password!&quot;; } else { Session[&quot;user&quot;] = &quot;aladdin&quot;; Response.Redirect(&quot;UserArea.aspx&quot;); } } } }
  • 75.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 84.
  • 85.
  • 86.
  • 87.
  • 89.
  • 90.
  • 91.
  • 92. Selecting one of the two
  • 93.
  • 94.
  • 95.
  • 96. Management Summary - 1 Currently not yet completely integrated Consistent XML-Support JSP/Servlets ASP.NET Server Pages Enterprise JavaBeans COM+ Server Components RMI/CORBA, JMS, Web Services (standard compliant) .NET Remoting, MSMQ, Web Services (no ebXML) Communication middleware (RPC, Messaging, Web) Java + possibly others C#, C++, Eiffel#, VB, .... Languages Specification and many implementations Product Line Status Sun + JCP-Partner Microsoft Controller/Owner Java .NET
  • 97. Management Summary - 2 CORBA, JMS COM/COM+ (COM Interop) InteropMiddleware JCA Host Integration Server Legacy Integration Swing/AWT Windows.Forms Web.Forms GUI-Libs Java JVM .NET CLR Runtime JNI PInvoke Interop (call-in/call-out) Many many classes on java.* Many many classes on System.* Base libraries JDBC / SQLJ and others ADO.NET (ADO) Database access Java .NET
  • 98. The End Thank you very much!!