Platform Comparison Java and .NET Pat Palmer University of Pennsylvania - PowerPoint PPT Presentation

About This Presentation
Title:

Platform Comparison Java and .NET Pat Palmer University of Pennsylvania

Description:

both platforms are object-oriented, type safe, and have automatic garbage collection ... via 3rd-party add-ons until Java 6. IDE's. Eclipse, with 1000's of plugins ... – PowerPoint PPT presentation

Number of Views:166
Avg rating:3.0/5.0
Slides: 36
Provided by: patgp
Category:

less

Transcript and Presenter's Notes

Title: Platform Comparison Java and .NET Pat Palmer University of Pennsylvania


1
Platform ComparisonJava and .NETPat
PalmerUniversity of Pennsylvania
2
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?

3
  • 2008 forecast for market share of OS by platform
    (2q 06)
  • Windows 40
  • Unix 29
  • Linux 15
  • Others 16
  • forecast market share of OS unit sales (05)
  • in 2002 in 2003 in
    2007
  • Windows 45 59 59
  • Linux 20 24 33
  • Unix 16 10 5
  • Others 19 7 3
  • market share of server shipments by platform in
    2005
  • Windows 65.6
  • Linux 20.0

4
main sections
  • simple programs
  • overview of platforms
  • why did Sun do it?
  • why did Microsoft do it?
  • Service Oriented Architecture the peacemaker?

5
1 simple programs
6
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
7
how much work is it to get this?
8
mininal window
  • import java.awt.
  • import javax.swing.
  • public class Hello extends JFrame implements
    Runnable
  • public static void main(String args)
  • SwingUtilities.invokeLater(new Hello())
  • public void run()
  • this.setSize(new Dimension(200,200))
  • this.setTitle("Hello in Java")
  • this.setVisible(true)

using System.Windows.Forms namespace
TinyWindowApp public class HelloForm
Form static void Main()
Application.Run(new HelloForm())
public HelloForm()
ClientSize new
System.Drawing.Size(200, 200) Text
"Hello in C"
9
2 overview of platforms
10
identical types of runtime environments
  • J2SE (Standard) runtime
  • desktop applications
  • J2EE (Enterprise) runtime
  • web applications
  • J2ME (Micro) runtime
  • runtime for gadgets
  • C or VB.NET with VS Express
  • desktop application
  • IIS with VS Express Web
  • web applications
  • .NET compact framework
  • runtime for gadgets

11
Java platform - .NET platform
  • Java Virtual Machine (JVM)
  • aka Java Runtime Environment (JRE)
  • Linux, Windows, Mac and Unix
  • download from Sun
  • JIT compiler and libraries
  • Java Development Kit (JDK)
  • Java compiler and utilities
  • Java bytecode
  • integrated development env. (IDE)
  • Eclipse (free - IBM)
  • Netbeans (free - Sun)
  • application servers
  • Tomcat
  • Glassfish (Sun)
  • BEA Weblogic
  • IBM Websphere
  • Microsoft .NET Framework 2.0
  • aka .NET common language runtime (CLR)
  • all versions of Windows (40)
  • download from Microsoft
  • JIT compiler and libraries
  • NET framework 2.0 SDK
  • C and VB.NET compilers and utilities
  • Common Intermediate Language (CIL)
  • integrated development env. (IDE)
  • Visual Studio Express (free - Microsoft)
  • application servers
  • Microsoft Internet Information Server (IIS)

12
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
  • 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)

13
features 2
  • native code calling
  • components
  • beans
  • environments
  • applet (in browser)
  • servlet (in server)
  • Web Start
  • installs from web
  • caches on users PC
  • deployment
  • .jar
  • .war
  • .ear
  • .class
  • complex, painful learning curve that differs for
    each web server, container, and IDE
  • automated via ANT
  • XML, like make on Unix
  • native code calling
  • components
  • .DLL
  • environments
  • ActiveX (in browser)
  • handler (in server)
  • Smart Client
  • installs from web
  • caches on users PC
  • deployment
  • .exe (on file system)
  • .exe (in GAC)
  • .dll (on file system)
  • all builds and web installation is automatically
    handled by Visual Studio (Microsofts IDE)

