SlideShare ist ein Scribd-Unternehmen logo
1 von 54
1
2
SQL
Server
IIS on W2k Server
.NET
managed
component
ASP
.NET
Windows
Client
Browser
3
DB
Server
Java App
Server
EJB
Servlet
JSP
Java
Client
Browser
◦ Both multi-tiered, similar computing
technologies
◦ Both support “standards”
◦ Both offer different tools & ways to achieve
the same goal.
◦ A lot of parallelism can be seen.
◦ Very difficult to compare and qualify the
comparison because each has its own
advantages & disadvantages.
4
 Java Pet Store is Sun‟s primary blueprint application
for J2EE
◦ Source: http://java.sun.com/j2ee/blueprints
◦ Illustrates best coding practices for J2EE
◦ Ships as a sample 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/compare
◦ Implements the same functionality as Java Pet Store
◦ Illustrates best coding practices for .NET Framework
 In the TMC Petshop Performance Case Study, The
Middleware Company implemented both the Java Pet
Store and the .Net Petshop.
◦ The J2EE version ran on two different application servers
◦ All versions used the same hardware and OS
5
◦ The Storefront presents the main user
interface in a Web front-end. Customers
use the Storefront to place orders for pets.
◦ The Order Processing Center (OPC)
receives orders from the Storefront.
◦ The Supplier fulfills orders from the OPC
from inventory and invoices the OPC.
◦ The Admin presents the administrator
interface in a JFC/Swing front-end.
Administrators use the Admin to examine
pending orders and approve or deny
them.
6
7
8
14000
7500
9000
5000
2500
15500
11500
Java Pet Store
Lines of Code Required
User
Interface
4,410
Data TierMiddle Tier
2,865
.NET Petshop
14,273
5,891
ConfigurationTotal Lines
of Code
710
5,404
761 412 74
2,566
9
10
◦ Based on Oracle-published data for tuned version of Java Pet
Store
◦ Using Oracle‟s test scripts from their “9i App Server Challenge”
◦ Run on equivalent hardware
11
1.0
0
0
User Load Level
ResponseTime(Seconds)
500 1000 1500 2000 2500 2750
0.6
0.4
0.2
0.8
2800% Better performance
Supporting 6 times more users
 Microsoft concludes: ".NET is 28 times faster
than J2EE"
◦ Because:
◦ “Java PetShop” is Sun‟s “best practice” example
◦ Numbers compared with published Oracle results
◦ Identical functionality, all code published and
documented
 Can we believe the raw numbers? Yes!
◦ Why? Microsoft delivers full docs on the entire scenario
 But 28 times really?
12
 Java PetShop: J2EE blueprint application
◦ Built by Sun to show "best practice" design
◦ Implementation by TMC missed quite a few
optimizations
 .NET PetShop
◦ Built by TMC (with help from MS) with different
design
 Plain classes instead of container managed
components
 Middle tier moved into ASP.NET
 Using stored procedures instead of ad-hoc SQL
 Uses server-side caching of ASP.NET
 Many performance optimizations applied
 Most Java devotees find this highly unfair 13
 Re-implementation of J2EE version
◦ 17 times performance increase
◦ Second version showed some J2EE implementation
equal .Net
◦ Second version is a testimony to performance
tuning
14
 It is very difficult to make such comparisons
 That .Net has gained maturity extremely fast
 That the two frameworks are very similar
 The Devil is in the detail
15
So let‟s look at some details
16
VBC++C#PerlPython…
VisualStudio.net
Win32
MSMQ, COM+, IIS,
WMI, AD, ADAM,
Indexing, UDDI, etc.
CLR
Base Class Library
ADO.NET
ASP.Net
P&P blocks
Win32, Unix, Linux
JMS Apache
J2EE App Servers
Websphere, Weblogic, Tomcat, etc.
Java runtime
J2EE Class Library
Third party extensions
JDBC
Servlets
JSP
Struts
Extensions:
Phoenix, Tiles, Java Faces
Enterprise solutions
BEAWeblogicWebshpereStudioEclipse…
Java
◦ C# is an object oriented language of the C++/Java
flavor
◦ Syntax similar to Java and C/C++.
◦ Quite an impressive design and care for details
◦ Java developers will feel comfortable
 most of the time and frustrated when things are
