Java versus .Net.


36 views
Uploaded on:
Description
Java vs. .Net. Bent Thomsen bt@cs.auc.dk Department of Computer Science Aalborg University. A typical .NET Enterprise Solution. IIS on W2k Server. SQL Server. Browser. .NET managed component. ASP .NET. Windows Client. A typical J2EE Enterprise Solution. Java App Server. DB
Transcripts
Slide 1

Java versus .Net Bent Thomsen bt@cs.auc.dk Department of Computer Science Aalborg University

Slide 2

A run of the mill .NET Enterprise Solution IIS on W2k Server SQL Server Browser .NET oversaw segment ASP .NET Windows Client

Slide 3

A common J2EE Enterprise Solution Java App Server DB Server Browser Servlet JSP EJB Java Client

Slide 4

Java versus .Net Solutions Both multi-layered, comparative registering advances Both support "principles" Both offer diverse devices & approaches to accomplish a similar objective. A great deal of parallelism can be seen. Exceptionally hard to think about and qualify the correlation on the grounds that each has its own particular points of interest & detriments.

Slide 5

The TMC Petshop Performance Case Study Java Pet Store is Sun\'s essential outline application for J2EE Source: http://java.sun.com/j2ee/plans Illustrates best coding rehearses for J2EE Ships as a specimen application in IBM Websphere, Oracle Application Server 9i, Sun iPlanet, and BEA WebLogic The .NET Petshop is a port of the J2EE Java Pet Store to .NET Source: http://www.gotdotnet.com/think about Implements an indistinguishable usefulness from Java Pet Store Illustrates best coding hones for .NET Framework In the TMC Petshop Performance Case Study, The Middleware Company executed both the Java Pet Store and the .Net Petshop. The J2EE rendition kept running on two distinctive application servers All forms utilized a similar equipment and OS

Slide 6

Java Pet Store Components The Storefront exhibits the fundamental UI in a Web front-end. Clients utilize the Storefront to place orders for pets. The Order Processing Center (OPC) gets orders from the Storefront. The Supplier satisfies orders from the OPC from stock and solicitations the OPC. The Admin presents the director interface in a JFC/Swing front-end. Heads utilize the Admin to look at pending requests and affirm or deny them.

Slide 7

Java Pet Store versus .Net Pet Shop

Slide 8

Porting Java Pet Store to .NET 15500 Lines of Code Required 14,273 14000 .NET Petshop 11500 Java Pet Store 9000 7500 5,891 5,404 4,410 5000 2,865 2,566 2500 710 761 412 74 Total Lines of Code User Interface Middle Tier Data Tier Configuration

Slide 9

TMC Pages every Second

Slide 10

TMC Max Supported Users

Slide 11

How Microsoft translates the information Based on Oracle-distributed information for tuned form of Java Pet Store Using Oracle\'s test scripts from their "9i App Server Challenge" Run on equal equipment Supporting 6 times more clients 1.0 0.8 0.6 2800% Better execution Response Time (Seconds) 0.4 0.2 0 500 1000 1500 2000 2500 2750 User Load Level

Slide 12

The "Conclusions" Microsoft finishes up: ".NET is 28 times quicker than J2EE" Because: "Java PetShop" is Sun\'s "best practice" illustration Numbers contrasted and distributed Oracle comes about Identical usefulness, all code distributed and archived Can we trust the crude numbers? Yes! Why? Microsoft conveys full docs on the whole situation But 28 times truly?

Slide 13

The Shootout a while later Java PetShop: J2EE plan application Built by Sun to indicate "best practice" outline Implementation by TMC missed many advancements .NET PetShop Built by TMC (with assistance from MS) with various plan Plain classes rather than compartment oversaw segments Middle level moved into ASP.NET Using put away strategies rather than specially appointed SQL Uses server-side storing of ASP.NET Many execution improvements connected Most Java lovers discover this exceptionally unjustifiable

Slide 14

TMC returns to the Pet Shop Re-usage of J2EE rendition 17 times execution increment Second form demonstrated some J2EE usage square with .Net Second form is a declaration to execution tuning

Slide 15

What does the examination let us know? It is exceptionally hard to make such correlations That .Net has picked up development greatly quick That the two structures are fundamentally the same as The Devil is in the detail So how about we take a gander at a few points of interest

Slide 16

Comparing the stacks VB C++ C# Perl Python … Eclipse Webshpere Studio Win32 MSMQ, COM+, IIS, WMI, AD, ADAM, Indexing, UDDI, and so forth. BEA Weblogic Enterprise arrangements Third gathering augmentations Extensions : Phoenix, Tiles, Java Faces P&P pieces Struts ASP.Net JSP Servlets Visual Studio.net Java JDBC ADO.NET J2EE Class Library Base Class Library Java runtime CLR J2EE App Servers Websphere, Weblogic, Tomcat, and so on. JMS Apache Win32, Unix, Linux

Slide 17

