Unmanaged Programming Brief
We have to reap what we sow. I mean, in C++ (unmanaged world), if you allocate memory by new/malloc, then it is your responsibility to deallocate them using delete/free. Forgetting to deallocate the allocated memory after the formal consumption results in memory leaks. The compiler is tightly bound to the underlying operating system/hardware, and uses the APIs exposed by the underlying OS for programming.
Managed Programming Brief
Programming in the managed world comprises of the programming language used, the libraries [called the Base Class Library], and the CLR itself. The BCL is the gateway to the platform on which the program will be executed. The BCL provides all the APIs for programming, and is organized under various namespaces corresponding to the service intended - file system, memory, network, user interface, process and threads etc. One of the several facilities in managed programming is automatic memory management - allocation is our wish, de-allocation is automatically taken care of by the CLR by a process called Garbage Collection.
Types in the managed world are entities that bear information and on which operations are carried by calling methods. Each type is unique by itself. For using the types, we create instances of types and work with it. Types (and their associated operations) are packaged and deployed as assemblies. An assembly is the ultimate unit of deployment, and is the building block of a CLR based application. An assembly is versioned, which serves as its identity. An assembly is similar to the dynamic link library for the unmanaged world, although assemblies are themselves dynamic link libraries or executables. Types packaged in an assembly are accessible from outside based on the accessibility marked for the type. For instance, a class type marked public is accessible from outside, and so are its methods that are marked public.
No comments:
Post a Comment