different
◦ MS says: “C# combines the power of VC++ with the
ease of usage of VB”
 Not really true:
 C# is really powerful BUT
 It is not easy to learn for non C++/Java programmers
◦ It is the language to learn if you are serious about
.NET!
17
// This is a comment in Java code
class HelloWorld{
public static void main(String[] args){
for(int i= 1; i<= 100; i++)
System.out.println("Hello!");
}
}
// This is a comment in C#
using System;
class HelloWorld{
static void Main(){
for(int i=1; i<=100; i++)
Console.WriteLine("Hello");
}
}
}
18
 Java
◦ int, float, double, etc.
◦ Allocated on stack
◦ Not an Object
◦ Not extensible
 C#
◦ int, float, double, etc.
◦ structs
◦ Allocated on stack
◦ Inherited from object
class
◦ structs can implement
interfaces
◦ Cannot inherit from
another class
19
// C#
struct Point
{
int x;
int y;
Point(int x, int y)
{
this.x = x;
this.y = y;
}
}
 Java
◦ All methods are implicitly
virtual
 C#
◦ Explicitly use „virtual‟ and
„override‟ keywords
20
class B
{
public void foo() { }
}
class D extends B
{
public void foo() { }
}
// D’s foo() overrides B’s foo()
class B
{
public virtual void foo() { }
}
class D:B
{
public override void foo() { }
}
// D’s foo() overrides B’s foo()
 Java
◦ C++-style try/catch
blocks
◦ finally– action done even
after an exception is
caught
◦ throws – methods identify
what exceptions they
throw
 C#
◦ C++-style try/catch
blocks
◦ finally – same as Java
◦ Does not support throws
clause
21
// Java – throws an IOException
public void myFunc(int a) throws IOException
{
// Work…
}
// Java and C#
try {
// Stuff…
}
catch {
// Ack!
}
finally {
// Always!
}
22
23
24
25
• No automatic fall-through from one case block to the next
• Strongly-typed enums
• By reference calls are explicit at caller AND callee
• Method overrides are explicit
• Supports versioning
• Structs (value types)
• Integrated support for properties and events
• Can still use pointers with RAD language
• Can share data and use functionality with components written
in many different languages
26
C#
Managed
C/C++
Lots of other
Languages
VB
.Net
CLR
CTS GC Security
Runtime Services
MSIL
Windows OS
Java
JRE (JVM)
GC Security
Runtime Services
Byte Codes
Mac Unix LinuxWin
Both are „middle layers‟ between an intermediate
language & the underlying OS
 ECMA standardisation
◦ ECMA 334 and 335
 The Mono Project
◦ Shared Source Common Language Runtime
◦ CLI, C# and Jscript
◦ FreeBSD and Windows implementations
◦ Linux port underway
 DOT GNU project
◦ Portable .Net implementation
◦ C# for both CIL and JVM
27
◦ JVM designed for platform independence
 Single language: Java (?)
 A separate JVM for each OS & device
◦ CLR designed for language independence
 Multiple languages for development
 C++, VB, C#, (J#)
 APL, COBOL, Eiffel, Forth, Fortran, Haskel, SML, Mercury, Mond
rian, Oberon, Pascal, Perl, Python, RPG, Scheme, SmallScript, …
 Impressive usage of formal methods and programming
language research during development
 Impressive extensions for generics and support for functional
languages underway
 Underlying OS: Windows (?)
28
 Java byte code (or JVML) is the low-level language of the
JVM.
 MSIL (or CIL or IL) is the low-level language of the .NET
Common Language Runtime (CLR).
 Superficially, the two languages look very similar.
 One difference is that MSIL is designed only for JIT
compilation.
 The generic add instruction would require an interpreter
to track the data type of the top of stack element, which
would be prohibitively expensive.
29
JVML:
iload 1
iload 2
iadd
istore 3
MSIL:
ldloc.1
ldloc.2
add
stloc.3
30
JVM CLR
Managed execution
environment
X X
Garbage Collection X X
Metadata and
Bytecode
X X
Platform-
abstraction class
library
X X
Runtime-level
security
X X
Runs across
hardware platforms
X ?
 J2EE (1.5) preview of 26.4.2004