14
features 3
  • databases
  • JDBC
  • CORBA
  • binary object remoting
  • XML
  • via 3rd-party add-ons until Java 6
  • IDEs
  • Eclipse, with 1000s of plugins
  • NetBeans (from Sun) also free
  • service oriented architecture (SOA)
  • annotations appearing
  • web services WS-I
  • supported but difficult (3rd party)
  • new partial automation in Java 6 and latest
    NetBeans IDE
  • I havent evaluated these yet
  • databases
  • ODBC
  • COM
  • binary object remoting
  • XML
  • excellent support early one
  • IDEs
  • free versions of Visual Studio
  • some third party IDEs
  • service oriented architecture (SOA)
  • annotations
  • web services WS-I
  • superbly automated by Visual Studion since 2005

15
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

16
Just in Time (JIT) compilers in JRE (JVM) and
.NET runtimes
compilation
before installation, or the first time each
method is called
17
console commands for compiling Java and C.NET
gt java hello
gt hello.exe
18
.NET platform components
download free Software Development Kit (SDK)
free download
19
Java platform components
download free Software Development Kit (SDK)
free download
20
who implements Java runtimes?
  • Sun Microsystems
  • Java HotSpot Virtual Machine
  • for Windows, Linux, Unix
  • Hewlett-Packard
  • Java runtime for HP-UX, OpenVMS,
  • Tru64, Reliant(Tandem) UNIX)
  • IBM
  • Java runtime for MVS, AIX, OS/400, z/OS
  • Apple Computer
  • MacOS Runtime for Java (MRJ)
  • J2SE built-in on Mac OS X
  • includes JDK (compilers)
  • BEA Systems
  • JRockit (for their web server)

21
jargon checklist
  • metadata
  • bytecode
  • JVM
  • JRE
  • JDK
  • J2SE
  • J2ME
  • J2EE
  • IDE
  • GUI
  • what is an assembly?
  • an .exe or .dll file compiled by a .NET compiler
  • what is metadata?
  • the self-describing information inside a .NET
    assembly or Java .class file
  • What is CIL? (formerly MSIL)
  • Common Intermediate Language (inside a .NET
    assembly)
  • What is the CLR?
  • Common Language Runtime that executes CIL code
  • what is managed code?
  • software that runs in the CLR
  • what is native code (or unmanaged code)?
  • software than can run on Windows without the CLR

22
3 why did Sun do it?
23
C and C perceived common problems
  • pointers are dangerous
  • memory leaks (failing to free memory correctly)
  • function pointers (jumping to the wrong place)
  • data pointers (pointing to the wrong place)
  • manual garbage collection is a lot of work
  • multiple inheritance (C) can get very
    complicated
  • ambiguities like the diamond problem (a.k.a.
    diamond of death)
  • not easily portable across platforms, even with
    re-compile and discipline

24
a few ways Java improved on C
  • instead of pointers, Java has references
  • references are similar to pointers, but with
    protections (cannot jump into illegal parts of
    memory)avoids segmentation fault problems
  • automatic garbage collection
  • memory is reclaimed from the heap
    automaticallyavoids memory leaks
  • single inheritance
  • avoiding the deadly diamond of death
  • encapsulation
  • all code must be in a classintended to encourage
    information hiding
  • array bounds checking
  • libraries
  • many common tasks already coded and available for
    reuse by means of inheritance
  • many interfaces (behaviors) already coded

