+ All Categories
Home > Software > .NET Overview

.NET Overview

Date post: 12-Apr-2017
Category:
Upload: greg-sohl
View: 300 times
Download: 0 times
Share this document with a friend
63
.NET Overview .NET Overview Presented by Presented by Greg Sohl Greg Sohl
Transcript
Page 1: .NET Overview

.NET Overview.NET Overview

Presented by Presented by Greg SohlGreg Sohl

Page 2: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 3: .NET Overview

What to ExpectWhat to Expect

Gain a general understanding of what .NET Gain a general understanding of what .NET is, does and the facilities it provides.is, does and the facilities it provides.

Page 4: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 5: .NET Overview

.NET from 20,000 Feet.NET from 20,000 Feet

HistoryHistory Application styles and expectationsApplication styles and expectations API SetsAPI Sets Java / J2EEJava / J2EE

Page 6: .NET Overview

.NET from 20,000 Feet.NET from 20,000 Feet

What it isWhat it is It’s a Software Development SystemIt’s a Software Development System It’s a Runtime SystemIt’s a Runtime System

Addresses Major Software IssuesAddresses Major Software Issues DLL HellDLL Hell Installation ComplexityInstallation Complexity Software Security – Safety of using softwareSoftware Security – Safety of using software

It’s all new, right?It’s all new, right?

Page 7: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 8: .NET Overview

Major .NET PiecesMajor .NET Pieces

.NET Framework.NET Framework Common Language RuntimeCommon Language Runtime .NET Framework Class Library.NET Framework Class Library

LanguagesLanguagesHostsHosts.NET Servers.NET ServersTools – Visual Studio.NETTools – Visual Studio.NET

Page 9: .NET Overview

Hosts

Major .NET PiecesMajor .NET Pieces

Common Language Runtime Common Language Runtime

Framework Class LibraryFramework Class Library

VBVB C++C++ C#C#

Visual Visual

Studio.NET

Studio.NET

JScriptJScript ……

.NET Enterprise

.NET Enterprise

ServersServers

IEIE ShellShell IIS / ASP.NETIIS / ASP.NET

Page 10: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 11: .NET Overview

Comparing EnvironmentsComparing EnvironmentsThe J2EE/.NET Pet Shop ComparisonThe J2EE/.NET Pet Shop Comparison

Page 12: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 13: .NET Overview

Programming in .NETProgramming in .NET

Language neutral designLanguage neutral design

Supported by many languagesSupported by many languages C#, VB.NET, C++C#, VB.NET, C++ JScript.NETJScript.NET Visual J++Visual J++ Delphi (Pascal)Delphi (Pascal) COBOL, Perl, Eiffel, Python, COBOL, Perl, Eiffel, Python,

Smalltalk,Smalltalk,

Page 14: .NET Overview

Programming in .NETProgramming in .NET

Common Type SystemCommon Type System Defines how types are declared, Defines how types are declared,

used, and managed in the runtime used, and managed in the runtime

Defines .NETs OO ModelDefines .NETs OO ModelAll Types inherit from System.ObjectAll Types inherit from System.Object

Provides a common set of Types Provides a common set of Types that “can be” implemented by that “can be” implemented by programming languagesprogramming languages

Page 15: .NET Overview

Programming in .NETProgramming in .NETAnatomy of a type

Type definitions are composed of zero or more member declarations that make the type useful

Fields have storage and hold values of a given type

Methods have signatures and code and represent operations

Constructors are special methods invoked at init-time

Properties and events are hints about method semantics

Nested types provide implementation support for their surrounding type

Access to members can be restricted to intra-type or intraassembly for encapsulation

Page 16: .NET Overview

Programming in .NETProgramming in .NETCommon Type SystemCommon Type System

Page 17: .NET Overview

Programming in .NETProgramming in .NET

The Common Language Specification (CLS) subsets the universally supported types

Page 18: .NET Overview

Programming in .NETProgramming in .NET

Assemblies and the .NET Framework The Common Language Runtime requires all

types to belong to an assembly. Assemblies act as the smallest distribution unit for component code in the .NET Framework.

Page 19: .NET Overview

Programming in .NETProgramming in .NET

Assemblies defined Assemblies are used to package and

distribute executable codeAssemblies are the atom of deployment in the CLRAssemblies are collections of type definitionsType names are scoped by their containing assemblySecurity BoundaryVersion Boundary

Page 20: .NET Overview

Programming in .NETProgramming in .NET

Assemblies and modules An assembly consists of one or more physical files

known as modulesA module is an executable file containing code and metadataEach module may be produced using different programming languagesExactly one module in an assembly contains an assembly manifestCSC.EXE's /t:module and /addmodule switches support module-level compilation/referencesThe assembly linker al.exe can link multiple modules and create the manifest

