Re: COM... is it the best model so far?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On 6 9 , 1 36 , "Alexander Nickolov" <agnicko...@xxxxxxxx> wrote:
COM is not designed for binary reuse. However, nothing
prevents you from using source code reuse as this sidesteps
COM altogether.

BTW, you don't need to know a CLSID of a COM object
in order to use it - you only need its interfaces. A completely
separate piece of code may deal with object instantiation
leaving the rest of your code independent of CLSID
knowledge. In fact, the COM objects you use don't even
need CLSIDs if they are manufactured by other COM
objects.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnicko...@xxxxxxxx
MVP VC FAQ:http://vcfaq.mvps.org
=====================================

<sweetchuc...@xxxxxxxxx> wrote in message

news:1181317318.753573.292750@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



Recently, i am examining different component model or framework
deployed in different systems.
What are you people think about the aggreagation or extensibility of
COM?

Even though COM has been successful for many years, IMHO COM is weak
on aggregation or component composition point of view.
For example, creating new component out of existing component
(aggregation) or creating new component from component interactions
(component composition) is hard to do with COM.

There are several component models which seperate the implementation
of component from the usage or composition.
For example,
each component only specifies "required interface" and "provide
interface".
there should be a glue component or container component that are
responsible to instantiate inner components and retrives the
interfaces from them in order to configure or map "required interface"
to "provide interface".

This has several advantages. Consider below cases.
(1) component A need to use interface IB provided by component B. In
COM, component A needs to know CID of component B and IID of interface
IB in order use it. In other words, A is tightly coupled with
component B. In future source code need to be changed if component A
want to use interface IB implemented by component C which exhibits
better performance. If we seperates configuration out of component A,
no source changes are needed on component A. We only need to update
container component. Only dependency component A has is the type of
interface or IID that it requires. It doesn't matter which component
provides this "required interface" since container component figures
out and configures it when instantiating component A.

Such approach also has some drawbacks, particually in dynamic aspect.

Compared with COM, what are the drawbacks of such component model?- -

- -

Thank you for the answer.
BTW, when you said that I don't need CLSID in order to use COM object.
You didn't mean that "CoCreateInstance" like instantiation is not
needed.
you are saying that "it is possible to prepare from the other piece of
code (whether it is a container component or configuration component)
and pass the actual interface pointer to whom needs it"
Right?

.



Relevant Pages

  • Re: COM... is it the best model so far?
    ... prevents you from using source code reuse as this sidesteps ... each component only specifies "required interface" and "provide ... there should be a glue component or container component that are ...
    (microsoft.public.vc.atl)
  • Re: Writing an activex control to proxy calls to an unregistered activex control
    ... The CLSID represents an immutable interface. ... One idea that I had was to create a new activex control under a ...
    (microsoft.public.vc.mfc)
  • Re: Marshal.QueryInterface returning E_NOINTERFACE
    ... //6) Get a pointer to the IPersistStorage Interface. ... IntPtr pIUnk = Marshal.GetIUnknownForObject; ... Int32 r = Marshal.QueryInterface(pIUnk, ref IID_IPersistStorage, out ... //4) Determine the CLSID of the COM object that owns the IStorage. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: COM... is it the best model so far?
    ... Microsoft MVP, MCSD ... prevents you from using source code reuse as this sidesteps ... each component only specifies "required interface" and "provide ... there should be a glue component or container component that are ...
    (microsoft.public.vc.atl)
  • RE: Duplicate program class keys in HKCR
    ... One CLSID maps to one COM component. ... COM component interface is changed. ... Each new version of COM component is released, its progID should always ... Microsoft Online Community Support ...
    (microsoft.public.win32.programmer.kernel)