今日要點(diǎn):
- .net core/mono/.net framework
- net 體系四大組成部分
- .net core/framework/standard之間關(guān)系
- 什么是.net standard
.net core/mono/.net framework
Historically, the .NET Framework has only worked on Windows devices. 【不能跨平臺(tái),只能在windows上使用锁孟,稱為.net framework】
The Xamarin and Mono projects worked to bring .NET to mobile devices, macOS, and Linux. 【非微軟血統(tǒng)的.net跨平臺(tái)實(shí)現(xiàn)】
.NET Core provides a standard base library that can now be used across Windows, Linux, macOS, and mobile devices (via Xamarin).【微軟血統(tǒng)的.net跨平臺(tái)實(shí)現(xiàn),稱為.net core】
There are four major components of .NET architecture:【.net 體系有四部分組成】
-
Common language specification【公共語言規(guī)范,既公共類型系統(tǒng)。】
(CLS) defines how objects are implemented so they work everywhere .NET works. CLS is a subset of Common Type System (CTS) — which sets a common way to describe all types.
-
Framework class library【類庫,類似JDK】
(FCL) is a standard library that collects reusable classes, interfaces, and value types.
-
Common language runtime【公共語言運(yùn)行時(shí)伯病,類似JVM】
(CLR) is the virtual machine that runs the framework and manages the execution of .NET programs.
Tools such as Visual Studio
to create standalone applications, interactive websites, web applications and web services.
.NET Core vs .NET Framework【.net core/.net framework/.net standard之間的關(guān)系】
Microsoft maintains both runtimes for building applications with .NET, and they share many of the same APIs. This shared API is what is called the .NET Standard.
什么是.net standard(標(biāo)準(zhǔn)庫)
The.NET Standard is a formal specification of .NET APIs that are intended to be available on all .NET implementations. The motivation behind the .NET Standard is establishing greater uniformity in the .NET ecosystem. [ECMA 335(https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/dotnet-standards.md)
continues to establish uniformity for .NET implementation behavior, but there is no similar spec for the .NET Base Class Libraries (BCL) for .NET library implementations.
The .NET Standard enables the following key scenarios:
- Defines uniform set of BCL APIs for all .NET implementations to implement, independent of workload.
- Enables developers to produce portable libraries that are usable across .NET implementations, using this same set of APIs.
- Reduces or even eliminates conditional compilation of shared source due to .NET APIs, only for OS APIs.