The Component Location
Types of Components
ActiveX, DirectX, OCX, COM+, ADO+, ASP etc. who never heard of these
technologies? They all represent yet another use of the COM standard.
This paragraph will focus on categorizing COM components according to
their own properties as well as the context in which they are used.
The categorization will define how the EiffelCOM wizard should be
used to wrap or create a component.
The first criteria that defines the type of component is from where
it will be accessed: will the component be loaded in the client process
or will the component be a remote server for a distributed application?
In the former case, the component is compiled as a Dynamic Link Libraries
(DLL) while in the latter case it is a standard executable.
In-process Components
Typical instances of DLL components are found in technologies such as
OCX, ActiveX, or ASP. These are small, downloadable binaries that will
be loaded and executed in a container. The container acts as a client
of the component. The EiffelCOM wizard provides the ability to wrap
such components by providing access to its interface to any Eiffel
container. It is also possible to create a new In-process component
in Eiffel.
One main difference with out-of-process components (other
than the nature of the module, DLL versus executable) is the way
in-process components are activated. In the case of out-of-process
components, the component will specify COM when it is ready to
receive calls from client. In the case of an in-process server the
call is coming directly from COM: COM first loads the DLL into the
client process and then calls the exported function DllGetClassObject
to access the component class object. The other three exported
functions of an in-process component are DllRegister to register
the component in the Windows registry, DllUnregister to unregister
the component from the registry and finally DllCanUnloadNow which
gets called by COM whenever it tries to unload the component from
memory. These four functions must be accessible from outside the
DLL for the in-process component to work properly.
Out-of-process Components
These components are standard executable acting as servers that
can be accessed locally or over a network. Typically used in a
three tier client server architecture, the major difference with
in-process servers (other than the module type - executable
instead of DLL) is their lifetime. In-process components are
typically loaded to achieve a specific task and unloaded just
after while out-of-process components are servers supposed to
run continuously. The EiffelCOM wizard allows to build clients
for such servers in Eiffel. It also provides the ability to create
such servers.
See Also: EiffelCOM
wizard, EiffelCOM library,
Introduction,
Generalities,
COM Interfaces,
Coclasses,
Access Type,
Deeper into COM