◦ Focus on ease of development
 Generics and metadata as in J2SE 1.5 (more like C#)
 Java Studio Creator tool (in beta from April 2004)
(more like Visual Studio .Net)
◦ Timeframe
 To be discussed at JavaOne in June
 Finalized in approximately one year
◦ IBM push for truly open source Java
◦ Others hesitate (even Open Source JBoss)
31
 Web Services are fine as n-tier applications
with UI provided through browser, but …
 On mobile devices WAP hasn‟t really caught
on
 Even iMode hasn‟t caught on in Europe
 Renewed Thin/Thick client discussion
 Java applications on Mobile devices are
reasonably successful
 Now Microsoft is moving fast into the field
with .Net Compact Framework
32
33
Nokia 6600 Orange SPV E200
34
 Mobile device
◦ Software infrastructure, hardware requirements
 Communication technology
◦ On-/Offline scenario
◦ Wireless Wide Area Networks/ Wireless Local Area
Networks
◦ Communication protocol
 Application architecture scenario
◦ Thin/fat client
 Data management
◦ Synchronisation
◦ On-/offline capabilities
 Security issues
◦ Dangers for mobile devices
◦ Threats of communication technology
◦ Danger of exposing enterprise data
35
 Java 2 Micro Edition (J2ME) is not ONE Java edition
 An J2ME compliant application consists of
◦ Configuration
◦ Profile (e.g. Personal, Mobile Information Device Profile
(MIDP))
◦ Application code
◦ Vendor specific UI
 3 Contenders to compare
◦ Java 2 Micro Edition – Connected Device Configuration
(CDC)
◦ Java 2 Micro Edition – Connected Limited Device
Configuration (CLDC)
◦ Microsoft .NET Compact Framework
36
The Java vs. Net discussion goes mobile
 Group of Master Level Students (Hovedfag)
◦ Bjørn D. Rasmussen
◦ Casper S. Jensen
◦ Jimmy Nielsen
◦ Lasse Jensen
 Collaboration with DEIF
 Project Goals
◦ Build end-to-end mobile
client, wireless, webservices based application with
back-end interface to SCADA
◦ In Java (J2ME/J2EE) and in .Net
◦ Compare the two solutions on a set of criteria
37
Objective measurements
 Lines of code
 Development tools
 Documentation
 Infrastructure
 Performance
 Architectural pattern
 Security
 Price
 Development time
Subjective measurements
 Developer satisfaction
 End-user satisfaction
38
39
40
 Server-side is well supported by both Java and .NET
IDEs
 On the client-side .NET IDEs benefit from the fact that
.NET CF is so close to .NET (With Java there are
separate IDEs for desktop and mobile application
development)
 Compatibility problems between Java vendors
 Java IDEs are slow!
 C# is a richer/more complex language than Java
 Both Java and .NET have well documented API
 Web service documentation
◦ .NET - MSDN
◦ Java – Google
 Support for encryption of web services
◦ .Net CF: HTTPS and SOAP extensions 41
 Server-side web service performance study
with:
◦ Microsoft Application Server (v. 5.1)
◦ Sun ONE Application Server (v. 7.0)
 Tested for:
◦ Throughput
◦ Failure rate
◦ Average response time
42
43
44
45
 Slow start-up when developing in Java
◦ Jungle of web service implementations
◦ IDE incompatibility problems
 Emulators
 kSOAP
 Trouble-free implementation in .NET
46
 Developer satisfaction
◦ VS.NET integrates web service and mobile
application development far better than any Java
IDE
◦ A subset of an API is a better solution for mobile
devices instead of an entirely new API
 End-user satisfaction
◦ DEIF would choose a .NET based solution since
startup time is very important
◦ DEIF only needs a limited number of IDE licenses
◦ Extra price for a SmartPhone 2003 is insignificant
compared to the value it gives
◦ The SmartPhone 2003 is more ”fancy” than the Java
phones 47
 We see .NET as a better designed framework
because:
◦ it eliminates the language barrier while also being
platform independent
◦ it makes only little distinction between desktop and
mobile application development
 Sun‟s application server performance is very poor
compared to IIS.
 License fees for a Java based solution are cheaper
but .NET might catch up when considering
development time
 We tried a combined .NET and Java solution but
this has shown to be very troublesome!
48
 The two worlds are becoming more and more
similar
◦ But it seems that you have to work harder in Java
than in .Net
◦ .Net is currently driving technology transfer from
Research to Product
 Windows generation at University now
 Watch-out in the mobile world
 Vodafone to offer Microsoft Smart phones
◦ http://msmobiles.com/news.php/2504.html
◦ Fed-up with Nokia promoting own brand, rather
than operator brand 49
 It is very difficult to make such comparisons
 That .Net has gained maturity extremely fast
 That the two frameworks are very similar
 You will not be sacked for choosing the right
J2EE application server ;-)
 The Devil is in the detail
