/[eiffelstudio]/trunk/Delivery/xmldoc/technologies/com/04_coclass.xml
ViewVC logotype

Contents of /trunk/Delivery/xmldoc/technologies/com/04_coclass.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 42299 - (show annotations)
Wed Mar 24 00:00:17 2004 UTC (15 years, 11 months ago) by rogers
File MIME type: text/xml
File size: 3203 byte(s)
Latest checked versions, fixed see also and a few small other issues.

1 <document title="Coclass" output="studio">
2 <meta_data/>
3 <paragraph> We have seen that interfaces can be perceived as views of a component. This conceptual representation actually maps the implementation of an EiffelCOM component since the coclass inherits from the interfaces and implements their deferred features. Indeed, interfaces are deferred classes with all features accessible from outside deferred. The coclass is an Eiffel class that inherits from these interfaces and implements all the features. This design is not specific to Eiffel though and can be found in other languages as well. The coclass defines the behavior of the interface functions.
4 <line_break/>
5 <heading>
6 <size>2</size>Class Object
7 </heading>
8 <link/> We have seen that interfaces are accessed through interface pointers. But how does a client get hold on one of these?
9 <paragraph>The answer lies in the class object. The name of this module should really be coclass factory since its goal is to spawn instances of the coclass on request. Class objects are accessed by COM whenever a client request a new instance of the associated component. COM loads the class object and asks it to provide the interface pointer requested by the client. </paragraph>
10 <paragraph>The way a class object is loaded in memory (this process is called activation) depends on the location of the component (See
11 <link>
12 <url>05_component_location.xml</url>
13 <label>Location</label>
14 </link> for a description of the possible locations of a component). If the component is an in-process server then the class object is called directly through the functions exported from the DLL. If the component is an out-of-process server then it provides COM with a pointer to the class object. In both cases, once the component is loaded, COM has access to the class object and can call it would a client request a new instance of a component.
15 </paragraph>
16 <image>
17 <legend>Component Creation</legend>
18 <height>136</height>
19 <width>475</width>
20 <url>images/com-1.gif</url>
21 </image>
22 <paragraph>
23 <link/> The code for the class object is generated by the EiffelCOM wizard so that Eiffel programmers will not have to worry about it.
24 </paragraph>
25 <seealso>
26 <bold>See Also</bold>
27 <line_break/>
28 <link>
29 <url>../../tools/wizards/com/index.xml</url>
30 <label>EiffelCOM wizard</label>
31 </link>
32 <line_break/>
33 <link>
34 <url>../../libraries/com/index.xml</url>
35 <label> EiffelCOM library</label>
36 </link>
37 <line_break/>
38 <link>
39 <url>01_introduction.xml</url>
40 <label> Introduction</label>
41 </link>
42 <line_break/>
43 <link>
44 <url>02_generalities.xml</url>
45 <label>Generalities</label>
46 </link>
47 <line_break/>
48 <link>
49 <url>03_interfaces.xml</url>
50 <label> COM Interfaces</label>
51 </link>
52 <line_break/>
53 <link>
54 <url>05_component_location.xml</url>
55 <label> Component Location</label>
56 </link>
57 <line_break/>
58 <link>
59 <url>06_access_type.xml</url>
60 <label> Access Type</label>
61 </link>
62 <line_break/>
63 <link>
64 <url>07_deeper_into_com.xml</url>
65 <label> Deeper into COM</label>
66 </link>
67 </seealso>
68 </paragraph></document>

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23