zoukankan      html  css  js  c++  java
  • Chapter 1 The CLR's Execution Model

    When you decided to use .Net,you must determine what typ of application or component to build,and must decide which programming language to use,so so ,i suggest that you can begin with C++,because the C++ has higher salary,in my opinion

    The Common Language Runtime is just what its name says it is:a runtime that is usable by different language and varied programming languages,The core features of the CLR(such as memory management,assembly loading,security,exception handing,and thread synchronization).
    CLR is something like java virtual machine,a runtime,management resource(memory managment,garbage collection),and ensure the necesssary separation between application and the underlying operating system.
    In order to improve the stability of the platform,CLR also responsible for other tasks,such as operatiion of the monitoring program.

    In fact,at runtime,clr has no idea which programming language the developer used for the source code,this means that you should choose whatever programming language allows you to express your intention most easily,you can develop your code in any programming language you desire as long as the compiler you use to compile your code targets the clr.

    Regardless of which compiler you use,the result is amanaged module,Amanaged module is standard 32-bit ms windows portable executable or 64-bit file that requires clr to execute,by the way managed assemblies always take advantage of data execution prevention and address space layoyt randomization in windows  these two features improve the security of your whole system

    A Managed Module contain four parts:
    PE32 or PE32+ header:which is similar to the common object file format(COFF) header.This head indicates the type of file:GUI,CUI or DLL,and  contains a timestamp indicating hwen the file was built ,For modules that contain only IL code,the bulk of the information in the PE32(+) header is ignored,For modules that contain native CPU code,this header contains information about the native CPR code

    CLR header Contain the information(interpreted by the CLR and utilities)that makes this a managed module,The header includes the version of the CLR required,some flags,the MethodDef of meatadata token of the managed module;s entry point method,and the location size of the module;s metadata,resources,strong name,some flags,and other less interesting stuff

    Metadata:Every managed module contains metadata tables.Describe the tyoes and memebers defined in your source code and tables that describe the types and member s referenced by your source code

    IL Its means Source Code

    Obviusly,CLR is all about types,CTS is how the types defined and how they behave.The CTS specification states that a tyoe can contain zero or more members

    CTS alse specifies the rules for type visibility and access to the memeber s of a type.

    And last,CTS has another rule,All types must inherit from a predefined type:System.Object,so,It allows you to do the samething.

    CLS is something you must expose Function or Member clear and usable for every language.


    For example:

    Public a:

    {

    public void a();

    public void A();//has the same name

    private Int32 A();//type not clear

    private void c();//can't private

    }

  • 相关阅读:
    关于json中对象的删除
    JDBC操作数据库 封装好的工具类
    json <--->List集合,实体类 之间的相互转换
    java--->>发送邮件
    登陆的过滤器
    Hadoop + Spark 在CentOS下的伪分布式部署
    CentOS和ubuntu修改hostname的区别
    ubuntu 用户管理 adduser vs useradd
    hadoop2.6.1源码编译64位
    MySQL Binlog详解
  • 原文地址:https://www.cnblogs.com/fish124423/p/3012583.html
Copyright © 2011-2022 走看看