What is managed code and managed data?

Managed code is the code that is written to target the services of the Common Language Runtime (CLR). In order to target these services, the code must provide a minimum level of information to the runtime. All of the C#, Visual Basic .NET and J# .NET code is managed by default.

Closely related to managed code is managed data. This is the data that is allocated and de-allocated by the Common Language Runtime's garbage collector. As said earlier C#, Visual Basic, and J#.NET data is managed by default. C++ data can, however, be marked as unmanaged through the use of special keywords. Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword.

As the name suggests this means that the memory used for instances of the class is managed by the garbage collector. In addition the class becomes a full participating member of the .NET Framework with the benefits and restrictions that it brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class).

An example of a restriction is that a managed class can only inherit from one base class.

Written by Sandeep Mogulla, Webmaster at www.startvbdotnet.com

Index

 
Printer friendly version of the FAQ-VBNET-Managed-Code page


Sponsored links

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
3 Months Free - ASP.NET Web Hosting
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!

Advertisement



Free Magazine

Free Magazines
eWeek The essential technology information source for builders of e-business.... subscribe now

Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.