Dot Net
Dot Net
NET
What is .NET?
Microsofts vision of the future of applications in the Internet age
Increased robustness over classic Windows apps New programming platform Built for the web
.NET
Sits on top on the OS (currently all the Windows 9x, NT, ME, XP, Vista; Linux/Unix subset also available Mono Project)
About 20MB download
Provides language interoperability across platforms Strong emphasis on Web connectivity, using XML web services to connect and share data between smart client devices, servers, and developers/users Platform/language independent
History
Development began in 1998 Beta 1 released Oct, 2000 Beta 2 released July, 2001 Finalized in Dec, shipping in Feb 2002 Vista ships with .NET Framework 3.0 (Runtime)
.NET Overview
Three main elements:
The Framework (CLR, FCL, ASP, WinForms) The Products (Windows, Visual Studio, Office) The Services (My Services)
Framework Goals
Improved reliability and integrated security. Simplified development and deployment. Unified API, multi-language support.
.NET Framework
C# VB.NET C++.NET Other Common Language Specification Framework Class Library ASP.NET
Web Services Web Forms
Windows Forms
Controls Drawing
ADO.NET Network
XML Security
Threading Diagnostics
IO Etc.
Operating System
CLR provided by .NET manages the execution of code and provides useful services
Memory management, type system, etc. Services exposed through programming languages
C# exposes more features of the CLR than other languages (e.g. VB.NET
Framework Libraries
Web Services
Expose application functionalities across the Internet, in the same way as a class expose services to other classes. Each Web service can function as an independent entity, and can cooperate with one another. Data described by XML.
ASP.NET
Replacement for the Active Server Technology. Web Forms provide an easy way to write interactive Web applications, much in the same way as normal Windows applications.
Framework Libraries
Provides facilities to generate Windows GUI-based client applications easily Form-oriented Standard GUI components
buttons, textboxes, menus, scrollbars, etc.
Event-handling
VB.NET and C#
VB.NET introduces long sought-after features:
Inheritance Parameterized Class Constructors Function Overloading Multi-Threading Structured Error Handling Creating NT Services
J2 Enterprise Edition
Language-Dependent & Platform-Independent
.NET
Language-Independent & Platform Dependent (for now)
Linux
Java VM
Person bytecodes
Java VM
Deploy
Company bytecodes
Windows
Java VM
Address bytecodes
Solaris
Address.java Java VM Company.java
Windows
CLR
Person MSIL
CLR
Deploy
Company MSIL
Windows
CLR
Address MSIL
Others?
Address.cs (C#) CLR Company.cbl (Cobol)
J2EE
The core (JVM and standard class libraries) are mature. 3-4 million Java programmers. J2EE implementations are not entirely crossplatform. Javas true potential is realized only when all (or most) development is done in Java. Changing the Java language specification has an enormous impact on the entire platform.
.NET
.NET built into Windows; running an executable invokes the CLR automatically instead of explicitly invoking the JVM Being newer, .NET added improvements such as native XML support, new features to CLR About 3 million C++ developers, 3-8 million VB developers, around 1 million C# developers Today, most development and deployment is Windows
Mono
Implementation of ECMA C# and CLI for Linux http://www.mono-project.com
10
Mono
http://www.mono-project.com/Main_Page Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell Mono allows your existing binaries to run on Linux with copy-deployment. As of 2/15/09 Mono API coverage is limited to the .NET 2.0 API, with some support for .NET 3.5
Mono
Core: mscorlib, System, System.Security and System.XML assemblies.
ADO.NET: System.Data and various other database providers. ASP.NET: WebForms and Web Services are supported. Work on WSE1/WSE2 has also started. Compilers: C#, VB.NET and various command line tools that are part of the SDK. Open Source, Unix and Gnome specific libraries.
Other components like Windows.Forms, Directory.Services, Enterprise Services and JScript are partially covered Some other smaller and less used components do not have yet a Mono equivalent
11
12
Multiple Languages
Common Type System makes interoperability seamless between languages Class in one language can inherit from a class in another language Exceptions can be thrown across languages Makes it easier to learn a new .NET language since the same tools and classes are in place Can debug across languages
All types fall into two categories - Value types and Reference types.
Value types contain actual data (cannot be null). Stored on the stack. Always initialized. Three kinds of value types: Primitives, structures, and enumerations.
Language compilers map keywords to the primitive types. For example, a C# long is mapped to System.Int32.
13
Boxing = converting an instance of a value type to a reference type. Usually done implicitly through parameter passing or variable assignments. UnBoxing = casting a reference type back into a value type variable.
Int16
Boolean
Primitive Types
14
15
Delegates
A new concept that is central to the programming model of the CLR. Delegates are like function pointers, but are actually typesafe, secure, managed CLR objects. The CLR guarantees that a delegate points to a valid method. You get the benefits of function pointers without the dangers. Each delegate is based on a single method signature. Commonly used for callbacks. Delegates are basis of event handlers.
16
In many cases, an assembly consists of a single EXE or DLL containing the modules MSIL, the component metadata, and the assembly manifest. In other cases, the assembly may consist of many DLLs, with the manifest in its own file. No MSIL code can ever be executed unless there is a manifest associated with it.
17
Arithmetic
Separate instructions for adding to generate overflow vs. no overflow JVM never generates overflow on integer types
18
ILDASM
Can examine assemblies, assembly code with the ILDASM tool Here is ILDASM run on VideoUnScramble.exe
19
Assembly Manifest
Assembly Components
20
Summary
Next we will study C# C# does not exist in isolation but has a close connection with the .NET framework .NET
CLR a relatively new, Java-like platform, but multi-language Src MSIL JIT Native Code .NET framework includes many class libraries
21