Summary

This chapter introduced the CLR. You first looked at its memory management features, including how .NET uses namespaces to structure the classes available within the Framework. The chapter reviewed how the .NET Framework is handling multiple profiles and touched on the Visual Basic specific features of the My namespace. Chapter highlights include the following:

  • Whenever possible, do not implement the Finalize method in a class.
  • If the Finalize method is implemented, then also implement the IDisposable interface, which can be called by the client when the object is no longer needed.
  • There is no way to accurately predict when the GC will collect an object that is no longer referenced by the application (unless the GC is invoked explicitly).
  • The order in which the GC collects objects on the managed heap is nondeterministic. This means that the Finalize method cannot call methods on other objects referenced by the object being collected.
  • Leverage the Using keyword to automatically trigger the execution of the IDisposable interface.
  • The Portable Library project type allows you to target multiple different .NET Framework platforms.
  • That namespace hierarchies are not related to class hierarchies.
  • How to review and add references to a project.
  • How to import and alias namespaces at the module level.
  • Creating custom namespaces.
  • Using the My namespace.

This chapter also examined the value of a common runtime and type system that can be targeted by multiple languages. This chapter ...

Get Professional Visual Basic 2012 and .NET 4.5 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.