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

773 Views Asked by At

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.

2

There are 2 best solutions below

2
IInspectable On BEST ANSWER

.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.

0
Martin Rosenau On

.NET is based on some kind of bytecode similar to the Java Virtual Machine. This allows garbage collection and checks when casting object types.

As far as I know the word "managed" refers to the fact that .NET provides a data management that handles both garbage collection and object casting checks (and something more).

"Managed code" is a synonym for .NET code (as far as it is not mixed with non-.NET-objects).