+ All Categories
Home > Documents > Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft SA @ NYIT.

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

Date post: 21-Dec-2015
Category:
View: 223 times
Download: 3 times
Share this document with a friend
22
Lesson 1 Lesson 1 What is .NET What is .NET Prepared by Shawn Dossie Microsoft SA @ NYIT
Transcript
Page 1: Lesson 1 What is.NET Prepared by Shawn Dossie Microsoft SA @ NYIT.

Lesson 1Lesson 1What is .NETWhat is .NET

Prepared by Shawn Dossie

Microsoft SA @ NYIT

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

Learning ObjectivesLearning Objectives

By the end of this week you will be By the end of this week you will be able to:able to:• Understand the reasons for the Understand the reasons for the

creation .NETcreation .NET• Learn the core goals of the .NET Learn the core goals of the .NET

initiativeinitiative• Describe at a high level of detail the Describe at a high level of detail the

core components of the .NET core components of the .NET Framework. Framework.

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

The Need For .NETThe Need For .NET

Complexity of Software development Complexity of Software development processprocess• Distributed systemsDistributed systems• Development timeDevelopment time• Version control & updates Version control & updates (The end to DLL Hell!)(The end to DLL Hell!)

• Language Interoperability Language Interoperability (Replaces COM Model)(Replaces COM Model)

• Componentized-based Software Engineering Componentized-based Software Engineering (Lego-block dev.)(Lego-block dev.)

• SecuritySecurity Making Services available to users Making Services available to users

anywhere in the worldanywhere in the world

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

The Objectives of .NETThe Objectives of .NET To provide a consistent object-oriented To provide a consistent object-oriented

programming environment whether object code is programming environment whether object code is stored and executed locally, executed locally but stored and executed locally, executed locally but Internet-distributed, or executed remotely. Internet-distributed, or executed remotely.

To provide a code-execution environment that To provide a code-execution environment that minimizes software deployment and versioning minimizes software deployment and versioning conflicts. conflicts.

To provide a code-execution environment that To provide a code-execution environment that guarantees safe execution of code, including guarantees safe execution of code, including code created by an unknown or semi-trusted third code created by an unknown or semi-trusted third party. party.

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

The Objectives of .NET (cont.)The Objectives of .NET (cont.)

To provide a code-execution environment that To provide a code-execution environment that eliminates the performance problems of scripted eliminates the performance problems of scripted or interpreted environments. or interpreted environments.

To make the developer experience consistent To make the developer experience consistent across widely varying types of applications, such across widely varying types of applications, such as Windows-based applications and Web-based as Windows-based applications and Web-based applications. applications.

To build all communication on industry standards To build all communication on industry standards to ensure that code based on the .NET Framework to ensure that code based on the .NET Framework can integrate with any other code. can integrate with any other code.

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

The Objectives of .NET The Objectives of .NET (Quick and Dirty Overview)(Quick and Dirty Overview)

Consistent programming modelConsistent programming model Simplified programming modelSimplified programming model Run once, run alwaysRun once, run always Simplified deploymentSimplified deployment Wide platform reachWide platform reach Programming integrationProgramming integration Simplified code reuseSimplified code reuse Automatic memory managementAutomatic memory management Type safe verificationType safe verification Rich debugging supportRich debugging support Consistent method failure paradigmConsistent method failure paradigm SecuritySecurity InteroperabilityInteroperability

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

The Implementation of the Goals of The Implementation of the Goals of .NET Initiative.NET Initiative

The The .NET Framework.NET Framework is the is the realreal software product that meets software product that meets objectives and requirements of objectives and requirements of the .NET initiative the .NET initiative

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

The .NET Framework in ContextThe .NET Framework in Context

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

Main Components of the .NET Main Components of the .NET FrameworkFramework

Common Language Runtime (CLR)Common Language Runtime (CLR) Foundation Class Library (FCL)Foundation Class Library (FCL)

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

Common Language Runtime (CLR)Common Language Runtime (CLR)

Considered the Considered the foundationfoundation of of the .NET Frameworkthe .NET Framework

Thought if as an Thought if as an agent agent that:that:• Manages code at runtime, providing Manages code at runtime, providing

core services as:core services as: Memory managementMemory management Thread managementThread management Enforcing Enforcing strictstrict type safety (CTS) type safety (CTS) Code access securityCode access security

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

Common Type SystemCommon Type System

Ensures compatibility between . NET Ensures compatibility between . NET Types.Types.

All Primitive data types for all .NET All Primitive data types for all .NET compliant languages are .NET types.compliant languages are .NET types.• These types are converted to IL during These types are converted to IL during

the compilation process.the compilation process.

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

Developer Benefits from the CLRDeveloper Benefits from the CLR

The CLR provides the following benefits to The CLR provides the following benefits to developers using .NET:developers using .NET:• Automatic object referencing and garbage Automatic object referencing and garbage

collection. Solves two BIG problems:collection. Solves two BIG problems: Invalid memory referencesInvalid memory references Memory Leaks Memory Leaks

• Accelerated productivityAccelerated productivity ALL .NET compliant Languages can access, consume, ALL .NET compliant Languages can access, consume,

and use all features of the .NET framework. and use all features of the .NET framework.

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

