150 likes | 269 Views
JVM versus .NET. .NET vs. Java. Runtime environment .NET CLR Java JVM Intermediate Code .NET MSIL Java Java Byte Code Support .NET Multiple Languages , Multiple Platform Java Single Language , Multiple Platform. 1-1.6 J2SE 的架構.
E N D
.NET vs. Java • Runtime environment • .NET CLR • Java JVM • Intermediate Code • .NET MSIL • Java Java Byte Code • Support • .NET Multiple Languages, Multiple Platform • Java Single Language, Multiple Platform
1-1.6J2SE的架構 • 經過前面對Java的簡介後,可以得知用戶端主要是利用J2SE平台套件來開發Java程式,J2SE的架構圖如下所示:
Java的平台套件: • 由於昇陽公司體認到一點“One size doesn‘t fit all”,也就是同一套程式標準無法符合各種不同平台與應用的需求,所以針對此問題發展出下列三種平台套件: • J2SE(Java 2 Standard Edition,標準版):針對用戶端程式所設計的,是Java主要的核心,它包含了編譯Java所需的程式,並且可以支援Java Applet、Java Bean、Java 3D……等等。 • J2EE(Java 2 Enterprise Edition,企業版):針對企業級應用程式所設計的,具有優越的跨平台能力、開放的標準以及高效能且穩定性高,因此深受廣大企業用戶的愛戴,可以支援Servlet、JSP……等等。 • J2ME(Java 2 Micro Edition,精簡版):針對消費性電子產品和嵌入式系統所設計的,主要應用在行動商務領域,例如:無線通訊、手機、PDA、IC卡……等小型電子裝置。
FCL CLR Windows API Windows Operating System (Windows ME, 98, 2000, XP etc) .NET Framework Overview Applications written in J# .NET, VB .NET, or C#
Major Components • CLR • Common Language Runtime • a runtime environment • concept similar to JVM • FCL • Framework Class Library • built on top of the CLR • provide services for modern applications
CLR • Load and execute the C # program • Compile the MSIL into native code • use Just-in-Time (JIT) compilers • Garbage Collection • use Garbage Collector (GC) • Security Management • Exception Handling
FCL • concept similar to MFC for Windows • programming • FCL classes are grouped by namespaces and • exported by assemblies • namespace similar to Java package • assembly similar to .dll
FCL • Some Namespaces in FCL (has hierarchy) • System • System.IO • System.Windows.Forms • System.Drawing • Example: • System.Windows.Forms is located in • System.Windows.Forms.dll
MSIL • Microsoft Intermediate Language • a CPU independent set of instructions • .NET compliant language compile into MSIL • similar to Java Byte Code • sometimes abbreviated as IL
Java Java Java Byte Code JVM do this Linux native code Windows native code Mac OS native code
.NET Visual J# .NET C# VB .NET Compile into MSIL MSIL CLR do this Linux native code Windows native code Mac OS native code Will Support soon Support now Will Support soon
新世代的程式語言 – C# • C# 語言最早是由 Microsoft 公司所倡議,爾後則有 Intel 與 Hewlett – Packard 參與。 • 於2000年10月由國際標準規範組織 ECMA 審核以成為國際標準的程式語言。 • C# 出發點在於提供程式設計師一種簡單易學同時也功能強大的程式語言。 • 2002年4月,Visual Studio .Net 中文版正式發表,扮演系統/應用程式開發人員最重要的開發工具。
Anders Hejlsberg • Creator of • C# • Turbo Pascal • Delphi • Anders studied engineering at the Technical • University of Denmark, previously worked for • Borland, now works for Microsoft.