What is CLR?

Microsoft's .NET is a broad family of products representing the company's next generation of services, software, and development tools. At the core of the .NET strategy lives the Common Language Runtime. The CLR is a platform for software development that provides services by consuming metadata. It is standards-based and component-oriented. Like any platform, the important pieces are the runtime, the libraries that provide access to them, and the languages that can target the platform.
But what exactly is .NET? Although the precise meaning can be a little hard to isolate by reading the prolific marketing literature, a little digging reveals that .NET is in fact Microsoft's grand strategy for how all of their software, systems, and services will fit together. It includes development tools (like the new version of Visual Studio, dubbed Visual Studio.NET), future versions of their Windows operating systems, new Internet-based services (like a stepped-up version of their Passport web authentication service), and an entirely new beast called the Common Language Runtime.

The Common Language Runtime is the single most important piece of the .NET product strategy, because it is in essence the engine that pulls the train - the CLR is how developers will write software in the brave new .NET world (see figure 1).

The CLR as a development platform
The CLR is a development platform. Like any platform, it provides a runtime, defines functionality in some libraries, and supports a set of programming languages.

The CLR is a platform for developing applications. A platform is a set of programmatic services, exposed through some API to developers using one or more languages. Development generally targets a single platform;

The CLR is not an operating system in the strict sense of the term - it does not, for example, provide a file system, relying instead on the underlying OS (such as Windows) to implement that feature.

break down the feature set of the platform (CLR) into three fundamental areas: the runtime that the platform offers, the libraries it defines, and the languages I'm going to use. These aspects of the platform overlap (see figure 2), and understanding each of them and the ways in which they interact is crucial to becoming an effective CLR programmer.

Runtime
A runtime provides services to software that you write. The CLR provides a runtime.

A runtime is a piece of code, written by the platform vendor, which provides your code with a set of services. What sorts of services? Well, it depends on the platform - it might be anything from checking security for you to implementing a file system to providing access to some piece of hardware.