Page 21: .NET Overview

Programming in .NETProgramming in .NET

Page 22: .NET Overview

Programming in .NETProgramming in .NET

CompilationCompilation Intermediate Language (IL)Intermediate Language (IL) Just-in-Time CompilationJust-in-Time Compilation

Page 23: .NET Overview

Programming in .NETProgramming in .NET

Assembly ContentsAssembly Contents Only the assembly manifest Only the assembly manifest

is required is required

Page 24: .NET Overview

Programming in .NETProgramming in .NET

Language of Choice – C#Language of Choice – C#Recognition of other language useRecognition of other language use JScript.NETJScript.NET VB.NETVB.NET Delphi.NETDelphi.NET Fujitsu COBOL.NETFujitsu COBOL.NET

Page 25: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 26: .NET Overview

Common Language RuntimeCommon Language Runtime.NET Components.NET Components

Operating SystemOperating System

Common Language SpecificationCommon Language Specification

Common Language RuntimeCommon Language Runtime

Framework Class Library (BCL)Framework Class Library (BCL)

VBVB C++C++ C#C# Visual Studio.NET

Visual Studio.NET

ASP.NET: Web ServicesASP.NET: Web Servicesand Web Formsand Web Forms

JScriptJScript ……

WindowsWindowsFormsForms

XML, ADO.NET, etc.XML, ADO.NET, etc.

Page 27: .NET Overview

CLR Environment CLR Environment

Common Common LanguageLanguage Runtime Runtime

.NET PE File.NET PE File.NET PE File.NET PE File .NET PE File.NET PE File

Page 28: .NET Overview

PE FilePE File

Native Image SectionNative Image Section.data, .rdata, .rsrc, .text.data, .rdata, .rsrc, .text

CLR DataCLR Data

CLR HeaderCLR Header

MetadataMetadata IL IL

PE/COFF HeadersPE/COFF Headers

Page 29: .NET Overview

MetadataMetadata

Assembly name, version, culture, and Assembly name, version, culture, and public key public key Types that it references Types that it references Types that it exportsTypes that it exportsSecurity requirements for execution Security requirements for execution Descriptions of classes, interfaces, Descriptions of classes, interfaces, methods, properties, fields, events, global methods, properties, fields, events, global methods, etc.. methods, etc..

Page 30: .NET Overview

Intermediate Language (IL)Intermediate Language (IL)

Generated by all .NET compilers Generated by all .NET compilers MSIL Instruction Set Specification MSIL Instruction Set Specification The IL Assembly Language Programmer’s The IL Assembly Language Programmer’s ReferenceReferenceCore of .NET programming Core of .NET programming Fully supports Object Oriented featuresFully supports Object Oriented features Data abstraction, inheritance, polymorphism Data abstraction, inheritance, polymorphism

Also supports exceptions and events Also supports exceptions and events

Page 31: .NET Overview

CLR ExecutablesCLR Executables

Hello World in 2 languagesHello World in 2 languages C#.NETC#.NETusing System;using System;Class MainAppClass MainApp{public static void Main(){public static void Main() { Console.WriteLine(“C# Hello, World!”);} { Console.WriteLine(“C# Hello, World!”);} }} VB.NETVB.NETImports SystemImports SystemPublic Module modmainPublic Module modmain

Sub Main()Sub Main()Console.WriteLine(“VB Hello, World!”)Console.WriteLine(“VB Hello, World!”)

End SubEnd SubEnd ModuleEnd Module

Page 32: .NET Overview

Examining MetadataExamining Metadata

IL disassembler ILDADM.EXEIL disassembler ILDADM.EXE Tree view Tree view Displays the Manifest Displays the Manifest CTL-d to dump to disk CTL-d to dump to disk

Page 33: .NET Overview

Reflection ClassesReflection Classes

System.Reflection namespaceSystem.Reflection namespaceAllows you to examine programmatically Allows you to examine programmatically the manifest of an assemblythe manifest of an assemblyThru Reflection.Emit you can create Thru Reflection.Emit you can create program modules on the flyprogram modules on the fly

Page 34: .NET Overview

CLR ExecutionCLR Execution

Class LoaderClass Loader

.NET PE Files (IL and metadata).NET PE Files (IL and metadata)

JIT Compilers

VerifierVerifier

JITJIT

Execution support and managementExecution support and managementGargage collection, security engine,Gargage collection, security engine,

Code manager, exception manager, threadingCode manager, exception manager, threading

Page 35: .NET Overview