◦ C# is not Java
◦ ADO.NET is not JDBC
◦ CLR is not JVM
◦ CF.Net smartphones are very different from Java
Smartphones
50
 The ultimate choice usually depends
not on technical superiority, but on:
◦ cultural/”religious”/political preferences
◦ Skill set of your developers
◦ Customer preference
◦ Vendor relations
51
 The two frameworks are becoming more and
more alike
 However:
◦ .Net is Microsoft‟s core strategy
 .Net will be part of OS in the next generation of
Windows
 Lot‟s of innovation in Longhorn –
Avalon, indogo, WinFS
◦ Is Java in Sun‟s core strategy?
 Java 1.5 SE is very close to C# 2.0/.Net CLR
 Sun Java Studio Creator somewhat close to VS.Net
 Some talk of JVM as multi-language platform, but not
really so far …
 Sun in “Java as Open Source” battle with IBM 52
53
Sun vs. Microsoft Stock Prices
54
Choosing between Java and .Net
• You are most likely to be developing in both
environments for the foreseeable future
– Gartner Group: 30+% of all enterprise applications will have both J2EE
and .Net code
– Often IIS in front of J2EE infrastructure
– Interoperability issues
• Web Services (often too slow or doesn‟t support …)
• J2EE/.Net bridge (IL -> JBC or JBC ->IL)
• Look out for “The third way”
– Linux, Apache, MySQL, PhP, …
• Look out for disruptive technologies
– It only takes one guy to get the right idea
– and a small team to implement a completely new platform
– and One large company to productise it
– or a lot of grassroots …

Weitere ähnliche Inhalte

Was ist angesagt?

Ethical Hacking (CEH) - Industrial Training Report
Ethical Hacking (CEH) - Industrial Training ReportEthical Hacking (CEH) - Industrial Training Report
Ethical Hacking (CEH) - Industrial Training ReportRaghav Bisht
 
Hadoop combiner and partitioner
Hadoop combiner and partitionerHadoop combiner and partitioner
Hadoop combiner and partitionerSubhas Kumar Ghosh
 
Advanced SQL
Advanced SQLAdvanced SQL
Advanced SQLSabiha M
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQLrehaniltifat
 
Capacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingCapacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingAdrian Cockcroft
 
Key Challenges In CLOUD COMPUTING
Key Challenges In CLOUD COMPUTINGKey Challenges In CLOUD COMPUTING
Key Challenges In CLOUD COMPUTINGAtul Chounde
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexingMahabubur Rahaman
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EERodrigo Cândido da Silva
 
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQLPgDay.Seoul
 
Database Q&A
Database  Q&ADatabase  Q&A
Database Q&Aeduafo
 
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...DataStax
 
Data warehousing and data mart
Data warehousing and data martData warehousing and data mart
Data warehousing and data martAmit Sarkar
 

Was ist angesagt? (20)

Ethical Hacking (CEH) - Industrial Training Report
Ethical Hacking (CEH) - Industrial Training ReportEthical Hacking (CEH) - Industrial Training Report
Ethical Hacking (CEH) - Industrial Training Report
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Hadoop combiner and partitioner
Hadoop combiner and partitionerHadoop combiner and partitioner
Hadoop combiner and partitioner
 
OLAP
OLAPOLAP
OLAP
 
Advanced SQL
Advanced SQLAdvanced SQL
Advanced SQL
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
Capacity Planning for Cloud Computing
Capacity Planning for Cloud ComputingCapacity Planning for Cloud Computing
Capacity Planning for Cloud Computing
 
The Future of Cloud Computing in 2021
The Future of Cloud Computing in 2021The Future of Cloud Computing in 2021
The Future of Cloud Computing in 2021
 
Green Cloud Computing
Green Cloud ComputingGreen Cloud Computing
Green Cloud Computing
 
