Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft NYIT.

Similar presentations


Presentation on theme: "Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft NYIT."— Presentation transcript:

1 Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft SA @ NYIT

2 Learning Objectives By the end of this week you will be able to: By the end of this week you will be able to: Understand the reasons for the creation.NETUnderstand the reasons for the creation.NET Learn the core goals of the.NET initiativeLearn the core goals of the.NET initiative Describe at a high level of detail the core components of the.NET Framework.Describe at a high level of detail the core components of the.NET Framework.

3 The Need For.NET Complexity of Software development process Complexity of Software development process Distributed systemsDistributed systems Development timeDevelopment time Version control & updates (The end to DLL Hell!)Version control & updates (The end to DLL Hell!) Language Interoperability (Replaces COM Model)Language Interoperability (Replaces COM Model) Componentized-based Software Engineering (Lego-block dev.)Componentized-based Software Engineering (Lego-block dev.) SecuritySecurity Making Services available to users anywhere in the world Making Services available to users anywhere in the world

4 The Objectives of.NET To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party. To provide a code-execution environment that guarantees safe execution of code, including code created by an unknown or semi-trusted third party.

5 The Objectives of.NET (cont.) To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications. To make the developer experience consistent across widely varying types of applications, such as Windows-based applications and Web-based applications. To build all communication on industry standards to ensure that code based on the.NET Framework can integrate with any other code. To build all communication on industry standards to ensure that code based on the.NET Framework can integrate with any other code.

6 The Objectives of.NET (Quick and Dirty Overview) Consistent programming model Consistent programming model Simplified programming model Simplified programming model Run once, run always Run once, run always Simplified deployment Simplified deployment Wide platform reach Wide platform reach Programming integration Programming integration Simplified code reuse Simplified code reuse Automatic memory management Automatic memory management Type safe verification Type safe verification Rich debugging support Rich debugging support Consistent method failure paradigm Consistent method failure paradigm Security Security Interoperability Interoperability

7 The Implementation of the Goals of.NET Initiative The.NET Framework is the real software product that meets objectives and requirements of the.NET initiative The.NET Framework is the real software product that meets objectives and requirements of the.NET initiative

8 The.NET Framework in Context

9 Main Components of the.NET Framework Common Language Runtime (CLR) Common Language Runtime (CLR) Foundation Class Library (FCL) Foundation Class Library (FCL)

10 Common Language Runtime (CLR) Considered the foundation of the.NET Framework Considered the foundation of the.NET Framework Thought if as an agent that: Thought if as an agent that: Manages code at runtime, providing core services as:Manages code at runtime, providing core services as: Memory management Memory management Thread management Thread management Enforcing strict type safety (CTS) Enforcing strict type safety (CTS) Code access security Code access security

11 Common Type System Ensures compatibility between. NET Types. Ensures compatibility between. NET Types. All Primitive data types for all.NET compliant languages are.NET types. All Primitive data types for all.NET compliant languages are.NET types. These types are converted to IL during the compilation process.These types are converted to IL during the compilation process.

12 Developer Benefits from the CLR The CLR provides the following benefits to developers using.NET: The CLR provides the following benefits to developers using.NET: Automatic object referencing and garbage collection. Solves two BIG problems:Automatic object referencing and garbage collection. Solves two BIG problems: Invalid memory references Invalid memory references Memory Leaks Memory Leaks Accelerated productivity Accelerated productivity ALL.NET compliant Languages can access, consume, and use all features of the.NET framework. ALL.NET compliant Languages can access, consume, and use all features of the.NET framework.

13 Foundation Class Library (FCL) An extensive, object-oriented library of classes (types) that provide the core functionally of.NET. An extensive, object-oriented library of classes (types) that provide the core functionally of.NET. Tight integration with the CLR Tight integration with the CLR Extensible; you can derive your own types form existing types. Extensible; you can derive your own types form existing types. Common programming tasks are handled efficiently and logically. Some examples are: Common programming tasks are handled efficiently and logically. Some examples are: String managementString management Data collectionsData collections File accessFile access Windows/Web UI And ServicesWindows/Web UI And Services Database connectivityDatabase connectivity

14 Specialized Applications The FCL inherently supports these typical development scenarios, providing specialized types for ease of implementation: The FCL inherently supports these typical development scenarios, providing specialized types for ease of implementation: Console AppsConsole Apps Windows AppsWindows Apps ASP.NET AppsASP.NET Apps Web AppsWeb Apps XML Web ServicesXML Web Services Windows ServicesWindows Services