Class LoaderClass LoaderLoads .NET classes into memory and Loads .NET classes into memory and prepares them for execution - searches:prepares them for execution - searches: .config file for the application.config file for the application GAC Global Assembly CacheGAC Global Assembly Cache MetadataMetadataCaches the type information so it doesn’t Caches the type information so it doesn’t have to load the class again have to load the class again Finally - initializes static variables and Finally - initializes static variables and instantiates an object of the loaded classinstantiates an object of the loaded class

Page 36: .NET Overview

JIT CompilerJIT Compiler

Converts IL to managed native codeConverts IL to managed native codeDynamically compile code that is optimized for Dynamically compile code that is optimized for the target machinethe target machineOnly the first time the method is invoked - reads Only the first time the method is invoked - reads the stub the class-loader created to flag a the stub the class-loader created to flag a method for compilation method for compilation Stays in memory until the process shuts downStays in memory until the process shuts downngen.exe – For pre jitting ngen.exe – For pre jitting

Page 37: .NET Overview

Common Language RuntimeCommon Language Runtime

The .NET Show The .NET Show Inside the CLRInside the CLR

Page 38: .NET Overview

CLR – Common Language Runtime CLR – Common Language Runtime Core of the .NET architectureCore of the .NET architectureVirtual Execution Engine manages codeVirtual Execution Engine manages codeLoads modulesLoads modulesVerifies typesVerifies typesJIT compilesJIT compilesGarbage collection, exception handling, Garbage collection, exception handling, security, debugging support, interop security, debugging support, interop

Summary Summary

Page 39: .NET Overview

Let’s Take a Break!Let’s Take a Break!

Page 40: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 41: .NET Overview

Framework Class LibraryFramework Class Library

Operating SystemOperating System

Common Language SpecificationCommon Language Specification

Common Language RuntimeCommon Language Runtime

Framework Class Library (BCL)Framework Class Library (BCL)

VBVB C++C++ C#C# Visual Studio.NET

Visual Studio.NET

ASP.NET: Web ServicesASP.NET: Web Servicesand Web Formsand Web Forms

JScriptJScript ……

WindowsWindowsFormsForms

XML, ADO.NET, etc.XML, ADO.NET, etc.

Page 42: .NET Overview

Framework Class LibraryFramework Class Library

The .NET Show The .NET Show Understanding the FrameworkUnderstanding the Framework

Page 43: .NET Overview

Framework Class LibraryFramework Class LibraryADO.NET ArchitectureADO.NET Architecture

DataReaderDataReader

SQL Server and other SQL Server and other OLE DB data storeOLE DB data store

DataSetDataSet

ConnectionConnection

CommandCommand

CommandCommandCommandCommandCommandCommand

ConnectionConnection

Data-Related Components

DataStores

DataAdapter

Managed-Provider Components

Page 44: .NET Overview

Framework Class LibraryFramework Class LibraryADO.NET BenefitsADO.NET Benefits

InteroperabilityInteroperability Don’t need COM on both sides Don’t need COM on both sides Uses XML to transfer data, even through firewallsUses XML to transfer data, even through firewalls ScalabilityScalability Disconnected datasets Disconnected datasets ProductivityProductivity Visual Studio.NET component designer Visual Studio.NET component designer Type safetyType safety PerformancePerformance Disconnected datasets Disconnected datasets No need for type conversionsNo need for type conversions

Page 45: .NET Overview

Framework Class LibraryFramework Class Library Important ADO.NET Data ObjectsImportant ADO.NET Data Objects

DataSetDataSetDataTableCollectionDataTableCollection

DataTableDataTable DataRowCollection DataRowCollection

DataRowDataRow DataColumnCollectionDataColumnCollection

DataColumnDataColumn DataViewDataView

DataRelationCollectionDataRelationCollectionDataRelation DataRelation

Page 46: .NET Overview

Framework Class LibraryFramework Class LibraryADO.NETADO.NET

XML Classes make the dataset extremely XML Classes make the dataset extremely portable portable ReadXml ReadXml WriteXmlWriteXml WriteXmlSchemaWriteXmlSchema

Page 47: .NET Overview

Framework Class LibraryFramework Class LibraryADO.NET Managed ProvidersADO.NET Managed Providers

Common Interface for accessing data Common Interface for accessing data Implementation of Implementation of

System.Data.Common.DbDataAdapter System.Data.Common.DbDataAdapter objectsobjects

SQL Server, OLE DB ship with .NETSQL Server, OLE DB ship with .NETOracle & ODBC are now availableOracle & ODBC are now availableOther vendors are building providers for Other vendors are building providers for other databasesother databases

Page 48: .NET Overview

IdbCommandIdbCommand

IdbCommandIdbCommandOleDbCommandOleDbCommand SqlCommandSqlCommand

IDbConnectionIDbConnection

OleDbConnectionOleDbConnection SqlConnectionSqlConnection

IDataParameterCollectionIDataParameterCollection