Foundation Class Library (FCL)Foundation Class Library (FCL) An extensive, object-oriented library of classes An extensive, object-oriented library of classes

(types) that provide the core functionally of .NET.(types) that provide the core functionally of .NET. Tight integration with the CLRTight integration with the CLR Extensible; you can derive your own types form Extensible; you can derive your own types form

existing types.existing types. Common programming tasks are handled Common programming tasks are handled

efficiently and logically. Some examples are: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

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

Specialized ApplicationsSpecialized Applications

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

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

The Structure of a .NET ApplicationThe 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, An assembly is a self-describing collection of code,

resources, and metadata. resources, and metadata. The assembly manifest stores information about the The assembly manifest stores information about the

contents of an assembly. contents of an assembly. • The assembly manifest provides:The assembly manifest provides:

Identity information, such as the assembly’s name and version Identity information, such as the assembly’s name and version numbernumber

A list of all types exposed by the assemblyA list of all types exposed by the assembly A list of other assemblies required by the assemblyA list of other assemblies required by the assembly A list of code access security instructions, including permissions A list of code access security instructions, including permissions

required by the assembly and permissions to be denied the required by the assembly and permissions to be denied the assemblyassembly

• 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 The assembly manifest can be contained in its own file or

within one of the assembly’s modules.within one of the assembly’s modules.

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

The Structure of a .NET Application (cont.)The Structure of a .NET Application (cont.)

Types are templates that describe a set of data Types are templates that describe a set of data encapsulation and functionality. 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 Each type is described to the common language runtime in the assembly manifest. 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.• Properties Properties

Properties are similar to fields, but properties usually provide some Properties are similar to fields, but properties usually provide some kind of validation when data is set or retrieved.kind of validation when data is set or retrieved.

• MethodsMethods Methods represent behavior.Methods represent behavior.

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

Compilation of a .NET ApplicationCompilation of a .NET Application

When you compile a .NET application, it is When you compile a .NET application, it is not compiled to binary machine code; not compiled to binary machine code; rather, it is converted to IL. rather, it is converted to IL.

The application consists of one or more The application consists of one or more assemblies consisting of executable files assemblies consisting of executable files and DLL files in IL form. At least one of and DLL files in IL form. At least one of these assemblies will contain an these assemblies will contain an executable file that has been designated executable file that has been designated as the entry point for the application.as the entry point for the application.

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

Execution of a .NET ApplicationExecution of a .NET Application Execution of a .NET ApplicationExecution 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 At this point, the common language runtime

examines the assembly manifest and determines the examines the assembly manifest and determines the requirements to run the program. requirements to run the program.

• The CLR examines security permissions The CLR examines security permissions requested by the assembly and compares requested by the assembly and compares them with the system’s security policy. them with the system’s security policy.

If the system’s security policy does not allow the If the system’s security policy does not allow the requested permissions, the application will not run. requested permissions, the application will not run.

• If the application passes the system’s security If the application passes the system’s security policy, the CLR executes the code. policy, the CLR executes the code.

• It creates a process for the application and It creates a process for the application and begins application execution.begins application execution.

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

Execution of a .NET Application (cont.)Execution of a .NET Application (cont.)

• When execution starts, the first bit of code that needs to When execution starts, the first bit of code that needs to be executed is loaded into memory compiled into native be executed is loaded into memory compiled into native binary code from IL by the common language runtime’s binary code from IL by the common language runtime’s Just-In-Time (JIT) compiler. Just-In-Time (JIT) compiler.

• Once compiled, the code is executed and stored in Once compiled, the code is executed and stored in memory as native code. memory as native code.

• Thus, each portion of code is compiled only once when Thus, each portion of code is compiled only once when an application executes. an application executes.

• Whenever program execution branches to code that has Whenever program execution branches to code that has not yet run, the JIT compiler compiles it ahead of not yet run, the JIT compiler compiles it ahead of execution and stores it in memory as binary code. This execution and stores it in memory as binary code. This way, application performance is maximized because way, application performance is maximized because only the parts of a program that are executed are only the parts of a program that are executed are compiled.compiled.

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

SummarySummary .NET was needed because Software is hard to .NET was needed because Software is hard to

develop; and it is just getting harder with the develop; and it is just getting harder with the passage of time.passage of time.

.NET solves many development problems by .NET solves many development problems by standardizing certain elements of the standardizing certain elements of the programming environment.programming environment.

The Common Language Runtime and the The Common Language Runtime and the Foundation Class Library are the core Foundation Class Library are the core components of the .NET Framework. These components of the .NET Framework. These components are what make the promises of .NET components are what make the promises of .NET real. real.

.NET applications are not complied like traditional .NET applications are not complied like traditional applications.applications.

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

ReferencesReferences

.NET Framework Developer's Guide .NET Framework Developer's Guide (inside help docs)(inside help docs)

Applied . Net Framework Applied . Net Framework Programming, Richter; Microsoft Programming, Richter; Microsoft Press 2002Press 2002

Introducing Microsoft .NET, Platt; Introducing Microsoft .NET, Platt; Microsoft Press 2001;Microsoft Press 2001;

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

Any Questions?Any Questions?


Recommended