15 The Structure of a.NET Application The primary unit of a.NET application is the assembly. The primary unit of a.NET application is the assembly. An assembly is a self-describing collection of code, resources, and metadata. An assembly is a self-describing collection of code, resources, and metadata. The assembly manifest stores information about the contents of an assembly. The assembly manifest stores information about the contents of an assembly. The assembly manifest provides:The assembly manifest provides: Identity information, such as the assembly’s name and version number Identity information, such as the assembly’s name and version number A list of all types exposed by the assembly A list of all types exposed by the assembly A list of other assemblies required by the assembly A list of other assemblies required by the assembly A list of code access security instructions, including permissions required by the assembly and permissions to be denied the assembly A list of code access security instructions, including permissions required by the assembly and permissions to be denied the assembly Each assembly has one and only one assembly manifestEach assembly has one and only one assembly manifest The assembly manifest can be contained in its own file or within one of the assembly’s modules.The assembly manifest can be contained in its own file or within one of the assembly’s modules.

16 The Structure of a.NET Application (cont.) Types are templates that describe a set of data encapsulation and functionality. Types are templates that describe a set of data encapsulation and functionality. There are two kinds of types:There are two kinds of types: Reference types (classes) Reference types (classes) Value types (structures). Value types (structures). Each type is described to the common language runtime in the assembly manifest. Each type is described to the common language runtime in the assembly manifest. A type can contain: A type can contain: FieldsFields A field represents storage of a particular type of data. A field represents storage of a particular type of data. PropertiesProperties Properties are similar to fields, but properties usually provide some kind of validation when data is set or retrieved. Properties are similar to fields, but properties usually provide some kind of validation when data is set or retrieved. MethodsMethods Methods represent behavior. Methods represent behavior.

17 Compilation of a.NET Application When you compile a.NET application, it is not compiled to binary machine code; rather, it is converted to IL. When you compile a.NET application, it is not compiled to binary machine code; rather, it is converted to IL. The application consists of one or more assemblies consisting of executable files and DLL files in IL form. At least one of these assemblies will contain an executable file that has been designated as the entry point for the application. The application consists of one or more assemblies consisting of executable files and DLL files in IL form. At least one of these assemblies will contain an executable file that has been designated as the entry point for the application.

18 Execution of a.NET Application Execution of a.NET Application Execution of a.NET Application The first assembly is loaded into memory.The first assembly is loaded into memory. At this point, the common language runtime examines the assembly manifest and determines the requirements to run the program. At this point, the common language runtime examines the assembly manifest and determines the requirements to run the program. The CLR examines security permissions requested by the assembly and compares them with the system’s security policy.The CLR examines security permissions requested by the assembly and compares them with the system’s security policy. If the system’s security policy does not allow the requested permissions, the application will not run. If the system’s security policy does not allow the requested permissions, the application will not run. If the application passes the system’s security policy, the CLR executes the code.If the application passes the system’s security policy, the CLR executes the code. It creates a process for the application and begins application execution.It creates a process for the application and begins application execution.

19 Execution of a.NET Application (cont.) When execution starts, the first bit of code that needs to be executed is loaded into memory compiled into native binary code from IL by the common language runtime’s Just-In-Time (JIT) compiler.When execution starts, the first bit of code that needs to be executed is loaded into memory compiled into native binary code from IL by the common language runtime’s Just-In-Time (JIT) compiler. Once compiled, the code is executed and stored in memory as native code.Once compiled, the code is executed and stored in memory as native code. Thus, each portion of code is compiled only once when an application executes.Thus, each portion of code is compiled only once when an application executes. Whenever program execution branches to code that has not yet run, the JIT compiler compiles it ahead of execution and stores it in memory as binary code. This way, application performance is maximized because only the parts of a program that are executed are compiled.Whenever program execution branches to code that has not yet run, the JIT compiler compiles it ahead of execution and stores it in memory as binary code. This way, application performance is maximized because only the parts of a program that are executed are compiled.

20 Summary.NET was needed because Software is hard to develop; and it is just getting harder with the passage of time..NET was needed because Software is hard to develop; and it is just getting harder with the passage of time..NET solves many development problems by standardizing certain elements of the programming environment..NET solves many development problems by standardizing certain elements of the programming environment. The Common Language Runtime and the Foundation Class Library are the core components of the.NET Framework. These components are what make the promises of.NET real. The Common Language Runtime and the Foundation Class Library are the core components of the.NET Framework. These components are what make the promises of.NET real..NET applications are not complied like traditional applications..NET applications are not complied like traditional applications.

21 References.NET Framework Developer's Guide (inside help docs).NET Framework Developer's Guide (inside help docs) Applied. Net Framework Programming, Richter; Microsoft Press 2002 Applied. Net Framework Programming, Richter; Microsoft Press 2002 Introducing Microsoft.NET, Platt; Microsoft Press 2001; Introducing Microsoft.NET, Platt; Microsoft Press 2001;

22 Any Questions?


Download ppt "Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft NYIT."

Similar presentations


Ads by Google