J2EEvs.NET

888 views
837 views

Published on

This presentation gives an idea about comparison of two different software platforms.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
888
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
40
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

J2EEvs.NET

  1. 1. J2EE vs .NET Presentation by(  ): Saloni Tyagi E-Mail: saloni_tyagi2007@yahoo.com
  2. 2. Agenda <ul><li>Platform and Profile </li></ul><ul><li>Comparison </li></ul><ul><ul><li>Layer-by-Layer comparison of the infrastructures </li></ul></ul><ul><li>Summary </li></ul>
  3. 3. Platform and Profile <ul><li>There are the following variants of Java </li></ul><ul><ul><li>JavaCard </li></ul></ul><ul><ul><li>J2ME (Java 2 Platform Micro Edition) </li></ul></ul><ul><ul><li>J2SE (Java 2 Platform Standard Edition) </li></ul></ul><ul><ul><li>J2EE (Java 2 Platform Enterprise Edition) </li></ul></ul>
  4. 4. .NET framework <ul><li>. NET Universe </li></ul><ul><ul><li>.NET framework for Standard </li></ul></ul><ul><li>and enterprise </li></ul><ul><ul><li>.NET Compact framework </li></ul></ul><ul><li>Consistent Programming model </li></ul><ul><li>Cross platform support </li></ul><ul><li>Language interoprability </li></ul><ul><li>Automatic management of </li></ul><ul><li>resources </li></ul><ul><li>Ease of deployment </li></ul>
  5. 5. 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) WINDOWS WORKFLOW (WWF) WINDOWS CARDSPACE LINQ ASP.NET 3.5 ADO.NET ADDITIONAL ENHANCEMENTS.. . NET 3.0 . NET 3.5 Visual Studio.NET .NET framework 2.0 and SP1
  6. 6. Layer-By-Layer Comparison
  7. 7. The Runtime System
  8. 8. Java Virtual Machine <ul><li>The JVM is intended for Java and interprets Java Byte Code. </li></ul><ul><li>Just-in-Time compilers exist for different environments and OSs </li></ul>Java Compiler CLASS- Files Classloader/ Verifier JIT Native Code Interpreter Garbage Collection, Security Manager‘ Multithreading, ...
  9. 9. .NET Runtime <ul><li>Common Language Runtime (CLR) </li></ul><ul><li>It is intended for any language compiled to the MSIL </li></ul><ul><li>Provides integration for several languages </li></ul>C# VB.NET C++ Perl Compiler MSIL + Metadata Loader/ Verifier JIT Managed Code Execution Garbage Collection, Security, Multithreading, ...
  10. 10. Commonalities and Differences <ul><li>Commonalities: </li></ul><ul><ul><li>Basic concepts are similar </li></ul></ul><ul><li>Differences: </li></ul><ul><ul><li>Java is intended for interpretation </li></ul></ul><ul><ul><li>Java allows for custom class loaders and security managers </li></ul></ul><ul><ul><li>.NET CLR provides a command set that also supports functional languages </li></ul></ul>
  11. 11. The Object Model
  12. 12. Object Model (Java) <ul><li>Java has primitive types and classes. </li></ul><ul><ul><li>No automatic boxing/ unboxing </li></ul></ul>Types Primitive Types Reference Types Interfaces Arrays Classes
  13. 13. java.lang.Object <ul><li>The “Mother of all Java classes“ </li></ul>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; }
  14. 14. Object Model (.NET) <ul><li>In .NET, everything is an object </li></ul>Types Value Types Reference Types System Value Types User Value Types Enumerations Interfaces Pointers Self-describing Types Arrays Classes Delegates Boxed Values User-Defined
  15. 15. System.Object <ul><li>The “mother of all .NET classes“ </li></ul>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()´; }
  16. 16. Important Base Classes No big conceptual differences here. Java.net: Sockets, URL, ... System.Net: Connection, HttpWebRequest, ... Communication 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
  17. 17. Multithreading in .NET and Java <ul><li>.NET: </li></ul><ul><ul><li>.NET uses delegates for multithreading </li></ul></ul><ul><ul><li>There are monitors for synchronization </li></ul></ul><ul><li>Java : </li></ul><ul><ul><li>In java there is a class „Thread“ </li></ul></ul><ul><ul><li>For synchronization there is synchronized keyword </li></ul></ul>
  18. 18. Deployment
  19. 19. Java JAR files <ul><li>.jar files are similar to .NET‘s assemblies </li></ul><ul><ul><li>They can be shared or private </li></ul></ul><ul><ul><li>They can be signed </li></ul></ul><ul><li>They contain </li></ul><ul><ul><li>types </li></ul></ul><ul><ul><li>resources </li></ul></ul><ul><ul><li>metadata in manifest file </li></ul></ul>
  20. 20. Assemblies in .NET <ul><li>Types: </li></ul><ul><li>Shared Assemblies </li></ul><ul><ul><li>They are signed by a key </li></ul></ul><ul><ul><li>They are versioned!! </li></ul></ul><ul><li>Private Assemblies </li></ul><ul><ul><li>private to client </li></ul></ul><ul><ul><li>Avoid version problems . </li></ul></ul>Menifest Resources metadata TYPE1 IL CODE TYPE2 IL CODE TYPE3 IL CODE
  21. 21. Commonalities and Differences <ul><li>Commonalities: </li></ul><ul><ul><li>Assemblies and JAR files provide “deployment“ components </li></ul></ul><ul><li>Differences: </li></ul><ul><ul><li>Much better versioning support in .NET (side-by-side execution) </li></ul></ul>
  22. 22. Database Access in Java <ul><li>Java provides JDBC to access relational data </li></ul>ODBC DB ODBC Driver JDBC/ ODBC Bridge Driver Manager Connection Statement Prepared Statement Callable Statement Resultset Application
  23. 23. Database Access in .NET <ul><li>In .NET there is ADO.NET </li></ul><ul><ul><li>“ connectionless” </li></ul></ul>Data Source DataSetCommand Command Connection DataReader DataSet Client Managed Provider
  24. 24. ADO.NET <ul><li>ADO.NET provides way to acess </li></ul><ul><ul><li>XML data </li></ul></ul><ul><ul><li>Relational and application data </li></ul></ul><ul><li>ADO.NET architecture </li></ul><ul><ul><li>Disconnected </li></ul></ul>
  25. 25. Commonalities and Differences <ul><li>Commonalities: </li></ul><ul><ul><li>Decoupling of the concrete data model and the user </li></ul></ul><ul><li>Differences: </li></ul><ul><ul><li>JDBC has a more relational flavor,ADO.NET uses XML </li></ul></ul><ul><ul><li>JDBC is connection oriented, ADO.NET always works non-connected, or offline </li></ul></ul><ul><ul><li>.NET DataSets are a kind of In-Memory-Database-Cache. </li></ul></ul>
  26. 26. Web
  27. 27. Java Server Pages and Servlets <ul><li>Java also allows for server-side scripting </li></ul><ul><ul><li>JSPs are based on Servlets </li></ul></ul>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.
  28. 28. ASP.NET (Server-Side Scripting) <ul><li>ASP.NET Architecture: </li></ul>IIS 5 Web Server Client (1) get a.apx (2) process .NET Engine .NET Assembly Other Assemblies Database (3) result (4) HTTP file
  29. 29. Login Example JAVA LOGIN .NET LOGIN
  30. 30. .NET and/or Java ? <ul><li>.NET is a product, Java and J2EE is a specification </li></ul><ul><li>Java should be used for: </li></ul><ul><li>real big systems </li></ul><ul><li>Platform independence </li></ul><ul><li>More scalability </li></ul><ul><li>.NET should be used for: </li></ul><ul><li>Window application and GUI </li></ul><ul><li>Language indepedence </li></ul>
  31. 31. Questions? <ul><li>….. </li></ul>
  32. 32. The End Thank you !!

×