Java versus C# is a protest arranged dialect of the C++/Java enhance Syntax like Java and C/C++. A significant great plan and watch over points of interest Java engineers will feel good more often than not and baffled when things are distinctive MS says: "C# consolidates the force of VC++ without breaking a sweat of utilization of VB" Not generally genuine: C# is truly effective BUT It is difficult to learn for non C++/Java software engineers It is the dialect to learn on the off chance that you are not kidding about .NET!

Slide 18

Java versus C#/This is a remark in Java code class HelloWorld{ open static void main(String[] args){ for(int i= 1; i<= 100; i++) System.out.println("Hello!");   }/This is a remark in C# utilizing System; class HelloWorld{ static void Main(){ for(int i=1; i<=100; i++)      Console.WriteLine("Hello");   }

Slide 19

Primitives Java int, coast, twofold, and so on. Assigned on stack Not an Object Not extensible C# int, glide, twofold, and so on structs Allocated on stack Inherited from protest class structs can actualize interfaces Cannot acquire from another class/C# struct Point { int x; int y; Point(int x, int y) { this.x = x; this.y = y; } }

Slide 20

Classes – Overriding Methods Java All techniques are certainly virtual C# Explicitly utilize "virtual" and "abrogate" watchwords class B { open void foo() { } class D amplifies B { open void foo() { }/D\'s foo() supersedes B\'s foo() class B { open virtual void foo() { } class D:B { open abrogate void foo() { }/D\'s foo() abrogates B\'s foo()

Slide 21

Exceptions Java C++-style attempt/get squares finally– activity done even after an exemption is gotten tosses – strategies distinguish what special cases they toss C# C++-style attempt/get pieces at last – same as Java Does not bolster tosses statement/Java and C# attempt { //Stuff… } get { //Ack! } at last { //Always! }/Java – tosses an IOException open void myFunc(int a) tosses IOException { //Work… }

Slide 22

Java versus C#

Slide 23

Java versus C# versus C++ versus VB

Slide 24

Java versus C# in High-execution calculations

Slide 25

C# Features not in Java No programmed fall-through starting with one case piece then onto the next Strongly-wrote enums By reference calls are unequivocal at guest AND callee Method abrogates are express Supports forming Structs (esteem sorts) Integrated support for properties and occasions Can at present utilize pointers with RAD dialect Can impart information and utilize usefulness to segments written in various dialects

Slide 26

CLR versus JVM C# VB .Net Managed C/C++ Lots of different Languages Java MSIL Byte Codes CLR CTS GC Security Runtime Services JRE (JVM) GC Security Runtime Services Windows OS Mac Win Unix Linux Both are \'center layers\' between a middle of the road dialect & the basic OS

Slide 27

.Net on different stages ECMA institutionalization ECMA 334 and 335 The Mono Project Shared Source Common Language Runtime CLI, C# and Jscript FreeBSD and Windows usage Linux port in progress DOT GNU extend Portable .Net usage C# for both CIL and JVM

Slide 28

JVM versus CLR JVM intended for stage autonomy Single dialect: Java (?) A different JVM for every OS & gadget CLR intended for dialect freedom Multiple dialects for advancement C++, VB, C#, (J#) APL, COBOL, Eiffel, Forth, Fortran, Haskel, SML, Mercury, Mondrian, Oberon, Pascal, Perl, Python, RPG, Scheme, SmallScript, … Impressive use of formal strategies and programming dialect investigate amid improvement Impressive expansions for generics and support for utilitarian dialects in progress Underlying OS: Windows (?)

Slide 29

Java Byte Code and MSIL Java byte code (or JVML) is the low-level dialect of the JVM. MSIL (or CIL or IL) is the low-level dialect of the .NET Common Language Runtime (CLR). Externally, the two dialects look fundamentally the same as. One contrast is that MSIL is outlined just for JIT aggregation. The non specific include guideline would require a mediator to track the information kind of the highest point of stack component, which would be restrictively costly. MSIL: ldloc.1 ldloc.2 add stloc.3 JVML: iload 1 iload 2 iadd istore 3

Slide 30

JVM versus CLR initially

Slide 31

J2EE 1.5 J2EE (1.5) see of 26.4.2004 Focus on simplicity of improvement Generics and metadata as in J2SE 1.5 (more like C#) Java Studio Creator apparatus (in beta from April 2004) (more like Visual Studio .Net) Timeframe To be examined at JavaOne in June Finalized in around one year IBM push for genuinely open source Java Others dither (even Open Source JBoss)

Slide 32

What about portable? Web Services are fine as n-level applications with UI gave through program, yet … On cell phones WAP hasn\'t generally got on Even iMode hasn\'t got on in Europe Renewed Thin/Thick customer dialog Java applications on Mobile gadgets are sensibly effective Now Microsoft is moving quick into the field with .Net Compact Framework

Slide 33

Two Devices Nokia 6600 Orange SPV E200

Slide 34

Two Devices

Slide 35

Building Mobile Solutions is harder Mobile gadget Software foundation, equipment necessities Communication innovation On-/Offline situation Wireless Wide Area Networks/Wireless Local Area Networks Communication convention Application design situation Thin/fat customer Data administration Synchronization On-/disconnected capacities Security issues Dangers for cell phones Threats of correspondence detective

Recommended
View more...