Lập trình Windows - Lập Trình C #- Lập Trình C Shap - Chapter_1_Overview pot

28 351 0
Lập trình Windows - Lập Trình C #- Lập Trình C Shap - Chapter_1_Overview pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter I Framework and C# Overview 1 Content Content Part 1: NET Framework 1. CLR, FCL, CTS 2. Namespace 3. Managed code 4. Garbage collection 5. .NET framework architecture Part 2: C# overview 1. Features 2. IDE 2 .NET FRAMEWORK .NET FRAMEWORK PART I 3 .NET Framework .NET Framework 4 .NET 1.1 .NET 1.1 (Apr-2003) VS .NET 2003 Default: Server 2003 .NET 3.5 .NET 3.5 (Nov-2007) VS.NET 2008 Default: Windows 7 .NET 3.0 .NET 3.0 (Nov-2006) Default: Windows Vista, Server 2008 .NET 2.0 .NET 2.0 (Nov-2005) VS.NET 2005 . . NET 1.0 NET 1.0 (Feb-2002) Net 4.0 What is the .NET framework What is the .NET framework  The .NET Framework is Microsoft’s latest development platform, and is currently in version 4  Key motivations:  Means of integrating disparate operating systems (Linux, Mac OS,…)  No restriction on the type of applications: .NET Framework enables the creation of Windows applications, Web applications, Web services…  Can be used from any language, including C#, C+ +, Visual Basic, JScript, and even older languages such as COBOL 5 What’s in the .NET What’s in the .NET Framework? Framework?  .NET Framework consists primarily of a gigantic library of code that you use from your client languages (such as C#) using object-oriented programming (OOP) techniques.  Framework Class Library (FCL) contains thousands of classes to provide access to Windows API and common functions like String Manipulation, Common Data Structures, IO, Streams, Threads, Security, Network Programming, Windows Programming, Web Programming, Data Access, etc.  You can use the classes in FCL in your program just as you would use any other class. You can even apply inheritance and polymorphism to these classes. 6 Common Type System (CTS) Common Type System (CTS)  Part of the .NET Framework library defines some basic types.  A type is a representation of data, and specifying some of the most fundamental of facilitates interoperability between languages using the .NET Framework.  This is called the Common Type System (CTS).  Example: CTS defines a type, Int32, an integral data type of 32 bits (4 bytes) which is mapped by int of C# and Integer of VB.Net 7 Common Language Runtime Common Language Runtime (CLR) (CLR)  .NET Common Language Runtime (CLR), which is responsible for maintaining the execution of all applications developed using the .NET library.  Our programs don't directly communicate with the OS but go through the CLR 8 Executing an application using the.NET Executing an application using the.NET framework framework  In order for C# code to execute, it must be converted into a language that the target operating system understands, known as native code.  This conversion is called compiling code, an act that is performed by a compiler.  Under the .NET Framework, this is a two-stage process.  Compile your code into Common Intermediate Language (CIL) code.  JIT compiler (just-in-time) compiles CIL into native code that is specific to the OS and machine architecture being targeted. 9  IL (Intermediate Language)  MSIL (Microsoft Intermediate Language)  CIL (Common Intermediate Language)  Alternate calling ways of the Intermediate language 10 [...]... you can rest assured that it will happen 13 14 15 CT C# .NET C# Compiler CT VB.NET VB NET Compiler Programmer MS IL CLR CT J#.NET CT C+ +.NET 0 101101 0 101101 0 101101 J# NET Compiler C+ + Compiler 16 .NET Framework - Architecture  Common Language Infrastructure (CLI)  provide a languageneutral platform for application development and execution 17 .NET Framework - Architecture  Net Framework is the combination... layers of CLR, FCL, Data and XML Classes and our Windows, Web applications and Web Services 18 Framework base classes   Is the layer on top of the CLR The NET Framework class library exposes features of the runtime and provides other high-level services that every programmer needs by means of namespaces 19 System Namespaces (1)    Contains fundamental classes and base classes Define commonly-used... namespace provides:  file input /output (I/O), streams, and so on System.Net namespace provides:  Transmission Control Protocol/Internet Protocol (TCP/IP) and sockets support 21 PART II C# OVERVIEW 22 C#    C# is one of the languages included in the NET Framework It is an evolution of previous languages such as C+ +, and can be used to write any number of applications, including both web sites and Windows. .. reference data types, events and event handlers, interfaces, attributes, and processing exceptions Other classes provide services supporting:        data type conversion method parameter manipulation Mathematics remote and local program invocation application environment management supervision of managed unmanaged applications 20 System Namespaces (2)    System.Collections namespace:  provides... you compile an application, the CIL code created is stored in an assembly Assemblies include:  Executable application files (.exe ) and libraries (.dll )  meta information (about the information contained in the assembly) and optional resources (additional data used by the CIL, such as sound files and pictures) 11 Managed Code     Code written using the NET Framework is managed when it is executed... executed CLR looks after your applications by managing memory, handling security, allowing cross-language debugging, Applications that do not run under the control of the CLR are said to be unmanaged In C# you can write only code that runs in a managed environment You will make use of the managed features of the CLR and allow NET itself to handle any interaction with the operating system 12 Garbage Collection... both web sites and Windows applications C# is object oriented and contains a powerful class library of prebuilt components, enabling programmers to develop applications quickly C# is an event-driven, visual programming language in which programs are created using an Integrated Development Environment (IDE) 23 Overview of Features Added in Strong 2.0 C# type   Generics  Iterators  Partial types ... in C# 3.0        Implicitly Typed Local Variables (type inference) Object and Collection Initializers Extension Methods Partial Methods Anonymous Types Query Keywords Lambda Expressions Integrated Development Environment (IDE)  You can use Visual Studio 2010 to write any type of NET application using C# You can also use the free, but less powerful, express product range (including Visual C# ... free, but less powerful, express product range (including Visual C# Developer Express) to create NET applications in C# Both of these IDEs work with solutions, which can consist of multiple projects 26 Design view of IDE 27 Some application types     Console application Windows application WPF application Web application ( + ASP.NET) 28 ... used by an application is freed up completely when the application is no longer in use Prior to NET this was mostly the responsibility of programmers .NET garbage collection works by periodically inspecting the memory of your computer and removing anything from it that is no longer needed There is no set time frame for this; it might happen thousands of times a second, once every few seconds, or whenever, . you can rest assured that it will happen. 13 14 15 16 MS IL CLR C+ + Compiler C# Compiler J# .NET Compiler CT C# .NET CT VB.NET CT C+ +.NET CT J#.NET VB .NET Compiler 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 Programmer Programmer .NET. Chapter I Framework and C# Overview 1 Content Content Part 1: NET Framework 1. CLR, FCL, CTS 2. Namespace 3. Managed code 4. Garbage collection 5. .NET framework architecture Part 2: C# overview 1. . Compiler 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 1 0 1 0 Programmer Programmer .NET Framework - Architecture .NET Framework - Architecture  Common Language Infrastructure (CLI)  provide a language- neutral platform for application

Ngày đăng: 12/07/2014, 02:20

Từ khóa liên quan

Mục lục

  • Slide 1

  • Content

  • .net framework

  • .NET Framework

  • What is the .NET framework

  • What’s in the .NET Framework?

  • Common Type System (CTS)

  • Common Language Runtime (CLR)

  • Executing an application using the.NET framework

  • Slide 10

  • Assemblies

  • Managed Code

  • Garbage Collection

  • Slide 14

  • Slide 15

  • Slide 16

  • .NET Framework - Architecture

  • Slide 18

  • Framework base classes

  • System Namespaces (1)

Tài liệu cùng người dùng

Tài liệu liên quan