OleDbParameterCollectionOleDbParameterCollection SQLParameterCollectionSQLParameterCollection

Page 49: .NET Overview

Framework Class LibraryFramework Class LibraryADO.NET Reader ObjectADO.NET Reader Object

New in ADO.NET New in ADO.NET Data Reader similar to a stream object Data Reader similar to a stream object Very efficient Very efficient Forward onlyForward only Sequential OrderSequential Order

Recommended method of populating the Recommended method of populating the datasetdataset

Page 50: .NET Overview

Framework Class LibraryFramework Class Library

Bertrans Meyer’s .NET Training CourseBertrans Meyer’s .NET Training Course A Survey of the LibrariesA Survey of the Libraries

Page 51: .NET Overview

Framework Class LibraryFramework Class Library

Distributed Application SupportDistributed Application Support .NET Remote Invocation Services.NET Remote Invocation Services

Web ServicesWeb Services System. Web.Services.WebServiceSystem. Web.Services.WebService

Remoting ServicesRemoting Services System.RemotingSystem.Remoting

Message QueuesMessage Queues ASP.NET as an Application ServerASP.NET as an Application Server

Page 52: .NET Overview

ASP.NETASP.NET

New Web Programming ModelNew Web Programming Model Totally .NET – Do web programming in Totally .NET – Do web programming in

any .NET language.any .NET language.

Plug-in to IISPlug-in to IISCompiled ExecutionCompiled ExecutionTool SupportTool SupportClass & Control LibraryClass & Control LibraryHost for Remoting & Web ServicesHost for Remoting & Web Services

Page 53: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 54: .NET Overview

Managed, Unmanaged and Managed, Unmanaged and InteroperabilityInteroperability

Managed Code = IL code run by the CLR Managed Code = IL code run by the CLR Unmanaged Code = COM Objects, Win32 Unmanaged Code = COM Objects, Win32 applications, Active-X Controls, i.e. applications, Active-X Controls, i.e. anything else under Windows anything else under Windows Interop – the ability to run managed code Interop – the ability to run managed code from unmanaged code or run unmanaged from unmanaged code or run unmanaged code from managed code code from managed code

Page 55: .NET Overview

Interop – Calling unmanaged DLL Interop – Calling unmanaged DLL from .NETfrom .NET

Page 56: .NET Overview

Calling Unmanaged MessageBoxCalling Unmanaged MessageBox

using System.Runtime.InteropServices; using System.Runtime.InteropServices; public class Win32 {public class Win32 { [DllImport("user32.dll", CharSet=CharSet.Auto)][DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int MessageBox(int hWnd, String text, public static extern int MessageBox(int hWnd, String text, String caption, uint type); String caption, uint type); } } public class HelloWorld { public static void Main() public class HelloWorld { public static void Main()

{ Win32.MessageBox(0, "Hello World", "Platform Invoke { Win32.MessageBox(0, "Hello World", "Platform Invoke Sample", 0); } Sample", 0); }

} }

Page 57: .NET Overview

Using a COM WrapperUsing a COM Wrapper

Page 58: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 59: .NET Overview

.NET Tools.NET Tools

Visual Studio .NETVisual Studio .NETILDASMILDASM.NET Framework Configuration.NET Framework ConfigurationSQL ServerSQL Server

Page 60: .NET Overview

AgendaAgenda.NET from 20,000 feet.NET from 20,000 feetMajor .NET PiecesMajor .NET PiecesProgramming in .NETProgramming in .NETThe Common Language Runtime (CLR)The Common Language Runtime (CLR)The Framework Class LibraryThe Framework Class LibraryManaged code, Unmanaged code and InteroperabilityManaged code, Unmanaged code and InteroperabilityASP.NETASP.NETToolsToolsSample ApplicationsSample Applications

Page 61: .NET Overview

Sample ApplicationsSample Applications

Duwamish 7 BookstoreDuwamish 7 BookstoreFitch & Mather Online BrokerageFitch & Mather Online BrokerageDiggerDigger

Page 62: .NET Overview

ResourcesResourcesMSDN (msdn.microsoft.com/net)MSDN (msdn.microsoft.com/net)ASP.Net (ASP.Net (www.asp.net))www.gotdotnet.comwww.gotdotnet.comwww.sellsbrothers.comwww.windowsforms.netwww.c-sharpcorner.com.NET Patterns and Practices.NET Patterns and Practices

msdn.microsoft.com/practices/msdn.microsoft.com/practices/

.NET Six-Week Series .NET Six-Week Series msdn.microsoft.com/net/guide/msdn.microsoft.com/net/guide/

Books! We have a number of books in house.Books! We have a number of books in house.

Page 63: .NET Overview

Questions?Questions?


Recommended