Learning Goals
This course is designed specifically for the experienced
programmer who wants to learn, as much
as possible in one week, about Object Oriented
Programming in .NET using Microsoft Visual Studio
2008 Participants will use as VB.NET or C# and
study in-depth the OOP techniques and major OO
Patterns used by the .NET Framework 3.5.
Target Audience
This in-depth course is meant for experienced
developers who want to learn how to build professional
.NET 3.5 class libraries This is not an introduction
course and is not meant for occasional programmers.
Prerequisites
Participants of this course need to have an understanding
of the .NET platform and have built simple
.NET applications using either C# or VB.NET.
Course Outline
The .NET Application
The Application as collection of assemblies, and as
collection of interacting objects at run time.
Defining the application in a 3-tier environment.
Overview of the fundamental OO entities in .NET
Defining classes and structures. The 3 roles of a
class: factory, type of object, type of reference. Type
members: Methods, fields and properties. Local variable
inference and implicitly typed local variables.
Automatically implemented properties. Constructors.
Object and collection initializers. Static members:
fields, methods and static constructors. Static classes.
Nullable types. Nullable conversions and lifted
conversions. Lifted operators. Null
coalescing operator. Anonymous types.
Extending Classes
General principle of inheritance. Inheritance syntax.
Accessibility levels, public, private, protected.
Object class. The is-operator and the typeof/Is
operator. Casting and try-cast.
Partial Implementation: Partial
Types and Partial Methods. Extension Methods.
Exception Handling
The exception-mechanism in .NET. The hierarchy of
Exception-classes. User-defined exceptions.
Microsoft .NET Naming and Usage Guidelines
Naming patterns as defined in the .NET SDK.
Polymorphism with .NET Classes and Interfaces
Identifying interaction in an application at runtime
The client-server pattern for polymorphic object
interaction. Sending requests. Receiving requests.
Defining general behavior in the base class.
Specializing behavior in the derived classes.
Using dynamic types Creating a dynamic type
Defining Abstract behavior and object interaction
The Abstract Factory pattern. Implementing interfaces.
Multiple Inheritance with interfaces.
Collections in .NET
Arrays, Lists, and Maps in .NET. ArrayList,
Hashtable... Indexers and default properties.
Iterating through enumerable collections with enumerators.
Sorts and Comparisons within collections.
C# Indexers and VB.NET default properties.
Collection patterns in Windows and Web Controls.
Databinding. Exposing enumerable collections by
means of Iterators. IEnumerable and IEnumerator.
Generics
Better collections with generics
Generics allowing classes, structs, interfaces, and
methods to be parameterized. Type parameters.
Generic class declarations and generic struct declarations.
Generic interface declarations. Generic algorithms and generic methods.
Operator overloading
Overloadable operators. Implicit and explicit operator
overloading. Conversion operators.
Delegate and Event patterns in .NET
The delegate object as an instruction object. The
delegate syntax: delegate class, delegate reference,
delegate object. The MultiCastDelegate
class and its invocationlist. Invoking delegates.
Anonymous methods for passing a code block as a
parameter. Passing parameters to anonymous
methods. Lambda Functions as shorter delegate syntax
The event as delegate reference. .NET
guideline compliant event patterns. Virtual event
raisers versus event handlers.
Programming the Garbage Collection
The lifecycle of a class instance. Constructors,
finalize methods or destructors. GC class and
members. Forcing a garbage collection. Weak references.
The Dispose pattern. Garbage Collection
for Unmanaged resources.
Multithreading and synchronization in .NET
The thread as object. The Thread class,
ThreadStart delegate. Timers and delegates.
Avoiding dead locks and race conditions in .NET
Scheduling threads. Synchronizing threads: locks,
monitors, mutexes, synchronization attributes.
Synchronization patterns in .NET, e.g. with collections.
Asynchronous programming patterns in .NET
Invoking any method, synchronous and asynchronous.
The IAsyncResult interface and AsyncCallback
delegate. Four patterns: callback delegates, polling,
waiting, ending. The BackgroundWorker class.
Asynchronous programming with web services. Asynchronous I/O.
Programming with Application Domains
Isolating applications in Application Domains.
Starting an Application. Configuring an Application
Domain. Loading and Unloading Assemblies.
.NET Reflection
Using the System.Type class to obtain type member
information. Design Patterns Used by
Reflection Classes. Late binding: Dynamically
Loading and Using Types. Accessing Custom
Attributes. Specifying Fully Qualified Type Names.
Programming with .NET Attributes
Overview of how attributes are used in the .NET
Framework. Applying Attributes. Reserved attributes:
AttributeUsage, Conditional, Obsolete.
Attribute classes and attribute instances.
Accessing Attributes at runtime through Reflection.
Lambda Expressions and the LINQ syntax
Extension methods. Lambda expressions and
functional programming. Introducing the LINQ syntax.
Deep XML support in VB.NET.
.NET Configuration Management
.NET Configuration API. Configuring your application.
Adding your own configuration
Diagnostics and Debugging
Event logs. Performance counters. Processes.
Debug/Debugger classes. Trace and TraceListeners.
StackTraces and StackFrames.
Object Serialization and File IO
Serialization and deserialization patterns in .NET.
Defining serializable types, selective serialization.
Streams: file streams, memory streams and network
streams. Formatters for Binary and XML serialization
Readers and Writers. File and FileInfo. Directory
and DirectoryInfo.
FileSystemWatcher Isolated storage
Security
Code Access Security. Viewing and Modifying
Security Policies. Declarative Permission Requests.
Declarative and Imperative Security. Role Based
Security. Autentication and Authorization. Access
Control Lists. Cryptography and Digital Signing.
Overview. Digital Signing. Encrypting and
Decrypting. Hashing.
Interoperability
PInvoke. Calling unmanaged code. Marshalling.
Runtime Callable Wrapper. COM Callable Wrapper.
|