Sunteți pe pagina 1din 13

m  


 
RequirementÝ the code written in one language
should be reused in the applications developed
using other language.
Solution is COM
COM Ý it is a specification or a set of rules provided
such that language interop can be achieved.
Note Ýin order to specify a code as a component it
is manditory that the class definitions has to
inherits IUNKNOWN interface.
 


ÆueryInterface Ý it is used to maintain the address of all the


member functions defined in the class definitions in a
VARRAY table structure.
AddRef Ý It is used to increment the reference counter value
by 1 when ever the application uses the definitions of the
form component.
Release Ý when ever the application which uses the COM
component definitions is closed in a normal procedure then
Release Method is used to release the reference counter
information.
Note Ý if the reference counter value is equal to zero then
the resources occupied by the COM component will be
released.
m 
m  

  
mÝ

 


m 



d 
  
m

d

  
  
 







m
When ever a COM type application uses the definitions of
the inprocess COM then a request will be given to the COM
server where the component will be identified based on its
GUID and processing of the component will take place at the
PMA [ Private Memory Area ] of the OS and the request will
be given back to the application.
Advantages Ý Êhe performance of the application will be
very fast.
Limitations Ý Always a IN process component depends on a
application the Component cant be used independently.
As the processing of the component will be performed at the
PMA of the operating system the resources of the OS will be
blocked.

m
   

  

d      


 


  d

m 
When ever a application uses the OUÊ process component
then a request will be given to the COM server where COM is
identified and the processing of the Component will be
performed at a individual memory block and the response
will be given to the application with the support of PMA.
Advantages Ý OUÊ process components can be used within
an application or it can be used independently.
Êhe resources of the O/S is not blocked.
Disadvantages Ý the application which uses the OUÊ
process components will be slow when compared to the
applications which uses the in process components.
   m 
 ! 
 
 
   

  

  d 
 
 

d                 


   
          
V !  !m   
 
Êhe environment in which .net applications will be processed is managed
environment.
Êhe environment in which COM components will be processed is unmanaged
  
environment.   
md d!"  !
  
m


!
" # 

mm 

 
m 


d 


 
 m

 
m 

When ever the dot net application uses the


definitions of the COM Component a request will be
given to the CLR which uses the COM marshalling
resource and identifies the application uses the
definition of the COM Component and it defines a
Runtime Callable Wrapper which sends a request to
the Com Server where the Component is identified
based on its GUID and the definitions of the COM
component will be returned to the RCW and based
on that definitions a relevant .net interop COM will
be defined which will be used by the applications.

  m" V#$ 
%m m  &
CDONÊS { Collabarative Data objects for new Êech.
Service }
Usage Ý used to send / receive Mails
Properties Ý
From,Êo,Subject,Cc,Bcc,BodyFormat,MailFormat,B
ody
See example.
m !' 

  
  

m

 md d!"  !

 " # 
%&


 m  #  d m'

md#!(




m#
 $
m  
d
When ever a COM type application uses the
definitions of the .net assembly then a request will
be given to the CLR from the COM Server where the
CLR uses its COM collable Wrapper [CCW] resource
to identify the .net assembly and to define the
relevant interrop COM which will be registered in
the COM Server and then the COM Êype application
uses the definitions of the Dot net assembly as if it
is using a Com Component only.
V    ! 
 m  
 
V V  
   

 


 
  

 
 
   

    



 

    
V   
    
  

 
 

 

S-ar putea să vă placă și