Almost every program written these days takes advantage of some sort of runtime. Very few programmers start a project by writing their own file system or database engine. Rather, they make use of already-written pieces of software, like Windows 2000 or Oracle. Both of these platforms (yep, they're both platforms) have a runtime that provides services. In the case of Windows 2000, the runtime is the operating system kernel, and it provides services like thread management. In the case of Oracle, the runtime is the database engine, and the services include things like a SQL engine and transactions. We say that we write code that "runs on" a platform because it uses the services provided by the platform. The CLR provides these services using a layered architecture that is shown in figure 3.

Libraries

The CLR's Base Class Library allow us to interact with the runtime, and provide additional useful functionality.

Languages

The CLR supports programming in one of about two dozen languages. The most popular of these are likely to be C# and Visual Basic.NET.
In two areas, the CLR really shines: its support for component-based programming, and its extensive use of open, standards-based technologies.

Components
The CLR has extensive support for component-based programming.

A fairly recent trend in software development is that of component-oriented programming, although the idea behind component development is not a new one. In fact, it's not even unique to software engineering: we stole it from the hardware guys. The basic concept is that systems are built out of discrete parts that can be assembled to make a larger whole.

A software component is a discrete piece of functionality that can be plugged into different applications. For example, I might develop a calendar component that allows the user to pick a day of the month.

Of course, components do not have to be visual - a reusable piece of logic for calculating sales tax could also be written as a component. The imp

时间: 2024-11-04 07:21:43

What is CLR?的相关文章

CLR全面透彻解析: .NET应用程序可扩展性

借助 Microsoft .NET Framework,编程人员便可轻松获取由不同开发人员和公司构建的组件,并将这 些组件集成到自己的应用程序中.但仅当已知哪些组件是构建基础时才能轻松实现上述过程.如果在构建 时对所需组件一无所知(对于加载项,通常会遇到这种情况),那么事情就会变得更加困难.开发人员在 扩展其应用程序时经常会遇到问题.例如,应将加载项存储在数据库中还是磁盘上?开发人员应考虑已知 接口的加载项以获得激活类型吗?使用 AppDomain.AppDomainManager 和 AppD

使用 SQL Server 2005中的 CLR 集成

本文描述了数据库应用程序开发人员和架构师如何利用 SQL Server 2005 中的 CLR 集成功能.本文对基于 CLR 的编程方式与 SQL Server 中支持的现有编程模型(如 TransacT-SQL 和扩展存储过程)进行了比较,并且强调了各自相对的优缺点.还提供了一组选择合适的编程替代方法的高级指导,以及一些示例和代码示例. 一.简介 Microsoft 通过宿主 Microsoft .NET Framework 2.0 公共语言运行库 (CLR),SQL Server 2005显

SQL Server 2005 CLR 功能简介

在SQL Server 2005的众多被高度评价的特性中,有一个最适合那些对SQL Server编程的人员的就是通用语言运行时,缩写为CLR(Common Language Runtime).CLR允许编程人员直接在SQL Server 中创建存储过程,触发器,用户定义函数,集合和类型.CLR有很多的承诺,但是它也具有一些缺陷. CLR的重要性有几个比较大的原因.首先,由于SQL Server编程已经成熟了,编码器运行在SQL Server 自身可能的限制之中,并且很大程度上依赖于外部代码来执行

有关SQL Server 2005 CLR

在SQL Server 2005的许多被大力推荐的特性里面,有一项可能对那些使用SQLServer 工作的编程人员最实用的是Common Language Runtime,或者简写为CLR.CLR可以让编程人员直接在SQL Server中创建存储过程.触发器,用户自定义函数,集合体和类型.CLR有很多的承诺,但是也有一些缺陷. 关于CLR的重要性有一些主要的原因.首先,随着SQL Server 编程技术的成熟,代码编写人员陷入了SQL Server自身的一些限制之中,并且在很大程度上依赖外部的代

探讨SQL Server 2005.NET CLR编程

本文将解释如何在SQL Server 2005中以尽可能最简单的方法创建基于.NET的CLR子例程.本文主要针对在服务器端使用SQL Server 2005的.NET开发者. 一.创建SQL Server 2005数据库 这一节主要讨论创建一个将用于本文中的数据库和表格.详见下列步骤: · 执行"Start->Programs->Microsoft SQL Server 2005->SQL Server Management Studio",并使用必要的证书连接到你的

编写执行你的第一个Yukon CLR(通用语言运行时)存储过程

存储过程|执行 编写执行你的第一个Yukon CLR(通用语言运行时)存储过程 作者:Suhil Srinivas 翻译:朱二 原文出处:http://www.c-sharpcorner.com/Longhorn/Yukon/First-CLR-Procedure.asp 描述这篇文章描述了种种编写和执行一个Yukon CLR 通用语言运行时存储过程的步骤.对开发混合数据类型的SQL 存储过程来说,本文也是一个起点.需求正确安装SQL Server Yukon beta1介绍Yukon 是微软公

.Net平台下CLR程序载入原理分析

程序 Flier Lu <flier_lu@sina.com.cn>   注意:本系列文章在水木清华BBS(smth.org)之.Net版首发,      转载请保留以上信息,发表请与作者联系     与传统的Win32可执行程序中的本机代码(Native Code)不同, 微软推出的.Net架构中,可执行程序的代码是以类似Java Byte Code的 IL (Intermediate Language)伪代码形式存在的.在.Net可执行程序载入后, IL代码由CLR (Common Lan

MS.Net CLR 扩展PE结构分析2

Flier Lu <flier_lu@sina.com.cn>   注意:本系列文章在水木清华BBS(smth.org)之.Net版首发,      转载请保留以上信息,发表请与作者联系   Metadata 篇   第一章 Metadata 概述   1.1 什么是 Metadata       Metadata翻译成中文是"元数据",可以理解为Type of Type, 说白了就是描述类型的类型数据.从最初级的语言层面支持的RTTI ("近代"的编程

MS.Net CLR 扩展PE结构分析(转,很不错的文章)

Flier Lu <flier_lu@sina.com.cn>   注意:本系列文章在水木清华BBS(smth.org)之.Net版首发,      转载请保留以上信息,发表请与作者联系   概述       本系列文章,将从系统层角度,通过对MS.Net CLR架构对PE映像结构的扩展的分析 , 解析MS.Net CLR架构的底层部分运行机制,帮助读者从更深层次理解CLR中某些重要概念 本文读者应具备基本的Win32编程经验,了解.Net中常见概念意义,并对Win32之PE映像 结构有一定了