.NET Architecture and Component
Lesson 3: .NET Architecture and Components
In this lesson, you will learn about the architecture of .NET and its main components that make development easier and more powerful.
🏛️ High-Level Architecture
.NET consists of several building blocks that work together:
- Common Language Runtime (CLR): The execution engine that runs your code and provides services like garbage collection and security.
- Base Class Library (BCL): A set of APIs for common tasks such as collections, file I/O, and data types.
- Languages: C#, F#, Visual Basic, and more, all compiled to Intermediate Language (IL).
- Application Models: Web, desktop, mobile, cloud, IoT.
⚙️ Common Language Runtime (CLR)
The CLR is the heart of .NET. It performs:
- Memory management: Automatic garbage collection.
- Exception handling: Unified error management.
- Type safety: Ensures code correctness and security.
- Just-In-Time (JIT) compilation: Compiles IL code to native machine code.
📚 Base Class Library (BCL)
The BCL provides essential classes and types you use every day:
- System.Collections: Lists, dictionaries, and more.
- System.IO: Reading and writing files.
- System.Linq: Querying collections.
- System.Net: Networking capabilities.
🧩 Application Models
.NET supports multiple application types:
- ASP.NET Core: For building modern web apps and APIs.
- Windows Forms & WPF: For building Windows desktop apps.
- Xamarin / .NET MAUI: For cross-platform mobile apps.
- Console Applications: For lightweight utilities and services.
🌟 .NET Standard
.NET Standard defines a set of APIs that all .NET implementations must support, making libraries cross-platform compatible.
- Helps create reusable libraries.
- Ensures compatibility across .NET Framework, .NET Core, and Xamarin.
💡 Example: Basic .NET Program
Here is a simple C# console app:
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, .NET Architecture!");
}
}
📝 Summary
.NET architecture is designed to be flexible and powerful. Understanding the CLR, BCL, and application models helps you build robust apps across different platforms.
✅ Next Lesson
Lesson 4: Understanding the Common Language Runtime (CLR) in Depth
تعليقات
إرسال تعليق