




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、畢業(yè)設(shè)計(論文)外文文獻翻譯 .NET Framework介紹 Alex Kriegel 1.NET Framework是Microsoft為開發(fā)應用程序而創(chuàng)建的一個富有革命性的新平臺。這句話最有趣的地方是它的含糊不清,但這是有原因的。首先,注意這句話沒有說“在Windows操作系統(tǒng)上開發(fā)應用程序”。盡管.NET Framework的Microsoft版本運行在Windows操作系統(tǒng)上,但以后將推出運行在其他操作系統(tǒng)上的版本,例如Mono,它是.NET Framework的開發(fā)源代碼版本(包含一個C#編譯器),該版本可以運行在幾個操作系統(tǒng)上,包括各種Linux版本和Mac OS.Microso
2、ft .NET Compact Framework(基本上是完整 .NET Framework的一個子集)。使用.NET Framework的一個主要原因是它可以作為集成各種操作系統(tǒng)的方式。另外,上面給出的.NET Framework定義并沒有限制應用程序的類型。這是因為本來就沒有限制。.NET Framework可以創(chuàng)建Windows應用程序、Web應用程序、Web服務和其他各種類型的應用程序.NET Framework的設(shè)計方式保證它可以用于各種語言,包括C#語言,C+、Visual Basic、JScript,甚至一些舊的語言,如COBOL。為此,還推出了這些語言的.NET版本,目前還在
3、不斷推出更多的.NET版本的語言。所有這些語言都可以訪問.NET Framework,它們還可以彼此交互。C#開發(fā)人員可以使用Visual Basic程序員編寫的代碼,反之亦然。所有這些提供了意想不到的多樣 這也是.NET Framework具有誘人前景的部分原因。 2.NET Framework主要包含一個非常大的代碼庫,可以在客戶語言(如C#)中通過面向?qū)ο缶幊碳夹g(shù)(OOP)來使用這些代碼。這個庫分為不同的模塊,這樣就可以根據(jù)希望得到的結(jié)果來選擇使用其中的各個部分。例如,一個模塊包含Windows應用程序的構(gòu)件,另一個模塊包含聯(lián)網(wǎng)的代碼塊,還有一個模塊包含Web開發(fā)的代碼塊。一些模塊還分為
4、更具體的子模塊,例如在Web開發(fā)模塊中,有用于建立Web服務的子模塊.其目的是,不同的操作系統(tǒng)可以根據(jù) 自己的特性,支持其中的部分或全部模塊。例如,PDA支持所有的核心.NET功能,但不需要 某些更深奧的模塊。 部分.NET Framework庫定義了一些基本類型。類型是數(shù)據(jù)的一種表達方式,指定其中最基礎(chǔ)的部分(例如32位帶符號的整數(shù)),以便使用.NET Framework在各種語言之間進行交互操作。這稱為通用類型系統(tǒng)(Common Type System,CTS).除了支持這個庫以外,.NET Framework還包含.NET公共語言運行庫1 畢業(yè)設(shè)計(論文)外文文獻翻譯 (Common L
5、anguage Runtime,CLR),它負責管理用.NET庫開發(fā)的所有應用程序的執(zhí)行。 3.如何用.NET Framework編寫應用程序.使用.NET Framework編寫應用程序,就是使 用.NET代碼庫編寫代碼(使用支持Framework的任何一種語言).VS是一種強大的集成開發(fā)環(huán)境,支持C#(以及托管和非托管C+、Visual Basic和其他一些語言)。這個環(huán)境的優(yōu)點是便于把.NET功能集成到代碼中。我們創(chuàng)建的代碼完全是C#代碼,但使用.NET Framework,并在需要時利用VS中的其他工具。為了執(zhí)行C#代碼,必須把它們轉(zhuǎn)換為目標操作系統(tǒng)能夠理解的語言,即本機代碼,這種轉(zhuǎn)換
6、稱為編譯代碼,由編譯器執(zhí)行。但在.NET Framework下,這個過程分為兩個階段。 4. MSIL和JIT在編譯使用.NET Framework庫的代碼時,不是立即創(chuàng)建操作系統(tǒng)特定的本機代碼,而是把代碼編譯為Microsoft中間語言(Microsoft Intermediate Language,MSIL)代碼,這些代碼不專用于任何一種操作系統(tǒng),也不專用于C#。其他.NET語言,如Visual Basic .NET也可以在第一階段編譯為這種語言,當使用VS開發(fā)C#應用程序時,編譯過程就由VS完成。顯然,要執(zhí)行應用程序,必須完成更多的工作,這是Just-In-Time(JIT)編譯器的任務
7、,它把MSIL編譯為專用于OS和目標機器結(jié)構(gòu)的本機代碼。這樣OS才能執(zhí)行應用程序。這里編譯器的名稱Just-In-Time反映了MSIL僅在需要時才編譯的事實。過去,常常需要把代碼編譯為幾個應用程序,每個應用程序都用于特定的操作系統(tǒng)和CPU結(jié)構(gòu)。這通常是一種優(yōu)化形式(例如,為了讓代碼在AMD芯片上運行得更快),但有時是非常重要的(例如對于工作在Win9x 和 WinNT/2000環(huán)境下的應用程序)?,F(xiàn)在就不必要了,因為顧名思義,JIT編譯器使用MSIL代碼,而MSIL代碼是獨立于機器、操作系統(tǒng)和CPU的。目前有幾種JIT編譯器,每種編譯器都用于不同的結(jié)構(gòu),我們總能找到一個合適的編譯器創(chuàng)建所需的
8、本機代碼。 這樣,用戶需要做的工作就比較少了。實際上,可以不考慮與系統(tǒng)相關(guān)的細節(jié),把注意力放在代碼的功能上就夠了。 5. 程序集在編譯應用程序時,所創(chuàng)建的MSIL代碼存儲在一個程序集中,程序集包括可執(zhí)行的應用程序文件(這些文件可以直接在Windows上運行,不需要其他程序,其擴展名是.exe)和其他應用程序使用的庫(其擴展名是.dll)。除了包含MSIL外,程序集還包含元信息(即程序集中包含的數(shù)據(jù)的信息,也稱為元數(shù)據(jù))和可選的資源(MSIL使用的其他數(shù)據(jù),例如聲音文件和圖片)。元信息允許程序集是完全自2 畢業(yè)設(shè)計(論文)外文文獻翻譯 我描述的。不需要其他信息就可以使用程序集,也就是說,我們不會
9、遇到下述情形:不能把需要的數(shù)據(jù)添加到系統(tǒng)注冊表中,而這種情形在使用其他平臺進行開發(fā)時常常出現(xiàn)。因此,部署應用程序就非常簡單了,只需把文件復制到遠程計算機上的目錄下即可。因為不需要目標系統(tǒng)上的其他信息,所以只需從該目錄中運行可執(zhí)行文件即可(假定安裝了.NET CLR)。當然,不必把運行應用程序所需要的所有信息都安裝到一個地方??梢跃帉懸恍┐a,執(zhí)行多個應用程序所要求的任務。此時,通常把這些可重用的代碼放在所有應用程序都可以訪問的地方。在.NET Framework中,這個地方是全局程序集高速緩存(Global Assembly Cache,GAC),把代碼放在這個高速緩存中是很簡單的,只需把包含
10、代碼的程序集放在包含該高速緩存的目錄下即可。 6. 托管代碼在把代碼編譯為MSIL,再用JIT編譯器把它編譯為本機代碼后,CLR的任務還沒有全部完成。用.NET Framework編寫的代碼在執(zhí)行(這個階段通常稱為運行時(runtime)時是托管的。即CLR管理著應用程序,其方式是管理內(nèi)存、處理安全性,以及允許進行跨語言調(diào)試等。相反,不在CLR控制之下運行的應用程序是非托管的,某些語言如C+可以用于編寫這類應用程序,例如,訪問操作系統(tǒng)的低級功能。但是,在C#中,只能編寫在托管環(huán)境下運行的代碼。我們將使用CLR的托管功能,讓.NET自己與操作系統(tǒng)進行交互。 7. 垃圾回收 托管代碼最重要的一個功
11、能是垃圾回收(garbage collection)。這種.NET方法可確保應用程序不再使用某些內(nèi)存時,這些內(nèi)存就會被完全釋放。在.NET推出以前,這項工作主要由程序員負責,代碼中的幾個簡單錯誤會把大塊內(nèi)存分配到錯誤的地方,使這些內(nèi)存神秘失蹤。這通常意味著計算機的速度逐漸減慢,最終導致系統(tǒng)崩潰。 .NET垃圾回收會頻繁檢查計算機內(nèi)存,從中刪除不再需要的內(nèi)容。它沒有設(shè)置時間幀,可能一秒鐘內(nèi)會進行上千次的檢查,也可能幾秒鐘檢查一次,或者隨時進行檢查,但可以肯定進行了檢查。 這里要給程序員一些提示。因為這項工作在不可預知的時間進行,所以在設(shè)計應用程序時,必須記得要進行這樣的檢查。需要許多內(nèi)存才能運行
12、的代碼應自己執(zhí)行這樣的檢查,而不是坐等垃圾回收,但這不像聽起來那樣難。 8. 把它們組合在一起 在繼續(xù)學習之前,先總結(jié)一下上述創(chuàng)建.NET應用程序所需要的步驟:(1)使用某種.NET兼容語言(如C#)編寫應用程序代碼,如圖1-1所示。 (2)把代碼編譯為MSIL,存儲在程序集中. (3) 在執(zhí)行代碼時(如果這是一個可執(zhí)行3 畢業(yè)設(shè)計(論文)外文文獻翻譯 文件,就自動運行,或者在其他代碼使用它時運行),首先必須使用JIT編譯器將代碼編譯為本機代碼,如圖1-3所示。(4)在托管的CLR環(huán)境下運行本機代碼,以及其他應用程序或過程. 9. 鏈接在上述過程中還有一點要注意。在第(2)步中編譯為MSIL的
13、C#代碼不一定包含在單獨的文件中,可以把應用程序代碼放在多個源代碼文件中,再把它們編譯到一個程序集中。這個過程稱為鏈接,是非常有用的。原因是處理幾個較小的文件比處理一個大文件要簡單得多??梢园堰壿嬌舷嚓P(guān)的代碼分解到一個文件中,以便單獨處理它,這也更易于在需要代碼時找到它們,讓開發(fā)小組把編程工作分解為可管理的塊,讓每個人編寫一小塊代碼,而不會破壞已編寫好的代碼部分或其他人正在處理的部分。 4 畢業(yè)設(shè)計(論文)外文文獻翻譯 .NET Framework Introduce Alex Kriegel 1.NET Framework for the development of Microsoft a
14、pplications and the creation of a rich a revolutionary new platform. This case is most interesting is its vague, but this is a reason for this. First of all, pay attention to this statement did not say in the Windows operating system development and application procedures. Although. NET Framework ve
15、rsion runs on Microsoft Windows operating system president, but future operations will be launched in other versions of the operating systems, such as Mono, It yes. NET Framework development of the source code version (including a C # compiler). This version can run on several operating systems, inc
16、luding Linux and the Mac OS.Microsoft. version NET Compact Fr amework (basically intact. NET Framework of a subset). Use. NET Framework is a major cause of it as the operating system of integrating all kinds of ways. In addition, as given above. NET Framework definition does not limit the type of ap
17、plication. This is because there is no restriction. . NET Framework can create Windows applications, Web applications, Web and various other types of procedures should be used . NET Framework design approach to ensure that it can service to be used in various languages, including C #, C + +, Visual
18、Basic, and JScript. even some of the old language, such as COBOL. Therefore, in addition to the implementation of these languages. NET version, currently still has introduced more. NET version of the language. All of these languages can visit. NET Framework, they can cross each other. C # developers
19、 can use Visual Basic programmers to prepare the code, and vice versa. All of these provide an unexpected diversity, This is. NET Framework with the enticing prospect of reasons. 2.NET Framework mainly contains a very large code library. customers in languages (such as C #) through object-oriented p
20、rogramming (OOP) to use these codes. The library is divided into different modules, thus can expect the result to choose to use the various parts. For example, a module includes Windows application components, 5 畢業(yè)設(shè)計(論文)外文文獻翻譯 another networking module containing the code block, There is also a Web
21、module contains the code block. development Some modules also divided into more specific sub-module, such as the Web module development for the establishment of a Web module. service its purpose is different operating systems under their own identity, support for some or all modules. For example, th
22、e PDA support all of the core. NET function, but it does not need some of the more esoteric modules. Part. NET Framework defines some of the basic types. Data type is a form of expression, designated one of the most basic elements (such as 32-bit integers with the symbol) to use. NET Framework in va
23、rious languages between interoperability. This is known as the Common Type System (Common Type System. CTS). In addition to supporting the library, . NET Framework also includes. NET common language runtime (Common Langua ge Runtime, CLR), which is responsible for management use. NET development for
24、 all applications implementation. 3. How to use. NET Framework applications development. Use. NET Framework preparation of applications, is used. NET code for the preparation of code (using the Framework support any language). VS is a powerful integrated development environment, support for C # (and
25、 managed and unmanaged C + +. Visual Basic and other languages). The environmental advantages of the facilitates. NET to integrate the functions of the code. We build the code is C # code, but use. NET Framework, and, if necessary, the use of VS other tools. In order to implement C # code, which mus
26、t be converted to target operating system to solve language, which is the machine code This change as compiled code, the compiler implementation. But. NET Framework, the process is divided into two phases 4. Keyword and the JIT compiler in use. NET Framework library code, instead of immediately crea
27、ting an operating system specific code of the machine, but put code compiler for Microsoft intermediate language (Microsoft Intermedi ate Language, keyword) code, the code is not exclusive to any one operating system. not exclusive to C #. Other. NET language, If Visual Basic. NET can be compiled in
28、 the first stage of this language, When using VS C # application development, build on the process completed by VS. Obviously, the implementation of the applicable procedures must complete more 6 畢業(yè)設(shè)計(論文)外文文獻翻譯 work, This is Just-In-Time (JIT) compiler task It put keyword compiler for OS and dedicat
29、ed to the goal of the machine structure for the code. This OS can implement applications. Here compiler Just-In-Time the name reflects the keyword only need to do a translation of the facts. Past, we often need to compile code for several applications, Each application procedures for specific operat
30、ing systems and CPU structure. This is usually an optimal form (for example, in order for the code in the AMD chips run faster). But sometimes it is very important (for instance, in Win9x WinNT/2000 environment and the application process Prologue). Now unnecessary because, as the name implies, JIT
31、compiler uses keyword code and keyword code is independent of machine, operating system and CPU. There are several JIT compiler, each compiler are used for different structures, We can always find a suitable compiler is the creation of the machine code. Thus, users need to do a far less. In fact, th
32、ey do not consider the details related to the system, giving attention to the functional code will be enough. 5. Program Set compiled application, citing the keyword code stored in a centralized procedure. Set procedures including the application executable files (which can be directly run on Window
33、s. no need for other procedures, expansion are. exe) and other applications that use the library (expansion are. dll). In addition to include keyword, the procedures set also includes meta-information (that is, procedures focus on the data contained in the information, also known as metadata) and th
34、e optional resources (keyword used by other data, such as sound files and pictures). Yuan procedures allow information collected is completely self-described. No other information on the procedures for collection, in other words, we do not encounter the following circumstances : not requiring the da
35、ta added to the system registry. and the use of this kind of situation in other platform development often arise. Therefore, the deployment of applications it is very simple, just put the paper copy to the remote computer directory can be. Not the target system because of other information, So just
36、from the CONTENTS run executable files can be (assuming installed. NET CLR). Of course, we do not have the applications needed to install all the information in one place. You can make some code, the implementation of a number of applications required tasks. At this time, these are usually reusable
37、code on all applications can access areas. In. NET 7 畢業(yè)設(shè)計(論文)外文文獻翻譯 Framework, this is a definitive collection procedures Cache (Global Assembly Cache, the GAC). code or on the high-speed cache is very simple. needs to do is include the code on the procedures set contains the cache directory can be.
38、 6. Trust code compiler for code or keyword and then JIT compiler it compiler - based machine code, CLR task is not completed. Used. NET Framework prepared by the implementation of the code (often referred to as the stage of operation (runti me) is the custodian. That the CLR manages the application
39、s, and its methods are memory management, handling security, and allow for cross-language debugging. Conversely, not CLR running under control of non-custody procedures, some languages such as C + + can be used in the preparation of such application, for example, visited the base operating system fu
40、nctions. However, in C #, can only prepare in the Trusteeship Council run under the code. We will use CLR functions of the Trusteeship Council,. NET operating system with its own interactive. 7. Garbage collector managed one of the most important functions of the garbage collector (garbage collectio
41、 n). This species. NET will ensure that applications would no longer use certain memory, the memory which will be completely released. In. NET introduced to the former, this primarily by programmers responsible, code of a few simple mistakes will be large memory allocation to the wrong places, so th
42、at these mysterious disappearance of memory. This usually means that the speed of the computer has gradually slowed down and eventually led to the collapse. . NET trash recycling frequent checks of computer memory, will no longer need to remove the contents. It does not set the time frame may be one
43、 of seconds for the 1,000 th inspection, may also check a few seconds. or check at any time, but certainly for the inspection. Here to give programmers some hints. Because this work in an unpredictable time, the application of the design process, we must remember to conduct such inspections. Many memory needed to run their own code of the implementation of such checks, instead of waiting for the garbag
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 合伙人經(jīng)營協(xié)議書
- 醫(yī)院擦玻璃合同范本
- 保姆聘請合同范本
- 合同標注正規(guī)合同范本
- 廠房抵賬合同范本
- 三亞合同范本
- 廠房 轉(zhuǎn)讓 出租合同范本
- 雙擁賓館合同范本
- 廚房用工合同范本
- 雙甲方施工合同范本
- 2017年公務員多省聯(lián)考《申論》真題(吉林甲級卷)及參考答案(含詳細解析)
- 《水利工程質(zhì)量檢測管理規(guī)定》知識培訓
- 2025年02月貴州省司法廳所屬事業(yè)單位公開招聘2人筆試歷年典型考題(歷年真題考點)解題思路附帶答案詳解
- 2025年校長春季開學思政第一課講話稿1720字例文【供參考】
- 2025至2030年中國單板電磁制動器數(shù)據(jù)監(jiān)測研究報告
- 2024年07月國新國證期貨有限責任公司(海南)2024年招考2名工作人員筆試歷年參考題庫附帶答案詳解
- 2021年考研英語一真題
- 人教版數(shù)學八年級下冊 第17章 勾股定理 單元測試(含答案)
- 法規(guī)解讀丨2024新版《突發(fā)事件應對法》及其應用案例
- JGJ46-2024 建筑與市政工程施工現(xiàn)場臨時用電安全技術(shù)標準
- 肺炎的中醫(yī)護理方案
評論
0/150
提交評論