Key Challenges In CLOUD COMPUTING
Key Challenges In CLOUD COMPUTINGKey Challenges In CLOUD COMPUTING
Key Challenges In CLOUD COMPUTING
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
 
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
 
Cloud Computing Architecture
Cloud Computing ArchitectureCloud Computing Architecture
Cloud Computing Architecture
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Database Q&A
Database  Q&ADatabase  Q&A
Database Q&A
 
Temporal data mining
Temporal data miningTemporal data mining
Temporal data mining
 
Task programming
Task programmingTask programming
Task programming
 
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
 
Data warehousing and data mart
Data warehousing and data martData warehousing and data mart
Data warehousing and data mart
 

Ähnlich wie Java vs .Net

FRAUD DETECTION IN ONLINE AUCTIONING
FRAUD DETECTION IN ONLINE AUCTIONINGFRAUD DETECTION IN ONLINE AUCTIONING
FRAUD DETECTION IN ONLINE AUCTIONINGSatish Chandra
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot netEkam Baram
 
Java Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJava Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJavier Crisostomo
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1Sisir Ghosh
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java Hitesh-Java
 
J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01Jay Palit
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year projectsuneel singh
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)SURBHI SAROHA
 

Ähnlich wie Java vs .Net (20)

Sadiq786
Sadiq786Sadiq786
Sadiq786
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
FRAUD DETECTION IN ONLINE AUCTIONING
FRAUD DETECTION IN ONLINE AUCTIONINGFRAUD DETECTION IN ONLINE AUCTIONING
FRAUD DETECTION IN ONLINE AUCTIONING
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
Java Programming 100 Programming Challenges
Java Programming 100 Programming ChallengesJava Programming 100 Programming Challenges
Java Programming 100 Programming Challenges
 
E sampark with c#.net
E sampark with c#.netE sampark with c#.net
E sampark with c#.net
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
 
Introduction to Java
Introduction to Java Introduction to Java
Introduction to Java
 
Programming with c#
Programming with c#Programming with c#
Programming with c#
 
Programming in c#
Programming in c#Programming in c#
Programming in c#
 
J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01J2ee strutswithhibernate-140121221332-phpapp01
J2ee strutswithhibernate-140121221332-phpapp01
 
Project report for final year project
Project report for final year projectProject report for final year project
Project report for final year project
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Java Programming : introduction
Java Programming : introductionJava Programming : introduction
Java Programming : introduction
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
Industrial training
Industrial trainingIndustrial training
Industrial training
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
 

Kürzlich hochgeladen

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 

