Pro VB 2008 and the .NET 3.5 PlatformThe point of this chapter was to demystify the garbage collection process. As you have seen, the garbage collector will only run when it is unable to acquire the necessary memory from the m- aged heap (or when a given AppDomain unloads from memory). When a garbage collection does occur, you can rest assured that Microsoft’s collection algorithm has been optimized by the use of object generations, secondary threads for the purpose of object finalization, and a managed heap dedicated to host large objects. This chapter also illustrated how to programmatically interact with the garbage collector using the System. GC class type. As mentioned, the only time when you will really need to do so is when you are building finalizable or disposable class types. Recall that finalizable types are classes that have overridden the virtual System. Object. Finalize() method to clean up unmanaged resources (at some time in the future). Disposable objects, on the other hand, are classes (or structures) that implement the IDisposable interface. Using this technique, you expose a public method to the object user that can be called to perform internal cleanup ASAP. Finally, you learned about an of- cial “disposal” pattern that blends both approaches. PART 3 Advanced VB Programming Constructs CHAPTER 9 Working with Interface Types This chapter builds on your current understanding of object-oriented development by examining the topic of interface-based programming. |
Contents
| 3 | |
| 35 | |
PART 2 Core VB Programming Constructs | 61 |
PART 2 Core VB Programming Constructs | 64 |
Defining Subroutines and Functions | 103 |
Designing Encapsulated Class Types | 129 |
The Role of the Me Keyword | 137 |
Defining the Pillars of | 148 |
Introducing Object Serialization | 633 |
The Connected Layer | 653 |
The Disconnected Layer | 705 |
Programming with the LINQ APIs | 759 |
Introducing Windows Communication Foundation | 795 |
Introducing Windows Workflow Foundation | 843 |
PART 6 Desktop Applications with Windows Forms | 881 |
Introducing Windows Forms | 883 |
VB 2008s Encapsulation Services | 154 |
Understanding Constant Data | 161 |
Understanding Inheritance and Polymorphism | 173 |
Understanding Structured Exception Handling | 207 |
Understanding Object Lifetime | 233 |
PART 3 Advanced VB Programming Constructs | 254 |
Working with Interface Types | 255 |
Collections Generics and Nullable Data Types | 291 |
Delegates Events and Lambdas | 327 |
Operator Overloading and Custom Conversion Routines | 359 |
VB 2008Specific Language Features | 383 |
An Introduction to LINQ | 409 |
PART 4 Programming with NET Assemblies | 436 |
Introducing NET Assemblies | 437 |
Type Reflection Late Binding and AttributeBased Programming | 483 |
Building a Custom Metadata Viewer | 490 |
Reflecting on Shared Assemblies | 496 |
Building Custom Attributes | 505 |
Putting Reflection Late Binding and Custom Attributes in Perspective | 511 |
Processes AppDomains and Object Contexts | 517 |
Building Multithreaded Applications | 537 |
NET Interoperability Assemblies | 571 |
PART 5 Introducing the NET Base Class Libraries | 606 |
File and Directory Manipulation | 607 |
Rendering Graphical Data with GDI+ | 929 |
Programming with Windows Forms Controls | 983 |
PART 7 Desktop Applications with | 1044 |
Introducing Windows Presentation Foundation and XAML | 1047 |
Investigating the WPF Assemblies | 1053 |
Building a XAMLFree WPF Application | 1060 |
Building a XAMLCentric WPF Application | 1070 |
Separation of Concerns Using CodeBehind Files | 1078 |
Building WPF Applications Using Visual Studio 2008 | 1091 |
The Role of Microsoft Expression Blend | 1099 |
Programming with WPF Controls | 1103 |
WPF 2D Graphical Rendering Resources and Themes | 1167 |
Exploring the ShapeDerived Types | 1175 |
Exploring the DrawingDerived Types | 1181 |
Understanding WPFs Animation Services | 1187 |
Understanding the WPF Resource System | 1195 |
Altering a Controls UI Using Templates | 1207 |
PART 8 Building Web Applications with ASP | 1212 |
Building ASP NET Web Pages | 1215 |
ASP NET Web Controls Themes and Master Pages | 1261 |
ASP NET State Management Techniques | 1297 |
| 1331 | |
Other editions - View all
Common terms and phrases
ADO.NET allows array assembly assume attribute base class libraries Boolean build ByVal Chapter class type configuration Console Application Console.ReadLine Console.WriteLine constructor contains create currSpeed custom data types database DataSet DataTable default define Employee End Sub End End Sub Public Enum error examine example exception Figure Framework 3.5 garbage collection given ildasm.exe implementation Inherits Integer interface invoke keyword language late binding LINQ member variable metadata method Module Program Sub myCar MyPoint named namespace NET assembly NET Framework 3.5 NET metadata operator Option Strict parameter petName platform Program Sub Main Public Class Public Sub New(ByVal ReadOnly reference runtime Serializable Server SharpDevelop simply Source Code specify String structure Sub End Class Sub End Module Sub Public Sub subdirectory subroutine syntax System System.Object Table thread update Visual Basic 2008 Visual Studio 2008 Windows Forms


