Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.

Slides:



Advertisements
Similar presentations
Using.NET Platform Note: Most of the material of these slides have been taken & extended from Nakov’s excellent overview for.NET framework, MSDN and wikipedia.
Advertisements

.NET Framework Overview Pingping Ma Nov 16 th, 2006.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Advanced Object-Oriented Programming Features
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft NYIT.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
CSCI 3327 Visual Basic Chapter 1: Introduction to Visual Basic
Chapter 3 Navigating a Project Goals & Objectives 1.Get familiar with the navigation of the project. How is everything structured? What settings can you.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
.NET Framework Introduction: Metadata
Introduction to .Net Framework
1 Namespaces and Assemblies © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
The Metadata System1. 2 Introduction Metadata is data that describes data. Traditionally, metadata has been found in language- specific files (e.g. C/C++
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
Module 1: Introduction to C# Module 2: Variables and Data Types
Session 1 - Introduction and Data Access Layer
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
CIS NET Applications1 Chapter 2 –.NET Component- Oriented Programming Essentials.
.NET Framework & C#.
Microsoft Visual Basic 2005: Reloaded Second Edition
Appendix D: Microsoft.NET Framework Overview. Overview.NET Framework Architecture.NET Namespaces.
 Internet providing backbone for applications  Use of several web sites and devices to provide one complete solution  Software as services  Quick software.
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Understanding Code Compilation and Deployment Lesson 4.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Computing IV Visual C Introduction with OpenCV Example Xinwen Fu.
ASSEMBLY. A SSEMBLY Assemblies are the fundamental units of applications in the.net framework An assembly can contain classes, structures, interfaces.
Introduction .NET Framework
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Introduction to J2EE Architecture Portions by Kunal Mehta.
.NET Framework Danish Sami UG Lead.NetFoundry
MSIL & CLI Kun-Yuan Shieh.
1.NET FRAMEWORK CE-105 Spring 2007 Engr. Faisal ur Rehman.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
C# Programming: From Problem Analysis to Program Design1 10 Advanced Object-Oriented Programming Features C# Programming: From Problem Analysis to Program.
Presentation Name / 1 Visual C++ Builds and External Dependencies NAME.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Lecture 4: J# Execution Model. 2 MicrosoftIntroducing CS using.NETJ# in Visual Studio.NET 4-2 Objectives “J# programs execute like any other.NET program.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
Object Oriented Software Development 4. C# data types, objects and references.
Module 4: Deployment and Versioning. Overview Introduction to Application Deployment Application Deployment Scenarios Related Topics and Tools.
July 22, 2001Introduction to.NET1 Introduction to.NET Framework Gholamali Semsarzadeh July 2001.
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Assemblies. 2 Objectives Introduce assemblies –concept –creation –naming Discuss deployment –main.exe –dependent assemblies.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
OE-NIK HP Advanced Programming Using and creating DLL files.
Introduction to .NET framework
INF230 Basics in C# Programming
CE-105 Spring 2007 Engr. Faisal ur Rehman
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
Introduction to C# AKEEL AHMED.
Analysis models and design models
Module 10: Implementing Managed Code in the Database
Presentation transcript:

Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1

CO530 Automation Tools Introduction To use.Net components effectively, it is necessary to be familiar with the essentials of.NET as a component technology and deployment platform. Here concepts such as  Common Language Runtime (CLR)  Assembly, and  Metadata are introduced. In particular the composition of client and class library assemblies will be reviewed, and examples presented to demonstrate some component-oriented principles outlined previously. 2

CO530 Automation Tools Common Language Runtime (CLR) The.NET CLR provides a context in which all.NET components execute irrespective of implementation. The CLR is based on a strict type system to which all.NET languages must adhere – all classes, interfaces, structures, and primitive types in every.NET language must compile to CLR-compatible types. This places some restrictions on the languages that might be used ( essentially those available in the.NET Framework and Visual Studio although third party vendors are seeking to extend this) The CLR manages every runtime aspect of the code, providing memory management, security and access to the operating system services; accordingly such code is referred to as managed code. 3

CO530 Automation Tools Compilation Compiling this managed code is a two stage process: 1.The high-level code is compiled into a language called intermediate language (IL) that is packaged in either a DLL or an EXE. 2.Since a machine’s CPU can execute only native machine code (Not IL), a Just-in-Time (JIT) compiler converts IL into actual machine code at run-time. When high-level code is first compiled, a machine code stub is created for every class method. The stub calls into the JIT compiler the method address as a parameter. The JIT compiler retrieves the corresponding IL from the DLL or EXE, compiles it into machine code and replaces the stub in memory with newly generated machine code. Consequently a method is only converted into machine code once and methods that are never called are never compiled. 4

CO530 Automation Tools.NET Assemblies Past attempts at component technologies (raw DLLs providing functions and COM components) has drawn attention to the need to separate logical attributes shared by a set of components, e.g. version, security, and deployment from the physical file that contains the component. The.NET assembly is a single deployment, versioning and security unit that assembles multiple physical files into a single logical unit; as either a class library (DLL) – a library assembly, or a standalone application (EXE) called an application assembly. Accordingly an assembly might comprise a single DLL containing several components, or several DLLs containing one or more components, or an application providing several components. 5

CO530 Automation Tools Assemblies and Referencing Visual Studio (VS) 2008 has a template called Class Library that is used to create a server-side assembly. This generates a single DLL class library assembly to which binary components can be added simply by declaring the class in the source file. 6 Any client may use a component by importing the definitions of the types and components in the server assembly into the client assembly. This process is called adding a reference, i.e. Project | Add Reference. Five sources are available:.NET class libraries, COM objects registered on the machine, etc.

CO530 Automation Tools Reference paths When a reference is added to an assembly, its name and location are remembered by VS. During compilation VS uses this path to find the assembly with a matching name and imports the type definitions. Alternatively this might be overridden by specifying an alternative reference location in the project properties. Click Reference Paths… 7

CO530 Automation Tools Reference paths – cont’d Paths to other folders containing assemblies can be added: Commencing at the top, VS attempts to locate as many reference assemblies as possible in the folders specified in the order they appear. If unsuccessful, it uses the original location specified when the reference was added. 8 Once references have been added, the pane allows references to be edited, deleted or the order in which they appear changed.

CO530 Automation Tools Assembly Metadata In adding a reference, a client intends to use a binary component. However, this poses the classic component-oriented programming problem – that of type discovery; how is the compiler to know which methods are public, which are private and what the signatures are?.NET solves this using metadata. Metadata is a comprehensive, standard, mandatory and complete way of describing the contents of an assembly. It describes the available types (classes, interfaces, etc.) their containing namespaces, the name of each type, its visibility, its base class, the interface it supports, methods, the methods’ parameters, etc. The assembly metadata is generated automatically by the high-level compiler directly from the source files. The compiler embeds the metadata in the physical file containing the IL (DLL or EXE) Metadata is an essential element for.NET to be component technology and development platform. 9

CO530 Automation Tools The Assembly Manifest As metadata describes the types in an assembly, the manifest describes the assembly itself, providing logical attributes shared by all the modules and components in the assembly, including:  The assembly name  The version number  Its location  Security properties, etc. Like metadata, the manifest is generated automatically by the high-level compiler directly from the source files. The manifest is the way.NET captures information about referenced assemblies. This is crucial to ensure version compatibility and to ensure that the assembly gets to interact with the exact trusted set of other assemblies expected. 10