.NET Framework and Architecture By Sanjeev Nagaraddi Sonal Patidar 1 Overview What is Microsoft .NET? – New computing platform that simplifies application development in the highly distributed environment of the Internet. – It is a protocol stack and computing model for TCPI/IP-based, distributed computing. – The .NET Enterprise servers are built for interoperability from the ground up, using open Web standards such as XML with increased scalability and reliability. Primary .NET Components – Common Language Runtime (CLR) – .NET System Class Libraries – ASP.NET used to create XML Web Services 2 .NET Architecture Overview .NET Framework Elements – A runtime engine, called the "Common Language Runtime" (CLR) that handles memory allocation, error trapping, and security features. – A set of extensive Framework class libraries, written from the ground up that comprise practically any functionality you could ask for. – Two top-level development "arenas" for web applications (ASP.NET) and regular Windows applications (Windows Forms). 3 Common Language Runtime (CLR) CLR Architecture – .NET applications are compiled to a common language known as Microsoft Intermediate Language, or "IL". – The CLR, then, handles compiling the IL to machine language, at which point the program is executed. – The CLR architecture provides expansive tool support , simpler deployment (end of "DLL Hell"), superior scalability, support for multiple programming languages and a common data type system. 4 Common Type System (CTS) – Defines how types are declared, used, and managed in the runtime. – Establishes a framework that enables crosslanguage integration, type safety, and high performance code execution. – Provides an object-oriented model that supports the complete implementation of many programming languages. – Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other. 5 Managed Code, Managed Data and Metadata - Code that targets the runtime is called managed code. It runs under “contract of cooperation” with the runtime. Managed code must supply metadata necessary for the runtime to provide its services. All code based on MSIL executes as managed code. - Objects whose lifetime are managed by the runtime are called managed data. The runtime automatically handles object layout and manages references to these objects, releasing them when they are no longer being used. -Metadata is information that describes every element managed by the runtime: an assembly, loadable file, type, method and so on. 6 .NET Framework Classes System Class Library - collection of reusable types that tightly integrate with the runtime. – Framework classes include user interfaces (Windows Forms (conventional Win32 apps); Web Forms (the forms engine for ASP.NET); – Server Controls (reusable user interface components dwelling server-side); – Console Applications; as well as program interfaces—Web services which are third-party applications available over the Internet. 7 .NET Framework Class Library System.Web Services Description Discovery Protocols UI HtmlControls WebControls Caching Configuration Security SessionState System.Windows.Forms Design ComponentModel System.Drawing Drawing2D Imaging System.Data OleDb Common Printing Text System.Xml SqlClient SQLTypes XSLT XPath Serialization System Collections Configuration Diagnostics Globalization IO Net Reflection Resources Security ServiceProcess Text Threading Runtime InteropServices Remoting Serialization .NET Framework and Tools VB C++ C# … J# Common Language Specification Web Forms Web Services Mobile Internet Toolkit Windows Forms ADO .NET and XML Base Class Library Common Language Runtime Operating System Visual Studio .NET ASP .NET Assembly • An Assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. • .exe, .dll, application(only has one entry point)or a library. Can reference other assemblies. These resources, types and references are described in a block of data called a manifest. Defines a type boundary, security boundary , version boundary. Can be private or shared. • • • • 10 Compilation and Execution Compilation Source Code Language Compiler Native Code JIT Compiler Execution Code (IL) Assembly Metadata At installation or the first time each method is called Languages and Platforms Supported by .NET Perl Python COBOL Jscript Eiffel Java Haskell Pascal ML Ada APL C C++ Visual Basic C# SmallTalk Oberon Scheme Mercury Oz RPG Objective Caml Windows XP Windows 2000 Windows NT4 SP6a Windows ME/98 12 ASP.NET ASP.NET is a set of technologies in the Microsoft .NET framework for building Web Applications and XML Web services. ASP.NET pages execute on the server and generate markup such as HTML or XML that is sent to a browser. ASP.NET pages and XML web services contain a server side logic written in VB.NET or C#.NET. Uses XML for data storage, configuration and manipulation. 13 ASP vs ASP.NET • • • • • • • • • Better Language Support Programmable Controls Event Driven Programming XML Based Components User Authentication, with Accounts and Roles Higher Scalability Increased Performance - Compiled Code Easier Configuration and Deployment Not Fully ASP Compatible 14 XML Web Services • • A web service is a programmable application component accessible via standard Web protocols Web services allow applications to share data and can be called across platforms and operating systems, regardless of programming language. Yellow Pages for Web services UDDI Service descriptions WSDL Service interactions SOAP Universal Data Format XML Ubiquitous communications HTTP 15 SOAP (Simple Object Access Protocol) • SOAP is an XML based object protocol for the exchange of information in a decentralized, distributed environment. a. Serialization format for request/response semantics • using XML and HTTP as transport b. Extensible XML document (Envelope, Encoding Rules, RPC) c. Supports complex and simple types (structs, datasets, classes) SCL (SOAP Contract Language) XML document describing the location and interfaces a particular service supports 16 .NET Security 1. Role-Based Security a. Principal - abstraction of the user and the roles in which it belongs. b. Identity - represents the user on whose behalf the code is executing. 2. Code-Access Security a. Permissions b. Evidence 3. Cryptography a. b. c. Confidentiality – to protect user’s identity and data. Data Integrity – to protect data from being altered. Authentication – to assure that data originates from a particular party 17 Permissions A permissions object represents a specific authorization, such as access to a resource - “permission to do something” A permission grant is an authorization given to an assembly - “this code is authorized to do something” A permission demand is security check for corresponding grants - “ is something permitted , else raise an exception” - done by stack walking. 18 Pros and Cons of .NET Easy to use tools may increase programmer productivity. Strong framework for building rich GUI s Choice of more than 20 languages to work with. Tightly integrated with MS operating system and enterprise server software. Built in support for Web services standards. Framework runs only on Windows, restricting vendor choice. Users of prior MS tools and technologies face potentially steep learning curve. New runtime lacks maturity. Choice of integrated development environments is limited Questions persist about scalability and transaction capability of the Windows platform 19 Summary To summarize, .NET is a set of Microsoft software technologies for connecting your world of information, people, systems, and devices that enables unprecedented level of software integration through the use of XML Web services via the internet. 20 References .NET Development (MSDN) http://msdn.microsoft.com/library/default.asp?url=/nhp/De fault.asp?contentid=28000519 .NET FAQ http://archive.devx.com/dotnet/resources/vsresources-5.asp ASP Vs ASP.NET http://www.w3schools.com/aspnet/aspnet_vsasp.asp ASP.NET http://msdn.microsoft.com/library/default.asp?url=/library/ en-us/Dndotnet/html/Techmap_webapps.asp?frame=true 21 Thank You!! 22