280 likes | 561 Views
C# For Programmers. Three phases of this class Basics – CLR, Types, C# Language syntax, Object Oriented Programming(OOP) concepts Applications Development – ADO.Net , ASP.Net , Windows Forms, Web Services, WPF, WCF Select Topics - A class or two that will cover selected by students topics
E N D
C# For Programmers • Three phases of this class • Basics – CLR, Types, C# Language syntax, Object Oriented Programming(OOP) concepts • Applications Development – ADO.Net, ASP.Net, Windows Forms, Web Services, WPF, WCF • Select Topics - A class or two that will cover selected by students topics • Intensive Course of Study – brace yourself
C# For Programmers • Instructor • Boris Zlatev • Sr. Applications Developer, TDC – The Doctors Company • MS in E-Commerce Technology, DePaul University, Chicago, 2004 • boris@zlatev.net • Course site at www.zlatev.org/csclass
The .NET Framework • Extensive and powerful development platform • SDK – freely downloadable from Microsoft.com • Windows XP and Vista – .NET already embedded in the operating system • In the future – possible support by other OS – UNIX \ Linux
.NET Framework - Design Goals • Component Infrastructure • Portable executable(PE) - DLL, EXE • Language Integration • Language independence • Internet Interoperation • Uses widely accepted standards, such as SOAP, XML, and HTTP • Simple Development
.NET Framework - Design Goals • Simple Deployment • XCOPY deployment • Reliability • Reliable language • Robust runtime and infrastructure • Type safety • Automatic memory management
.NET Framework - Design Goals • Security • Protects access to specific parts of the executable code • Declarative security checks (attributes) • Imperative security checks (explicit security checks)
The Common Language Runtime (CLR) • The engine responsible for executing managed code. • Managed code – code written and compiled in a .NET language and compiler
CLR - KeyFeatures • Cross language integration • Cross language exception handling • Automatic memory management – garbage collection • Code access security • Side – by – side execution • Easier deployment and versioning
Intermediate language (IL) • Full name – Microsoft Intermediate Language (MSIL) • Non native compiled code • A sort of assembly language • Only calls to functions defined in the .NET core types and base classes • No calls to Windows API • CPU Independent - no CPU specific functions and calls
Just – In – Time Compilation (JIT) • IL code is loaded by the CLR and compiled into machine code • Compilation on “as needed” basis on first call • Compiled code cached for subsequent requests • Code checked for type safety - compiler ensures that the code doesn’t try to access invalid memory addresses and that it returns and passes variables of the right type
Metadata • Information about the types used and referenced by the IL code • Name of the types(classes), class members, parameters, references to other types • Advantages: • Code safety and verification • Reflection - ability to examine metadata in code • IntelliSense – Visual Studio feature
Assembly • A product of compilation (IL + metadata) • Assemblies are Portable Executables (PE) - The smallest unit of code that can be executed and reused. • Made of one or more managed modules and resource files (optional), such as images • Manifest – lists all the files that the assembly is made of
The Common Type System (CTS) • Value types • Reference types • Boxing and unboxing • Classes, properties, indexers • Interfaces • Delegates • Generics
What Is A Type? • The CTS provides every language running on the .NET platform with a base set of data types (classes) • Two Categories • Value Types: Value types directly contain their data. • Reference Types: Reference types store a reference to the value's memory address
The Common Type System (CTS) • Types are defined by CLR, hence they are the same across languages
The Common Language Specification (CLS) • A series of basic rules that are required for language integration • Spells out the minimum requirements for being a .NET language • Compiler vendors can build their compilers to the specification and provide languages that target .NET.
The Framework Class Libraray (FCL) • Thousands of classes and interfaces • Encapsulate a lot of system objects and functionality that help us write: • Windows Applications (Win Forms, WPF Applications, Windows Services) • ASP.NET Applications – use server side controls • Web Services – the FCL classes hide all the underlying details of SOAP and network communications
Integrated Development Environments (IDE) • Visual Studio.NET • Visual C#.NET • We will use it in this class http://www.microsoft.com/express/download/