170 likes | 290 Views
An Overview of the Microsoft . NET Framework. (c) Allan C. Milne School of Computing & Creative Technologies University of Abertay Dundee. Last updated 26 th July 2006. Agenda. What is .NET? Architecture overview Components of .NET Some concepts. So what is . NET ?.
E N D
An Overviewof theMicrosoft .NETFramework (c) Allan C. Milne School of Computing & Creative Technologies University of Abertay Dundee Last updated 26th July 2006
Agenda • What is .NET? • Architecture overview • Components of .NET • Some concepts
So what is .NET ? • A software development platform • An execution model framework • An operating infrastructure • A framework for distributed systems using ubiquitous XML web services “The biggest change in a Microsoft platform since NT replaced DOS”
Some Changes with .NET • Instruction code formats • Compilers • Code loading and execution models • Type & security systems • Object model • Class libraries • Languages • Metadata
The .NET Framework is … • A single programming architecture • Fundamentally object-oriented • A standard base class library • Language independent • Simple to deploy • Internet enabled • A single development environment
The .NET Framework web forms web services mobile devices ASP.NET Windows forms ADO.NET and XML Data access Base class library Common to all languages Common Language Runtime (CLR)
Common Language Runtime (CLR) Manages & supports the • execution of code in the common Intermediate Language (IL) • assembly concept • IL code with access security & type checking • JIT compiler from IL to native code • object management • memory management & garbage collection • unified type system
.NET Framework Class Libraries Forms ADO.NET XML I / O more … Common Language Runtime (CLR) Memory mgmt. Garbage coll. Unified types Managed code more … .NET Runtime Hosts console windows ASP .NET I E .NET Framework Components Visual Basic C# C++ JScript more … Common Intermediate Language (IL)
Managed Code • Execution of IL code is managed at run-time by the CLR : • Memory allocation & de-allocation • Code access security • Type checking • JIT compilation to native code • Thus the CLR exposes a virtual machine to the programmer
Unified Type System • Type system applies to IL and therefore to all source languages • All types are objects (implicit boxing) • No variant types • Unicode characters & 1 String type • Type safe • CLR verification of IL • no unsafe casting • array bounds checking
Assemblies • Self-contained, self-describing unit of execution & deployment • Executables (.exe) or libraries (.dll) • Private assemblies can be anywhere • Shared assemblies are installed in the Global Assembly Cache (GAC) • Contains IL code, metadata & resources • Metadata is contained in the manifest
Assembly Manifest • Facilitates code execution, class reflection & assembly interaction • Identity & versioning • References & file lists • Expected types • Fields, methods, properties & events of types • Expected resources • Security & permissions
Namespaces • Are a replacement for COM GUIDs • Organize components into logical groups identified by namespace name • Can be nested to reflect a logical hierarchy of functionality, e.g. System.Windows.Forms • One namespace can span several files • One file can contain several namespaces
Binding Namespaces • No special requirements for private assemblies: • add a reference to the .dll file • then just use the namespace names • For shared assemblies in the GAC a strong name is required : • create with the Shared Name utility • binds to a 128-bit hash key
The Class Library • A large & rich library of useful classes organised into namespaces • Enables richer, more rapid, robust & productive development • System • XML • Collections • Windows • Forms
Using a Class Library Old Windows API HWND hwnd; hwnd = CreateWindowEx (WS_EX_OVERLAPPEDWINDOW, szAppName, szAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, modewidth, modeheight, NULL, NULL, hThisInstance, NULL); ShowWindow (hwnd, nCmdShow); UpdateWindow (hwnd); .NET Framework (C#) Form form = new Form(); form.Text = “My Window”; form.Show();
Deployment • Assemblies are the units of deployment, versioning & security • Can be as simple as copying files - no Windows registry needed • Shared assemblies are added to the Global Assembly Cache (GAC) • Versioning allows deployment & use of different versions of a component