Search code examples
winapiwindows-phone-8windows-phone-8-sdk

What does "managed" API means in Windows Phone 8 API


When learning Windows phone 8 development, I found that its API can be divided into: 1. Managed (.NET API) 2. Managed & Native (Windows Phone Runtime API) 3. Native (Win32 & COM)

My question is why the .NET API is called "Managed". What does this word means? Thanks.


Solution

  • .NET is called managed, because object lifetimes are automatically managed by the runtime environment (CLR, Common Language Runtime).

    In contrast, native (and COM) code requires that object lifetimes are managed by the developer, either by explicitly invoking the respective cleanup calls (e.g. delete, Release()), or by using resource management classes (e.g. std::unique_ptr, _com_ptr_t).

    The term managed also refers to additional services provided by the CLR as code continues to run, such as memory management (e.g. providing a compacting heap), security (e.g. verifying that an assembly's code is safe/valid), threading, and the like.