I t is almost impossible to do development on a Microsoft platform today without using components. When an object is built in to a DLL, it is referred to as in-process, since the DLL memory is mapped into the application program's code space. Components serve the same purpose in object-oriented programming that library routines do in procedural programming. While library routines are linked into the executable when the program is built, components are already in an executable format and are called at run-time.
Components are reusable among multiple applications and within multi-threaded programs.
The reuse of components can, of course, occur concurrently. Therefore, a component must either be reentrant or access to it must be governed to allow only one application or thread to use it at a time. It is this need that has resulted in what Microsoft calls apartments . An apartment is the context in which a component object executes. The apartment type defines the concurrency behavior of a particular COM object's execution.