Platform Comparison
Java and .NET
compare.ppt
Java and .NET
Java was created by Sun in 1992
Microsoft introduced .NET and C# in 2000
both platforms are object-oriented, type safe, and have
automatic garbage collection
the two platforms have been competing vigorously on the
desktop
but especially in the area of server technology
many developers become expert on one platform
few have time to learn both
the schism of understanding the two platforms widens
due to misinformation and disinformation
what are the strengths and issues for each platform?
Nov 6, 2014
compare.ppt
2008 forecast for market share of OS by platform:
Windows
Unix
Linux
Others
40%
29%
15%
16%
forecast market share of OS unit sales:
in 2002
Windows
45%
Linux
Unix
Others
(2q 06)
20%
16%
19%
in 2003
59%
24%
10%
7%
(05)
in 2007
59%
33%
5%
3%
market share of server shipments by platform in 2005:
Windows
Linux
Unix
NetWare
Others
65.6%
20.0%
9.5%
4.2%
0.7%
FROM: InfoTech Trends http://www.infotechtrends.com/
report from 2Q 2006, accessed on 4/8/2007
Nov 6, 2014
compare.ppt
main sections
1. simple programs
2. overview of platforms
3. why did Sun do it?
1. why did Microsoft do it?
1. Service Oriented Architecture the peacemaker?
Nov 6, 2014
compare.ppt
Nov 6, 2014
simple programs
compare.ppt
console programs
// Java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello world in Java");
}
}
// C#
namespace Hello {
public class Hello {
static void Main(string[] args) {
System.Console.WriteLine ("Hello world in C#");
System.Console.ReadLine();
}
}
}
VB
Module HelloWorld
Sub Main
System.Console.WriteLine(Hello World in
VB.NET)
System.Console.ReadLine()
End Sub
End Module
Nov 6, 2014
compare.ppt
how much work is it to get this?
Nov 6, 2014
compare.ppt
mininal window
import java.awt.*;
import javax.swing.*;
public class Hello extends JFrame implements Runnable
{
using System.Windows.Forms;
namespace TinyWindowApp
public static void main(String[] args)
{
{
public class HelloForm : Form
SwingUtilities.invokeLater(new Hello()); {
}
static void Main()
{
public void run()
Application.Run(new HelloForm());
{
}
this.setSize(new Dimension(200,200));
this.setTitle("Hello in Java");
public HelloForm()
this.setVisible(true);
{
}
ClientSize = new
}
System.Drawing.Size(200, 200);
}
}
Nov 6, 2014
Text = "Hello in C#";
compare.ppt
Nov 6, 2014
overview of platforms
compare.ppt
identical types of runtime environments
J2SE (Standard) runtime
C# or VB.NET with VS Express
desktop applications
J2EE (Enterprise) runtime
desktop application
IIS with VS Express Web
web applications
J2ME (Micro) runtime
web applications
.NET compact framework
runtime for gadgets
Nov 6, 2014
runtime for gadgets
compare.ppt
10
Java platform - .NET platform
Java Virtual Machine (JVM)
aka Java Runtime Environment (JRE)
Microsoft .NET Framework 2.0
aka .NET common language runtime (CLR)
Linux, Windows, Mac and Unix
download from Sun
all versions of Windows (40+)
download from Microsoft
JIT compiler and libraries
JIT compiler and libraries
Java Development Kit (JDK)
Java compiler and utilities
C# and VB.NET compilers and utilities
Java bytecode
application servers
Nov 6, 2014
Common Intermediate Language (CIL)
integrated development env. (IDE)
Eclipse (free - IBM)
Netbeans (free - Sun)
NET framework 2.0 SDK
Visual Studio Express (free - Microsoft)
FREE
NOT
integrated development env. (IDE)
Tomcat
Glassfish (Sun)
BEA Weblogic
IBM Websphere
compare.ppt
application servers
Microsoft Internet Information Server (IIS)
11
features 1
virtual machine
platforms (all major OSs)
spec
implementations
libraries
languages
Java
Jython
Groovy
web servers (many vendors)
platforms (Unix, Linux)
scalability
cost
web capabilities
servlet
JSP
JSF
Nov 6, 2014
virtual machine
platforms (all versions of Windows)
spec
implementations
libraries
languages
C#, VB.NET, J# from Microsoft
many others from third parties
(Haskell, Lisp, Python, COBOL, Fortran, etc.)
web servers (just one!)
platforms (most Windows)
scalability
cost
web capabilities
handler
ASP (.NET)
(forgot equivalent name)
compare.ppt
12
features 2
native code calling
components
native code calling
components
beans
.DLL
environments
environments
applet (in browser)
servlet (in server)
Web Start
ActiveX (in browser)
handler (in server)
Smart Client
installs from web
caches on users PC
installs from web
caches on users PC
deployment
deployment
.jar
.war
.ear
.class
complex, painful learning curve
that differs for each web server,
container, and IDE
.exe (on file system)
.exe (in GAC)
.dll (on file system)
all builds and web installation is
automatically handled by Visual
Studio (Microsofts IDE)
automated via ANT
XML, like make on Unix
Nov 6, 2014
compare.ppt
13
features 3
databases
databases
JDBC
ODBC
CORBA
COM
binary object remoting
binary object remoting
XML
XML
via 3rd-party add-ons until Java 6
IDEs
excellent support early one
IDEs
Eclipse, with 1000s of plugins
NetBeans (from Sun) also free
free versions of Visual Studio
some third party IDEs
service oriented architecture (SOA)
service oriented architecture (SOA)
annotations appearing
web services WS-I
annotations
web services WS-I
supported but difficult (3rd party)
new partial automation in Java 6 and
latest NetBeans IDE
I havent evaluated these yet
Nov 6, 2014
compare.ppt
superbly automated by Visual Studion
since 2005
14
the JRE and .NET runtimes include lots of libraries
programs can call a huge body of pre-written code
these reusable components are called the Class Libraries
in Java, sometimes they are also called packages or Java APIs
in .NET, they tend to be called the framework class libraries
the libraries are designed to be used identically
in Java, regardless of the underlying operating system
in .NET, regardless of the underlying version of Windows
OR which language is being used
Nov 6, 2014
compare.ppt
15