50-platforms.ppt
TRANSCRIPT
-
8/9/2019 50-platforms.ppt
1/35
Mar 20, 2015 compare.ppt 1
Platform Comparison
Java and .NET
Pat PalmerUniversity of Pennsylvania
-
8/9/2019 50-platforms.ppt
2/35
Mar 20, 2015 compare.ppt 2
Java and .NET
• Java was created by Sun in 1992
• Microsoft introduced .NET and C# in 2
• bot! "atfor$s are ob%ect&oriented' ty"e safe' and !aveauto$atic (arba(e coection
• t!e two "atfor$s !ave been co$"etin( vi(orousy on t!edes)to"
• but es"eciay in t!e area of server tec!noo(y
• $any deveo"ers beco$e e*"ert on one "atfor$
• few !ave ti$e to earn bot!
• t!e sc!is$ of understandin( t!e two "atfor$s widens
• due to $isinfor$ation and disinfor$ation
• w!at are t!e stren(t!s and issues for eac! "atfor$+
-
8/9/2019 50-platforms.ppt
3/35
Mar 20, 2015 compare.ppt 3
2008 forecast for market share of OS by platform: ,2- /
0indows
3ni* 29
4inu* 156t!ers 1
forecast market share of OS unit sales: ,5/
in 2002 in 2003 in 2007
0indows 5 59 59
4inu* 2 2 77 3ni* 1 1 5
6t!ers 19 8 7
market share of server shipments by platform in 2005:
0indows 5.
4inu* 2.
3ni* 9.5
Net0are .2
6t!ers .8
:6M; 2' accessed on =?=28
-
8/9/2019 50-platforms.ppt
4/35
Mar 20, 2015 compare.ppt 4
main sections
1. si$"e "ro(ra$s
2. overview of "atfor$s
7. w!y did Sun do it+
. w!y did Microsoft do it+
5. Service 6riented @rc!itecture A t!e "eace$a)er+
-
8/9/2019 50-platforms.ppt
5/35
Mar 20, 2015 compare.ppt 5
1 simple programs
-
8/9/2019 50-platforms.ppt
6/35
Mar 20, 2015 compare.ppt 6
// Javapublic class Hello { public static void main(trin!"# ar!s$ { ystem.out.println(%Hello &orld in Java%$'
// C)
namespace Hello {
public class Hello {
static void *ain(strin!"# ar!s$ {
ystem.Console.+rite,ine (%Hello &orld in C)%$'
ystem.Console.-ead,ine($'
0*odule Hello+orld
ub *ain
ystem.Console.+rite,ine(1Hello +orld in 0.NET2$
ystem.Console.-ead,ine($
End ub
End *odule
consoe "ro(ra$s
-
8/9/2019 50-platforms.ppt
7/35
-
8/9/2019 50-platforms.ppt
8/35Mar 20, 2015 compare.ppt 8
$inina window
import %ava.awt.Bimport %ava*.swin(.B
public class Deo extends Jra$e implements :unnabe
public static void $ain,Strin(FG ar(s/
Swin(3tiities.invokeLater ,new Deo,//
H
public void run,/
this.setSiIe,new i$ension,2'2// this.setTite,KDeo in JavaK/
this.setLisibe,true/ HH
using Syste$.0indows.or$snamespace Tiny0indow@"" public class Deoor$ ; or$
static void Main,/ @""ication.:un,new Deoor$,//
H
public Deoor$,/
CientSiIe new Syste$.rawin(.SiIe,2' 2/
Te*t KDeo in C#K
H
H
H
-
8/9/2019 50-platforms.ppt
9/35Mar 20, 2015 compare.ppt 9
2 overview of platforms
-
8/9/2019 50-platforms.ppt
10/35Mar 20, 2015 compare.ppt 10
identica ty"es of runti$e environ$ents
• J2SE ,Standard/ runti$e
•des)to" a""ications
• J2EE ,Enter"rise/ runti$e
•web a""ications
• J2ME ,Micro/ runti$e
•runti$e for (ad(ets
•C# or L.NET wit! LS E*"ress
•des)to" a""ication
•
-
8/9/2019 50-platforms.ppt
11/35Mar 20, 2015 compare.ppt 11
Java platform - .NET platform
• Java Lirtua Mac!ine ,JLM/
a)a Java :unti$e Environ$ent ,J:E/• 4inu*' 0indows' Mac and 3ni*
• downoad fro$ Sun
• J
-
8/9/2019 50-platforms.ppt
12/35Mar 20, 2015 compare.ppt 12
features %
•virtua $ac!ine
•"atfor$s ,a $a%or 6Ss/
•s"ec
•i$"e$entations
•ibraries
•an(ua(es
• Java
• Jyt!on
•Proovy
•web servers ,$any vendors/
•"atfor$s ,3ni*' 4inu*/
•scaabiity
•cost
•web ca"abiities
•servet
• JS
• JS
•virtua $ac!ine
•"atfor$s ,a versions of 0indows/
•s"ec
•i$"e$entations
•ibraries
•an(ua(es
•C#' L.NET' J# fro$ Microsoft
•$any ot!ers fro$ t!ird "arties
,Das)e' 4is"' yt!on' C664' ortran' etc./
•web servers ,%ust oneU/
•"atfor$s ,$ost 0indows/
•scaabiity
•cost•web ca"abiities
•!ander
•@S ,.NET/
•,for(ot e-uivaent na$e/
-
8/9/2019 50-platforms.ppt
13/35Mar 20, 2015 compare.ppt 13
features 2
•native code cain(
•co$"onents•beans
•environ$ents•a""et ,in browser/
•servet ,in server/
•0eb Start
•instas fro$ web•cac!es on users C
•de"oy$ent•.%ar
•.war
•.ear
•.cass•co$"e*' "ainfu earnin(curve t!at diVers for eac! webserver' container' and
-
8/9/2019 50-platforms.ppt
14/35Mar 20, 2015 compare.ppt 14
features &
•databases
• JC
•C6:@
•binary ob%ect re$otin(
•WM4
•via 7rd&"arty add&ons unti Java
•
-
8/9/2019 50-platforms.ppt
15/35Mar 20, 2015 compare.ppt 15
the JRE and .NET runtimes include lots of libraries
• "ro(ra$s can ca a !u(e body of "re&written code
• t!ese reusabe co$"onents are caed t!e Cass 4ibraries
• in Java' so$eti$es t!ey are aso caed "ac)a(es or Java API’s
• in .NET' t!ey tend to be caed t!e ra!e"ork cass ibraries
• t!e ibraries are desi(ned to be used identicay
• in Java' re(ardess of t!e underyin( o"eratin( syste$
• in .NET' re(ardess of t!e underyin( version of 0indows
6: w!ic! an(ua(e is bein( used
-
8/9/2019 50-platforms.ppt
16/35Mar 20, 2015 compare.ppt 16
Just in Ti$e ,J
-
8/9/2019 50-platforms.ppt
17/35Mar 20, 2015 compare.ppt 17
console commands for compiling Java and C.NET
> java hello
hello.java
hello.class
javac
1!!1111!1!!!111!Java b"tecode
hello.cs
hello.exe
csc
1!!1111!1!!!111! Common #ntermediate $anguage %C#$&
> hello.exe
these run in differentvirtual machines
assembl"
-
8/9/2019 50-platforms.ppt
18/35Mar 20, 2015 compare.ppt 18
.NET platform components
Microsoft operating systems since Win98Microsoft operating systems since Win98
Common Language Runtime CLR!
virtual machine (like Java)
frame"or# class libraries
$ata and %ML
web services automation Windows Designer
&' C(( C)
*+,.-T/ II+
J) ,yt0on 1co$"iers
Microsoft .NETra$ewor)
'icrosoft (isualStudio )#"$
download freeSoftware*evelopment+it ,S*+-
freedownloa
d
-
8/9/2019 50-platforms.ppt
19/35Mar 20, 2015 compare.ppt 19
Java platform components
2ni3/ Linu3/ Ma3 4+ %/ Windo"s2ni3/ Linu3/ Ma3 4+ %/ Windo"s
Java Runtime nvironement JR!
virtual machine
Java *,I5s
$ata and %ML
web services automation beans, remoting, servers
Java JRuby
Java +erver ,ages and servlets
J,yt0on 1co$"iers
J:E and JO
download freeSoftware*evelopment+it ,S*+-
freedownloa
d
various open sourceand proprietary players
-
8/9/2019 50-platforms.ppt
20/35Mar 20, 2015 compare.ppt 20
w!o i$"e$ents Java runti$es+
Sun Microsyste$s• Java DotS"ot Lirtua Mac!ine
for 0indows' 4inu*' 3ni*
Dewett&ac)ard• Java runti$e for D&3W' 6"enLMS'
Tru' :eiant,Tande$/ 3N
-
8/9/2019 50-platforms.ppt
21/35Mar 20, 2015 compare.ppt 21
3ar!on c4ec5list
' metadata
' bytecode
' J*' J-E
' J67
' J8E
' J8*E' J8EE
' 96E
' :U9
' &4at is an assembly;' an .e
-
8/9/2019 50-platforms.ppt
22/35Mar 20, 2015 compare.ppt 22
( wh" did )un do it*
-
8/9/2019 50-platforms.ppt
23/35Mar 20, 2015 compare.ppt 23
C and C++ perceived common problems
• "ointers are dan(erous• $e$ory ea)s ,faiin( to free $e$ory correcty/
• function "ointers ,%u$"in( to t!e wron( "ace/
• data "ointers ,"ointin( to t!e wron( "ace/
• $anua (arba(e coection is a ot of wor)
• $uti"e in!eritance ,CRR/ can (et very co$"icated
• a$bi(uities i)e t!e Ydia$ond "robe$Z ,a.).a. Ydia$ond ofdeat!Z/
• not easiy "ortabe across "atfor$s' even wit! re&co$"ieand disci"ine
-
8/9/2019 50-platforms.ppt
24/35Mar 20, 2015 compare.ppt 24
a few ways Java i$"roved on CRR
• instead of "ointers' Java !as reeren#es•
references are si$iar to "ointers' but wit! "rotections,cannot %u$" into ie(a "arts of $e$ory/[avoidsse($entation faut "robe$s
• auto$atic (arba(e coection• $e$ory is recai$ed fro$ t!e !ea" auto$aticay[avoids
$e$ory ea)s
• sin(e in!eritance• avoidin( t!e deady dia$ond of deat!
• enca"suation• a code $ust be in a cass[intended to encoura(e
infor$ation !idin(
• array bounds c!ec)in(• ibraries
• $any co$$on tas)s aready coded and avaiabe for YreuseZby $eans of in!eritance
• $any interfaces ,be!aviors/ aready coded
-
8/9/2019 50-platforms.ppt
25/35
Mar 20, 2015 compare.ppt 25
, wh" did icrosoft do it*
-
8/9/2019 50-platforms.ppt
26/35
Mar 20, 2015 compare.ppt 26
icrosofts big headache
• "rior to .NET' Microsoft !ad a $i% !eadac!e
• Microsoft was su""ortin( too $any o"eratin( syste$s• a""ication "ro(ra$$in( interfaces ,@
-
8/9/2019 50-platforms.ppt
27/35
Mar 20, 2015 compare.ppt 27
part" trivia /uestion
• !ow $any diVerent versions of t!e 0indows o"eratin(syste$ e*isted $eore &ista' w!ic! !ad t!eir own distinct$i* of @
-
8/9/2019 50-platforms.ppt
28/35
Mar 20, 2015 compare.ppt 28
0indows versions which can run the .NET framewor
1. 0indows 9?
2. 0indows 9? Second Edition
7. 0indows 2 rofessiona wit! S
. 0indows 2 Server wit! S
5. 0indows 2 @dvanced Server wit! S
. 0indows 2 atacenter Server wit! S
8. 0indows W rofessiona wit! S2
?. 0indows W Do$e Edition wit! S2
9. 0indows W Media Center Edition 22 wit!S2
1. 0indows W Media Center Edition 2 wit!S2
11. 0indows W Media Center Edition 25
12. 0indows W Tabet C Edition wit! S2
17. 0indows W Starter Edition
1. Microsoft 0indows Mienniu$ Edition
15. Microsoft 0indows Server] 27 StandardEdition
1. 0indows Server 27 Enter"rise Edition18. 0indows Server 27 atacenter Edition
1?. 0indows Server 27 0eb Edition19. 0indows Server 27 :2' Standard Edition
2. 0indows Server 27 :2' Enter"rise Edition
21. 0indows Server 27 :2' atacenter Edition
22. 0indows W rofessiona * Edition
27. 0indows Server 27' Standard *Edition
2. 0indows Server 27' Enter"rise *Edition
25. 0indows Server 27' atacenter *Edition
2. 0indows Server 27 :2' Standard *Edition
28. 0indows Server 27 :2' Enter"rise* Edition
2?. 0indows Server 27 :2' atacenter* Edition
29. 0indows Server 27 wit! S1'Enter"rise Edition for
-
8/9/2019 50-platforms.ppt
29/35
Mar 20, 2015 compare.ppt 29
0indows versions that can not run the .NET framewor v2.!
1. 0indows 95
2. 0indows NT^ Server
7. 0indows NT 0or)station
. 0indows Server 27' Enter"rise Edition for
-
8/9/2019 50-platforms.ppt
30/35
Mar 20, 2015 compare.ppt 30
)ervice 3riented 4rchitecture 5 the peacemaer*
-
8/9/2019 50-platforms.ppt
31/35
Mar 20, 2015 compare.ppt 31
w!o are t!e bi( web server and database $ar)et"ace "ayers+
• Sun
•
-
8/9/2019 50-platforms.ppt
32/35
Mar 20, 2015 compare.ppt 32
world wide web development
• Java servets
• Java Server a(es ,JS/• eans
• C6:@ ,binary/
• WM4 web services ,S6@/
• .NET !anders
• @ctive Server a(es ,@S.NET/• .NET 44s and .NET custo$ contros
• C6M ,binary/
• WM4 0eb services ,S6@/
-
8/9/2019 50-platforms.ppt
33/35
Mar 20, 2015 compare.ppt 33
Service 6riented @rc!itectures ,S6@/
• web services
•re$otey ocated "ro(ra$s t!at use WM4 to $a)e re$otecas and (et t!e resuts
• WM4 travein( over DTT
• its a "ain te*t and (oes t!rou(! Qrewas
• standards are e$er(in(
• Jave service end "oints and Microsoft cient end"oints canta) to eac! ot!er ,and vice versa/
-
8/9/2019 50-platforms.ppt
34/35
Mar 20, 2015 compare.ppt 34
what we 6ust covered
1. si$"e "ro(ra$s
2. overview of "atfor$s
7. w!y did Sun do it+
. w!y did Microsoft do it+
5. Service 6riented @rc!itecture A t!e "eace$a)er+
-
8/9/2019 50-platforms.ppt
35/35
the end of this .ower.oint /le
6ooray7