Introduction to .NET Framework

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to .NET Framework Introduction to .NET Framework Prepared by: Rajani Khushal K. Software Framework • In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software. • It is a collection of software libraries providing a defined application programming interface (API). Software Framework • Frameworks contain key distinguishing features that separate them from normal libraries: – inversion of control - In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not dictated by the caller, but by the framework. – default behaviour - A framework has a default behaviour. This default behaviour must actually be some useful behaviour and not a series of no-ops. Software Framework • Frameworks contain key distinguishing features that separate them from normal libraries: – extensibility - A framework can be extended by the user usually by selective overriding or specialized by user code providing specific functionality. – non-modifiable framework code - The framework code, in general, is not allowed to be modified. Users can extend the framework, but not modify its code What Is .NET • .Net is a new framework for developing web-based and windows-based applications within the Microsoft environment. • The framework offers a fundamental shift in Microsoft strategy: – It moves application development from client- centric to server-centric. What is .NET? • The .NET Framework (pronounced dot net) is a software framework that runs primarily on Microsoft Windows. • It includes a large library and supports several programming languages which allows language interoperability (each language can use code written in other languages). .NET – What Is It? .NET Application .NET Framework Operating System + Hardware Framework, Languages, And Tools VB VC++ VC# JScript … Common Language Specification Visual Visual Studio.NET Common Type System NET Framework Class Library Windows ADO .NET ASP .NET Console Forms Base Class Library Common Language Runtime .NET Framework 3.5 Components of .NET Framework 3.5 • Common Language Runtime (CLR) • Common Type System (CTS) and Common Language Specification (CLS) • .NET Framework Class Library • Assemblies and Metadata • Windows Forms • ASP .NET and ASP .NET AJAX • ActiveX Data Object for .NET (ADO .NET) Components of .NET Framework 3.5 • Windows Presentation Foundation (WPF) • Windows Communication Foundation (WCF) • Windows WorkFlow Foundation (WF) • Windows CardSpace (WCS) • Language Integrated Query (LINQ) Common Language Runtime (CLR) • It provides functionalities such as: – Memory Management – Exception Handling – Debugging – Security – Thread Execution – Code Execution – Code Safety – Verification – Compilation Common Language Runtime (CLR) • In other words CLR manages the execution of .NET Code • The code that is executed by CLR is known as Managed code • The code that cannot be directly executed by the CLR is known as Unmanaged Code Working of CLR • The CLR facilities the interoperability between different .NET languages such as C#, VB or Visual C++ by providing a common environment for the execution of code. • When we run a .NET application, the language compiler first complies the source code into an intermediate code called Microsoft Intermediate Language (MSIL) code. Working of CLR • The MSIL code is then used by the Just in Time Compiler to convert the MSIL code into the native machine code, which is the final executable code. Working of CLR VB Visual Basic Source Code Complier Native C# JIT C# Source Code Machine Complier MSIL Code Complier Code Other .NET Language Other Source Code .NET language Complier Common Type System (CTS) • CTS is the component of .NET framework which provides support for multiple languages • It contains a set of types and operations, which are found in most of the programming languages. • CTS provides a base set of data types for all the languages supported by .NET framework • Each languages uses aliases for the base types provided by CTS. Common Type System (CTS) • Two CTS compliant languages do not require type conversion. • For examples: – CTS uses the data type System.Int32 to represent a 4 byte integer value; in Visual C# uses the alias int for the same. Common Language Specification (CLS) • CLS is a set of basic rules, which enables interoperability between two .NET compliant languages. • The rules defined in CLS serves as guidelines for the third party compiler, designers and library builders. • CLS is a subset of CTS. • Thus the languages supported by CLS can use each other’s class libraries just like their own .NET Framework Class Library • It is a huge library made up of a hierarchy of namespaces. • Each namespace contains classes, structures, interfaces, enumerations, and delegates. • The namespaces are logically defined by their functionality. • For examples: – System.Data contains the functionality for accessing database .NET Framework Class Library • The classes, interfaces, structures and enumerations are collectively referred to as types. • The System namespace is the root for some of the commonly used types in .NET Framework • Some important of classes in System namespace are Console, Math, Object, String, Array, Enum and Delegate. Assemblies and Metadata • In .NET every application is compiled into assembly, which forms the unit of deployment, versioning, code reuse and security of the application. • An assembly refers to a portable executable file. • The PE file can either be a dynamic linked library or an executable file which contains the MSIL code of the compiled application. Assemblies and Metadata • In addition to MSIL, an assembly contains the files and resources necessary for the application, assembly metadata, and type metadata. • The assembly metadata is the metadata about the assembly itself and its components. • The type metadata is the metadata about the types required for the assembly. Assemblies and Metadata • A metadata describes a program that is in the form of binary information stored in an assembly. JIT Compiler • When any .NET application compile , It is not converted into machine code but It is converted into MSIL. This code is machine independent so CLR provide Just In Time compilation Technology to convert the MSIL code into platform code (Native machine code) so that it can be executed. Types of JIT • Pre-JIT COMPILER : Pre-JIT compiles complete source code into native code in a single compilation cycle. This is done at the time of deployment of the application. • Econo-JIT COMPILER: Econo-JIT compiles only those methods that are called at runtime. However, these compiled methods are removed when they are not required. Types of JIT • Normal-JIT COMPILER: Normal-JIT compiles only those methods that are called at runtime. These methods are compiled the first time they are called, and then they are stored in cache. When the same methods are called again, the compiled code from cache is used for execution. Garbage Collection • Memory Management is one of the housekeeping duty that takes a lot of programming time in Developing application. • We doesn’t like spent a time for programming related to memory. • So .NET provides a environment with garbage collection system. Garbage Collection • Garbage collection runs when application needs free memory. • There is no exact time of execution of garbage collection system. • When application required more memory and memory allocator reports that there is no free memory than garbage collection is called. Garbage Collection • It starts by assuming everything should be deleted from the memory. • First it creates the graph of used memory by application , when it has a complete graph of memory used by application then it copies this data and free up the whole memory. • Garbage Collector also free up the memory for unused object at regular interval. Note • When the compilation of takes place in a PE file, the metadata is inserted into one part of the file, while the code is converted into IL and inserted into the other part of the file. • The metadata describes every type and member. • At run time, the CLR loads the metadata into the memory and find information about the code’s classes, members and so. Contents of Metadata • A metadata contains information about the code in a language neutral manners • The meta includes the following information: – Assembly information such as its identity which can be name, version, culture and so on. – Information about types, such as name, visibility, base class, interface and members. – Attribute information which modifies the types and members of the class. Windows Forms • Windows Forms applications allows us to develop window based desktop applications • The basic entity of a Windows Forms Applications is a form, which is an rectangular area on which we can place various control. • In this we could add controls to the window form and develop response to the user actions. ASP .NET and ASP .NET Ajax • ASP .NET is a Web development model, which is used to develop interactive, data driven web applications over the internet • We can add controls and respective events to various controls on the forms • AJAX, formerly code named as Atlas, is an extension of ASP .NET for developing and implementing AJAX functionality. ASP .NET and ASP .NET Ajax • ASP .NET Ajax includes both client side and server side components that allows developers to create web applications such that the applications do not require complete
Recommended publications
  • Interaction Between Web Browsers and Script Engines
    IT 12 058 Examensarbete 45 hp November 2012 Interaction between web browsers and script engines Xiaoyu Zhuang Institutionen för informationsteknologi Department of Information Technology Abstract Interaction between web browser and the script engine Xiaoyu Zhuang Teknisk- naturvetenskaplig fakultet UTH-enheten Web browser plays an important part of internet experience and JavaScript is the most popular programming language as a client side script to build an active and Besöksadress: advance end user experience. The script engine which executes JavaScript needs to Ångströmlaboratoriet Lägerhyddsvägen 1 interact with web browser to get access to its DOM elements and other host objects. Hus 4, Plan 0 Browser from host side needs to initialize the script engine and dispatch script source code to the engine side. Postadress: This thesis studies the interaction between the script engine and its host browser. Box 536 751 21 Uppsala The shell where the engine address to make calls towards outside is called hosting layer. This report mainly discussed what operations could appear in this layer and Telefon: designed testing cases to validate if the browser is robust and reliable regarding 018 – 471 30 03 hosting operations. Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student Handledare: Elena Boris Ämnesgranskare: Justin Pearson Examinator: Lisa Kaati IT 12 058 Tryckt av: Reprocentralen ITC Contents 1. Introduction................................................................................................................................
    [Show full text]
  • Adobe Introduction to Scripting
    ADOBE® INTRODUCTION TO SCRIPTING © Copyright 2007 Adobe Systems Incorporated. All rights reserved. Adobe® Introduction to Scripting NOTICE: All information contained herein is the property of Adobe Systems Incorporated. No part of this publication (whether in hardcopy or electronic form) may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of Adobe Systems Incorporated. The software described in this document is furnished under license and may only be used or copied in accordance with the terms of such license. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorporated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied, or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes, and non-infringement of third-party rights. Any references to company names in sample templates are for demonstration purposes only and are not intended to refer to any actual organization. Adobe®, the Adobe logo, Illustrator®, InDesign®, and Photoshop® are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Apple®, Mac OS®, and Macintosh® are trademarks of Apple Computer, Inc., registered in the United States and other countries. Microsoft®, and Windows® are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries. JavaScriptTM and all Java-related marks are trademarks or registered trademarks of Sun Microsystems, Inc.
    [Show full text]
  • Scala Infochannel Player Setup Guide
    SETUP GUIDE P/N: D40E04-01 Copyright © 1993-2002 Scala, Inc. All rights reserved. No part of this publication, nor any parts of this package, may be copied or distributed, transmitted, transcribed, recorded, photocopied, stored in a retrieval system, or translated into any human or computer language, in any form or by any means, electronic, mechanical, magnetic, manual, or otherwise, or disclosed to third parties without the prior written permission of Scala Incorporated. TRADEMARKS Scala, the exclamation point logo, and InfoChannel are registered trademarks of Scala, Inc. All other trademarks or registered trademarks are the sole property of their respective companies. The following are trademarks or registered trademarks of the companies listed, in the United States and other countries: Microsoft, MS-DOS, Windows, Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, DirectX, DirectDraw, DirectSound, ActiveX, ActiveMovie, Internet Explorer, Outlook Express: Microsoft Corporation IBM, IBM-PC: International Business Machines Corporation Intel, Pentium, Indeo: Intel Corporation Adobe, the Adobe logo, Adobe Type Manager, Acrobat, ATM, PostScript: Adobe Systems Incorporated TrueType, QuickTime, Macintosh: Apple Computer, Incorporated Agfa: Agfa-Gevaert AG, Agfa Division, Bayer Corporation “Segoe” is a trademark of Agfa Monotype Corporation. “Flash” and “Folio” are trademarks of Bauer Types S.A. Some parts are derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. JPEG file handling is based in part on the work of the Independent JPEG Group. Lexsaurus Speller Technology Copyright © 1992, 1997 by Lexsaurus Software Inc. All rights reserved. TIFF-LZW and/or GIF-LZW: Licensed under Unisys Corporation US Patent No. 4,558,302; End-User use restricted to use on only a single personal computer or workstation which is not used as a server.
    [Show full text]
  • What Is Activex: What Does Activex Do? Benefits of Activex
    Khalil Rehman December 2, 2003 What is ActiveX: Microsoft® ActiveX™ is a set of technologies from Microsoft that enables interactive content for the World Wide Web. With ActiveX, Web sites come alive with multimedia effects, interactive objects, and sophisticated applications that create a user experience comparable to that of high-quality CD-ROM titles. ActiveX provides the glue that ties together a wide assortment of technology building blocks to enable these "active" Web sites. (Microsoft Corporation, July 1996) What does ActiveX do? It is designed to increase the dynamic designs of a website. The controls are components that can easily be inserted into a Web page or other application to reuse packaged functionality someone else has programmed. Benefits of ActiveX Some benefits of ActiveX are, • Active web content which attracts the user and retain their interest in the web pages. • Open cross platform support on Macintosh, Windows and Unix operating systems • The tools in which programmer wants to build ActiveX controls are very common and familiar like Visual Basic, Visual C++®, Borland Delphi, Borland C++, Java™, and Java-enabled tools • Existing inventory of ActiveX controls available today for immediate use by Web producers ActiveX VS Java ActiveX is a Microsoft platform dependent and works on window based machine and only work in the internet explorer browser. Once ActiveX controls install and run on the machine it doesn’t need to install and run again, saving the download time after first use. Java has been developed to work on any kind of machine and operating system and do not need of any kind of plug-in.
    [Show full text]
  • Activex Controls and Plugins
    ePM Desktop Requirements Checklist Summary Hardware Intel® Pentium® III 933 MHz or higher (Recommended) Minimum Intel® Pentium® II 300 MHz 512 MB RAM or higher High Speed Internet Connection (Recommend 1 Mbps or greater) 1 GB Storage Desktop Software Microsoft Windows® XP Service Pack 2 Microsoft® Internet Explorer 6.01 or Microsoft® Internet Explorer 7.0 Acrobat Reader Project Document Manager Client Data Dynamics Active Reports Viewer Sun Java 2 Runtime (1.4.2) Microsoft .NET Framework Version 1.1 Redistributable Package Microsoft .NET Framework 3.5 Service Pack 1 Microsoft® Office 2003 or Office 2007 Professional Edition Microsoft Office 2003 / or 2007 Redistributable Primary Interop Assemblies Redistributable Primary Interop Assemblies* Microsoft Web Services Enhancements 2.0 Service Pack 3* Visual Studio 2005 Tools for Office Second Addition Runtime (VSTOR)* Required if using the ePM Office Business Applications or Desktop Quick Applications Administrative Rights Note: you must have administrative rights to your desk top computer or be able to perform the following: Open the following registries o HKEY_CLASSES_ROOT\PDM o HKEY_CLASSES_ROOT\LMC Desktop Requirements Page 1 ePM Desktop Requirements Internet Explorer Settings The following settings are required in Internet Explorer. The instructions below assume IE 7. If you are using another version of IE or another browser, please set accordingly. ePM set in trusted sites zone 1. In Internet Explorer, choose Tools > Internet Options. The Internet Options dialog box appears. 2. Click the Security tab. 3. Select Trusted Sites > Sites. The Trusted Sites dialog box appears. 4. Under Add this Web site to the zone, type https://epm.pbs.gsa.gov 5.
    [Show full text]
  • Middleware in Action 2007
    Technology Assessment from Ken North Computing, LLC Middleware in Action Industrial Strength Data Access May 2007 Middleware in Action: Industrial Strength Data Access Table of Contents 1.0 Introduction ............................................................................................................. 2 Mature Technology .........................................................................................................3 Scalability, Interoperability, High Availability ...................................................................5 Components, XML and Services-Oriented Architecture..................................................6 Best-of-Breed Middleware...............................................................................................7 Pay Now or Pay Later .....................................................................................................7 2.0 Architectures for Distributed Computing.................................................................. 8 2.1 Leveraging Infrastructure ........................................................................................ 8 2.2 Multi-Tier, N-Tier Architecture ................................................................................. 9 2.3 Persistence, Client-Server Databases, Distributed Data ....................................... 10 Client-Server SQL Processing ......................................................................................10 Client Libraries ..............................................................................................................
    [Show full text]
  • Using the Component Object Model Interface
    MQSeries for Windows NT V5R1 IBM Using the Component Object Model Interface SC34-5387-01 MQSeries for Windows NT V5R1 IBM Using the Component Object Model Interface SC34-5387-01 Note! Before using this information and the product it supports, be sure to read the general information under Appendix B, “Notices” on page 151. Second edition (April 1999) This edition applies to MQSeries for Windows NT V5.1 and to any subsequent releases and modifications until otherwise indicated in new editions. Copyright International Business Machines Corporation 1997,1999. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Contents About this book ..................................... v Who this book is for ................................... v MQSeries publications . vi MQSeries cross-platform publications ....................... vi MQSeries platform-specific publications ...................... ix MQSeries Level 1 product publications ....................... x Softcopy books . x MQSeries information available on the Internet .................. xii Where to find more information about ActiveX ................... xii Summary of changes ................................. xiii Changes for this edition ................................ xiii Chapter 1. Introduction . 1 MQSeries Automation Classes for ActiveX overview ................ 1 Chapter 2. Designing and programming using MQSeries Automation Classes for ActiveX .................................. 3 Designing
    [Show full text]
  • Verified Implementations of the Information Card Federated Identity
    Verified Implementations of the Information Card Federated Identity-Management Protocol Karthikeyan Bhargavan∗ Cédric Fournet∗ Andrew D. Gordon∗ Nikhil Swamy† ∗Microsoft Research †University of Maryland, College Park ABSTRACT We describe reference implementations for selected configurations of the user authentication protocol defined by the Information Card Profile V1.0. Our code can interoperate with existing implemen- tations of the roles of the protocol (client, identity provider, and relying party). We derive formal proofs of security properties for our code using an automated theorem prover. Hence, we obtain the most substantial examples of verified implementations of crypto- graphic protocols to date, and the first for any federated identity- management protocols. Moreover, we present a tool that down- loads security policies from services and identity providers and Figure 1: InfoCard: Card-based User Authentication compiles them to a verifiably secure client proxy. Categories and Subject Descriptors and (2) to check consistency between the reference implementation and the informal specification in the same way as for any imple- D.2.4 [Software Engineering]: Software/Program Verification mentation, via interoperability testing with other implementations. This paper reports the techniques underpinning the most com- Security, Verification General Terms plex examples to date of such verified implementations. Keywords Information Card Profile V1.0 (InfoCard). We have built and Cryptographic protocol verification, Verified implementations, Web verified reference implementations of various configurations of the Services Security, Federated identity management, CardSpace. card-based user authentication protocol defined by the Information Card Profile V1.0 [InfoCard Guide, Nanda, 2006]. We refer to this 1. INTRODUCTION protocol as InfoCard. InfoCard is the core of a federated identity-management frame- Verified Reference Implementations of Protocols.
    [Show full text]
  • Cardspace Web Integration
    A Guide to Supporting Information Cards within Web Applications and Browsers as of the Information Card Profile V1.0 December 2006 Author Michael B. Jones Microsoft Corporation Copyright Notice © 2006 Microsoft Corporation. All rights reserved. Abstract The Identity Metasystem allows users to manage their digital identities from various identity providers and employ them in different contexts where they are accepted to access online services. In the Identity Metasystem, identities are represented to users as “Information Cards” (a.k.a. “InfoCards”). One important class of applications where Information Card- based authentication can be used is applications hosted on web sites and accessed through web browsers. This paper documents the web interfaces utilized by browsers and web applications that support the Identity Metasystem. The information in this document is not specific to any one browser or platform. This document supplements the information provided in two other Information Card Profile references: the Guide to the Information Card Profile V1.0 [InfoCard-Guide], which provides a non-normative description of the overall Information Card model, and the Technical Reference for the Information Card Profile V1.0 [InfoCard-Ref], which provides the normative schema definitions and behaviors referenced by the Guide to the Information Card Profile V1.0. Status The Information Card Profile V1.0 was used to implement Windows CardSpace V1.0, which is part of Microsoft .NET Framework 3.0 [.NET3.0], and Internet Explorer 7. Other implementations following these specifications should be able to interoperate with the Microsoft implementation. Version 1.0 Page 1 of 13 Table of Contents 1. Introduction 2.
    [Show full text]
  • NET Tutorial for Beginners
    India Community Initiative .NET Tutorial for Beginners Special thanks to the following who have put in sincere efforts to write and bring this tutorial together. Akila Manian (MVP) | Ajay Varghese (MVP) | Amit Kukreja | Anand M (MVP) | Aravind Corera (MVP) | Arvind Rangan | Balachandran | Bipin Joshi (MVP) | C S Rajagopalan | G Gokulraj | G Arun Prakash | Gurneet Singh (MVP) | Kunal Cheda (MVP) | Manish Mehta (MVP) | Narayana Rao Surapaneni (MVP) | Pradeep | Saurabh Nandu (MVP) | Shankar N.S. | Swati Panhale | Reshmi Nair Content 1. Getting Ready .......................................................................................... 4 1.1 Tracing the .NET History..............................................................................4 1.2 Flavors of .NET...........................................................................................5 1.3 Features of .NET.......................................................................................10 1.4 Installing the .NET Framework SDK.............................................................12 2. Introduction to the .NET Initiative and the .NET Platform...................... 15 2.1 Understanding the Existing Development Scenario........................................15 2.2 Challenges faced by developers..................................................................18 2.3 NET Philosophy / Where does .NET fit in? ....................................................21 2.4 Understanding the .NET Platform and its layers ............................................25 2.5
    [Show full text]
  • NET Framework
    Advanced Windows Programming .NET Framework based on: A. Troelsen, Pro C# 2005 and .NET 2.0 Platform, 3rd Ed., 2005, Apress J. Richter, Applied .NET Frameworks Programming, 2002, MS Press D. Watkins et al., Programming in the .NET Environment, 2002, Addison Wesley T. Thai, H. Lam, .NET Framework Essentials, 2001, O’Reilly D. Beyer, C# COM+ Programming, M&T Books, 2001, chapter 1 Krzysztof Mossakowski Faculty of Mathematics and Information Science http://www.mini.pw.edu.pl/~mossakow Advanced Windows Programming .NET Framework - 2 Contents The most important features of .NET Assemblies Metadata Common Type System Common Intermediate Language Common Language Runtime Deploying .NET Runtime Garbage Collection Serialization Krzysztof Mossakowski Faculty of Mathematics and Information Science http://www.mini.pw.edu.pl/~mossakow Advanced Windows Programming .NET Framework - 3 .NET Benefits In comparison with previous Microsoft’s technologies: Consistent programming model – common OO programming model Simplified programming model – no error codes, GUIDs, IUnknown, etc. Run once, run always – no "DLL hell" Simplified deployment – easy to use installation projects Wide platform reach Programming language integration Simplified code reuse Automatic memory management (garbage collection) Type-safe verification Rich debugging support – CLR debugging, language independent Consistent method failure paradigm – exceptions Security – code access security Interoperability – using existing COM components, calling Win32 functions Krzysztof
    [Show full text]
  • Comparing OLE DB and ODBC This Document Compares the Basic Features of OLE DB to the Basic Features of ODBC (Open Database Connectivity)
    Comparing OLE DB and ODBC This document compares the basic features of OLE DB to the basic features of ODBC (Open Database Connectivity). It is intended to help clarify when to use one over the other. Introduction OLE DB and ODBC are both specifications created by Microsoft to address universal data access. Each is intended as an industry standard that will make access between one vendor's data store and another vendor's data consumer seamless. Microsoft's definition of OLE DB is a strategic system-level programming interface to data across the organization. OLE DB is an open specification designed to build on the success of ODBC by providing an open standard for accessing all kinds of data. And the definition of ODBC is an industry standard and a component of Microsoft® Windows® Open Services Architecture (WOSA). The ODBC interface makes it possible for applications to access data from a variety of database management systems (DBMSs). ODBC permits maximum interoperability—an application can access data in diverse DBMSs through a single interface. Furthermore, that application will be independent of any DBMS from which it accesses data. Users of the application can add software components called drivers, which create an interface between an application and a specific DBMS. The two primary differences between the two are • OLE DB is a component based specification and ODBC is a procedural based specification • SQL is the core of accessing data using ODBC but just one of the means of data access through OLE DB • ODBC is constrained to relational data stores; OLE DB supports all forms of data stores (relational, hierarchical, etc) In general, OLE DB provides a richer and more flexible interface for data access because it is not tightly bound to a command syntax (like SQL in the case of ODBC).
    [Show full text]