25
4 why did Microsoft do it?
26
Microsofts big headache
  • prior to .NET, Microsoft had a big headache
  • Microsoft was supporting too many operating
    systems
  • application programming interfaces (APIs) were
    implemented as dynamic link libraries (DLLs)
    develop using C
  • calling the Windows API was different on every
    operating system
  • developers first had to find out exactly what
    kind of system the program was running on
  • and then determine if the API desired was
    actually installed on the system
  • that doesnt sound so bad
  • after all, there are only a few different kinds
    of Windows
  • right?

27
party trivia question
  • how many different versions of the Windows
    operating system existed before Vista, which had
    their own distinct mix of APIs?
  • select the closest answer
  • 5
  • 15
  • 25
  • 35

28
Windows versions which can run the .NET framework
  1. Windows XP Professional x64 Edition
  2. Windows Server 2003, Standard x64 Edition
  3. Windows Server 2003, Enterprise x64 Edition
  4. Windows Server 2003, Datacenter x64 Edition
  5. Windows Server 2003 R2, Standard x64 Edition
  6. Windows Server 2003 R2, Enterprise x64 Edition
  7. Windows Server 2003 R2, Datacenter x64 Edition
  8. Windows Server 2003 with SP1, Enterprise Edition
    for Itanium-based Systems
  9. Windows Server 2003 with SP1, Datacenter Edition
    for Itanium-based Systems
  10. Windows Server 2003 R2, Enterprise Edition for
    Itanium-based Systems
  11. Windows Server 2003 R2, Datacenter Edition for
    Itanium-based Systems
  12. Microsoft Windows Mobile for Pocket PC
  13. Windows Mobile for Smartphone
  14. Microsoft Windows CE
  1. Windows 98
  2. Windows 98 Second Edition
  3. Windows 2000 Professional with SP4
  4. Windows 2000 Server with SP4
  5. Windows 2000 Advanced Server with SP4
  6. Windows 2000 Datacenter Server with SP4
  7. Windows XP Professional with SP2
  8. Windows XP Home Edition with SP2
  9. Windows XP Media Center Edition 2002 with SP2
  10. Windows XP Media Center Edition 2004 with SP2
  11. Windows XP Media Center Edition 2005
  12. Windows XP Tablet PC Edition with SP2
  13. Windows XP Starter Edition
  14. Microsoft Windows Millennium Edition
  15. Microsoft Windows Server 2003 Standard Edition
  16. Windows Server 2003 Enterprise Edition
  17. Windows Server 2003 Datacenter Edition
  18. Windows Server 2003 Web Edition
  19. Windows Server 2003 R2, Standard Edition
  • NOTE does not include Vista

29
Windows versions that can not run the .NET
framework v2.0
  1. Windows 95
  2. Windows NT Server
  3. Windows NT Workstation
  4. Windows Server 2003, Enterprise Edition for
    Itanium-based Systems
  5. Windows Server 2003, Datacenter Edition for
    Itanium-based Systems

30
5 Service Oriented Architecture the
peacemaker?
31
who are the big web server and database
marketplace players?
  • Sun
  • IBM
  • BEA
  • SAP
  • Oracle
  • Microsoft

32
world wide web development
  • Java servlets
  • Java Server Pages (JSP)
  • Beans
  • CORBA (binary)
  • XML web services (SOA)
  • .NET handlers
  • Active Server Pages (ASP.NET)
  • .NET DLLs and .NET custom controls
  • COM (binary)
  • XML Web services (SOA)

33
Service Oriented Architectures (SOA)
  • web services
  • remotely located programs that use XML to make
    remote calls and get the results
  • XML traveling over HTTP
  • its all plain text and goes through firewalls
  • standards are emerging
  • Jave service end points and Microsoft client
    endpoints can talk to each other (and vice versa)

34
what we just covered
  1. simple programs
  2. overview of platforms
  3. why did Sun do it?
  4. why did Microsoft do it?
  5. Service Oriented Architecture the peacemaker?

35
the end of this PowerPoint file
Hooray!
Write a Comment
User Comments (0)
About PowerShow.com