Kürzlich hochgeladen (20)

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Java vs .Net

  • 1. 1
  • 2. 2 SQL Server IIS on W2k Server .NET managed component ASP .NET Windows Client Browser
  • 4. ◦ Both multi-tiered, similar computing technologies ◦ Both support “standards” ◦ Both offer different tools & ways to achieve the same goal. ◦ A lot of parallelism can be seen. ◦ Very difficult to compare and qualify the comparison because each has its own advantages & disadvantages. 4
  • 5.  Java Pet Store is Sun‟s primary blueprint application for J2EE ◦ Source: http://java.sun.com/j2ee/blueprints ◦ Illustrates best coding practices for J2EE ◦ Ships as a sample 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/compare ◦ Implements the same functionality as Java Pet Store ◦ Illustrates best coding practices for .NET Framework  In the TMC Petshop Performance Case Study, The Middleware Company implemented both the Java Pet Store and the .Net Petshop. ◦ The J2EE version ran on two different application servers ◦ All versions used the same hardware and OS 5
  • 6. ◦ The Storefront presents the main user interface in a Web front-end. Customers use the Storefront to place orders for pets. ◦ The Order Processing Center (OPC) receives orders from the Storefront. ◦ The Supplier fulfills orders from the OPC from inventory and invoices the OPC. ◦ The Admin presents the administrator interface in a JFC/Swing front-end. Administrators use the Admin to examine pending orders and approve or deny them. 6
  • 7. 7
  • 8. 8 14000 7500 9000 5000 2500 15500 11500 Java Pet Store Lines of Code Required User Interface 4,410 Data TierMiddle Tier 2,865 .NET Petshop 14,273 5,891 ConfigurationTotal Lines of Code 710 5,404 761 412 74 2,566
  • 9. 9
  • 10. 10
  • 11. ◦ Based on Oracle-published data for tuned version of Java Pet Store ◦ Using Oracle‟s test scripts from their “9i App Server Challenge” ◦ Run on equivalent hardware 11 1.0 0 0 User Load Level ResponseTime(Seconds) 500 1000 1500 2000 2500 2750 0.6 0.4 0.2 0.8 2800% Better performance Supporting 6 times more users
  • 12.  Microsoft concludes: ".NET is 28 times faster than J2EE" ◦ Because: ◦ “Java PetShop” is Sun‟s “best practice” example ◦ Numbers compared with published Oracle results ◦ Identical functionality, all code published and documented  Can we believe the raw numbers? Yes! ◦ Why? Microsoft delivers full docs on the entire scenario  But 28 times really? 12
  • 13.  Java PetShop: J2EE blueprint application ◦ Built by Sun to show "best practice" design ◦ Implementation by TMC missed quite a few optimizations  .NET PetShop ◦ Built by TMC (with help from MS) with different design  Plain classes instead of container managed components  Middle tier moved into ASP.NET  Using stored procedures instead of ad-hoc SQL  Uses server-side caching of ASP.NET  Many performance optimizations applied  Most Java devotees find this highly unfair 13
  • 14.  Re-implementation of J2EE version ◦ 17 times performance increase ◦ Second version showed some J2EE implementation equal .Net ◦ Second version is a testimony to performance tuning 14
  • 15.  It is very difficult to make such comparisons  That .Net has gained maturity extremely fast  That the two frameworks are very similar  The Devil is in the detail 15 So let‟s look at some details
  • 16. 16 VBC++C#PerlPython… VisualStudio.net Win32 MSMQ, COM+, IIS, WMI, AD, ADAM, Indexing, UDDI, etc. CLR Base Class Library ADO.NET ASP.Net P&P blocks Win32, Unix, Linux JMS Apache J2EE App Servers Websphere, Weblogic, Tomcat, etc. Java runtime J2EE Class Library Third party extensions JDBC Servlets JSP Struts Extensions: Phoenix, Tiles, Java Faces Enterprise solutions BEAWeblogicWebshpereStudioEclipse… Java
  • 17. ◦ C# is an object oriented language of the C++/Java flavor ◦ Syntax similar to Java and C/C++. ◦ Quite an impressive design and care for details ◦ Java developers will feel comfortable  most of the time and frustrated when things are different ◦ MS says: “C# combines the power of VC++ with the ease of usage of VB”  Not really true:  C# is really powerful BUT  It is not easy to learn for non C++/Java programmers ◦ It is the language to learn if you are serious about .NET! 17
  • 18. // This is a comment in Java code class HelloWorld{ public static void main(String[] args){ for(int i= 1; i<= 100; i++) System.out.println("Hello!"); } } // This is a comment in C# using System; class HelloWorld{ static void Main(){ for(int i=1; i<=100; i++) Console.WriteLine("Hello"); } } } 18
  • 19.  Java ◦ int, float, double, etc. ◦ Allocated on stack ◦ Not an Object ◦ Not extensible  C# ◦ int, float, double, etc. ◦ structs ◦ Allocated on stack ◦ Inherited from object class ◦ structs can implement interfaces ◦ Cannot inherit from another class 19 // C# struct Point { int x; int y; Point(int x, int y) { this.x = x; this.y = y; } }
  • 20.  Java ◦ All methods are implicitly virtual  C# ◦ Explicitly use „virtual‟ and „override‟ keywords 20 class B { public void foo() { } } class D extends B { public void foo() { } } // D’s foo() overrides B’s foo() class B { public virtual void foo() { } } class D:B { public override void foo() { } } // D’s foo() overrides B’s foo()
  • 21.  Java ◦ C++-style try/catch blocks ◦ finally– action done even after an exception is caught ◦ throws – methods identify what exceptions they throw  C# ◦ C++-style try/catch blocks ◦ finally – same as Java ◦ Does not support throws clause 21 // Java – throws an IOException public void myFunc(int a) throws IOException { // Work… } // Java and C# try { // Stuff… } catch { // Ack! } finally { // Always! }
  • 22. 22
  • 23. 23
  • 24. 24
  • 25. 25 • No automatic fall-through from one case block to the next • Strongly-typed enums • By reference calls are explicit at caller AND callee • Method overrides are explicit • Supports versioning • Structs (value types) • Integrated support for properties and events • Can still use pointers with RAD language • Can share data and use functionality with components written in many different languages
  • 26. 26 C# Managed C/C++ Lots of other Languages VB .Net CLR CTS GC Security Runtime Services MSIL Windows OS Java JRE (JVM) GC Security Runtime Services Byte Codes Mac Unix LinuxWin Both are „middle layers‟ between an intermediate language & the underlying OS
  • 27.  ECMA standardisation ◦ ECMA 334 and 335  The Mono Project ◦ Shared Source Common Language Runtime ◦ CLI, C# and Jscript ◦ FreeBSD and Windows implementations ◦ Linux port underway  DOT GNU project ◦ Portable .Net implementation ◦ C# for both CIL and JVM 27
  • 28. ◦ JVM designed for platform independence  Single language: Java (?)  A separate JVM for each OS & device ◦ CLR designed for language independence  Multiple languages for development  C++, VB, C#, (J#)  APL, COBOL, Eiffel, Forth, Fortran, Haskel, SML, Mercury, Mond rian, Oberon, Pascal, Perl, Python, RPG, Scheme, SmallScript, …  Impressive usage of formal methods and programming language research during development  Impressive extensions for generics and support for functional languages underway  Underlying OS: Windows (?) 28
  • 29.  Java byte code (or JVML) is the low-level language of the JVM.  MSIL (or CIL or IL) is the low-level language of the .NET Common Language Runtime (CLR).  Superficially, the two languages look very similar.  One difference is that MSIL is designed only for JIT compilation.  The generic add instruction would require an interpreter to track the data type of the top of stack element, which would be prohibitively expensive. 29 JVML: iload 1 iload 2 iadd istore 3 MSIL: ldloc.1 ldloc.2 add stloc.3
  • 30. 30 JVM CLR Managed execution environment X X Garbage Collection X X Metadata and Bytecode X X Platform- abstraction class library X X Runtime-level security X X Runs across hardware platforms X ?
  • 31.  J2EE (1.5) preview of 26.4.2004 ◦ Focus on ease of development  Generics and metadata as in J2SE 1.5 (more like C#)  Java Studio Creator tool (in beta from April 2004) (more like Visual Studio .Net) ◦ Timeframe  To be discussed at JavaOne in June  Finalized in approximately one year ◦ IBM push for truly open source Java ◦ Others hesitate (even Open Source JBoss) 31
  • 32.  Web Services are fine as n-tier applications with UI provided through browser, but …  On mobile devices WAP hasn‟t really caught on  Even iMode hasn‟t caught on in Europe  Renewed Thin/Thick client discussion  Java applications on Mobile devices are reasonably successful  Now Microsoft is moving fast into the field with .Net Compact Framework 32
  • 34. 34
  • 35.  Mobile device ◦ Software infrastructure, hardware requirements  Communication technology ◦ On-/Offline scenario ◦ Wireless Wide Area Networks/ Wireless Local Area Networks ◦ Communication protocol  Application architecture scenario ◦ Thin/fat client  Data management ◦ Synchronisation ◦ On-/offline capabilities  Security issues ◦ Dangers for mobile devices ◦ Threats of communication technology ◦ Danger of exposing enterprise data 35
  • 36.  Java 2 Micro Edition (J2ME) is not ONE Java edition  An J2ME compliant application consists of ◦ Configuration ◦ Profile (e.g. Personal, Mobile Information Device Profile (MIDP)) ◦ Application code ◦ Vendor specific UI  3 Contenders to compare ◦ Java 2 Micro Edition – Connected Device Configuration (CDC) ◦ Java 2 Micro Edition – Connected Limited Device Configuration (CLDC) ◦ Microsoft .NET Compact Framework 36 The Java vs. Net discussion goes mobile
  • 37.  Group of Master Level Students (Hovedfag) ◦ Bjørn D. Rasmussen ◦ Casper S. Jensen ◦ Jimmy Nielsen ◦ Lasse Jensen  Collaboration with DEIF  Project Goals ◦ Build end-to-end mobile client, wireless, webservices based application with back-end interface to SCADA ◦ In Java (J2ME/J2EE) and in .Net ◦ Compare the two solutions on a set of criteria 37
  • 38. Objective measurements  Lines of code  Development tools  Documentation  Infrastructure  Performance  Architectural pattern  Security  Price  Development time Subjective measurements  Developer satisfaction  End-user satisfaction 38
  • 39. 39
  • 40. 40
  • 41.  Server-side is well supported by both Java and .NET IDEs  On the client-side .NET IDEs benefit from the fact that .NET CF is so close to .NET (With Java there are separate IDEs for desktop and mobile application development)  Compatibility problems between Java vendors  Java IDEs are slow!  C# is a richer/more complex language than Java  Both Java and .NET have well documented API  Web service documentation ◦ .NET - MSDN ◦ Java – Google  Support for encryption of web services ◦ .Net CF: HTTPS and SOAP extensions 41
  • 42.  Server-side web service performance study with: ◦ Microsoft Application Server (v. 5.1) ◦ Sun ONE Application Server (v. 7.0)  Tested for: ◦ Throughput ◦ Failure rate ◦ Average response time 42
  • 43. 43
  • 44. 44
  • 45. 45
  • 46.  Slow start-up when developing in Java ◦ Jungle of web service implementations ◦ IDE incompatibility problems  Emulators  kSOAP  Trouble-free implementation in .NET 46
  • 47.  Developer satisfaction ◦ VS.NET integrates web service and mobile application development far better than any Java IDE ◦ A subset of an API is a better solution for mobile devices instead of an entirely new API  End-user satisfaction ◦ DEIF would choose a .NET based solution since startup time is very important ◦ DEIF only needs a limited number of IDE licenses ◦ Extra price for a SmartPhone 2003 is insignificant compared to the value it gives ◦ The SmartPhone 2003 is more ”fancy” than the Java phones 47
  • 48.  We see .NET as a better designed framework because: ◦ it eliminates the language barrier while also being platform independent ◦ it makes only little distinction between desktop and mobile application development  Sun‟s application server performance is very poor compared to IIS.  License fees for a Java based solution are cheaper but .NET might catch up when considering development time  We tried a combined .NET and Java solution but this has shown to be very troublesome! 48
  • 49.  The two worlds are becoming more and more similar ◦ But it seems that you have to work harder in Java than in .Net ◦ .Net is currently driving technology transfer from Research to Product  Windows generation at University now  Watch-out in the mobile world  Vodafone to offer Microsoft Smart phones ◦ http://msmobiles.com/news.php/2504.html ◦ Fed-up with Nokia promoting own brand, rather than operator brand 49
  • 50.  It is very difficult to make such comparisons  That .Net has gained maturity extremely fast  That the two frameworks are very similar  You will not be sacked for choosing the right J2EE application server ;-)  The Devil is in the detail ◦ C# is not Java ◦ ADO.NET is not JDBC ◦ CLR is not JVM ◦ CF.Net smartphones are very different from Java Smartphones 50
  • 51.  The ultimate choice usually depends not on technical superiority, but on: ◦ cultural/”religious”/political preferences ◦ Skill set of your developers ◦ Customer preference ◦ Vendor relations 51
  • 52.  The two frameworks are becoming more and more alike  However: ◦ .Net is Microsoft‟s core strategy  .Net will be part of OS in the next generation of Windows  Lot‟s of innovation in Longhorn – Avalon, indogo, WinFS ◦ Is Java in Sun‟s core strategy?  Java 1.5 SE is very close to C# 2.0/.Net CLR  Sun Java Studio Creator somewhat close to VS.Net  Some talk of JVM as multi-language platform, but not really so far …  Sun in “Java as Open Source” battle with IBM 52
  • 53. 53 Sun vs. Microsoft Stock Prices
  • 54. 54 Choosing between Java and .Net • You are most likely to be developing in both environments for the foreseeable future – Gartner Group: 30+% of all enterprise applications will have both J2EE and .Net code – Often IIS in front of J2EE infrastructure – Interoperability issues • Web Services (often too slow or doesn‟t support …) • J2EE/.Net bridge (IL -> JBC or JBC ->IL) • Look out for “The third way” – Linux, Apache, MySQL, PhP, … • Look out for disruptive technologies – It only takes one guy to get the right idea – and a small team to implement a completely new platform – and One large company to productise it – or a lot of grassroots …