summaryrefslogtreecommitdiff
path: root/modules/CIAO/docs/tutorials/Quoter/Simple/03.html
blob: d8795ab2533d9d6ceed1507975e7c7b29feb6db1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
<!-- $Id$ -->
<html xmlns="http://www.w3.org/TR/REC-html40">
<head>
<title>Getting Started</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
h3 {
	font-size:13.5pt;
	font-family:"Times New Roman";
	font-weight:bold;
}
a:link, span.MsoHyperlink {
	color:#000FFF;
	text-decoration:underline;
	text-underline:single;
}
a:visited, span.MsoHyperlinkFollowed {
	color:#FF0F0F;
	text-decoration:underline;
	text-underline:single;
}
p {
	font-size:12.0pt;
	font-family:"Times New Roman";
}
address {
	font-size:12.0pt;
	font-family:"Times New Roman";
	font-style:italic;
}
code {
	font-family:"Courier New";
}
kbd {
	font-family:"Courier New";
}
pre {
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:"Courier New";
}
div.Section1 {
	page:Section1
}
-->
</style>
<!-- $Id$ -->
</head>
<body bgcolor="#FFFFFF" lang="EN-US" link="#000fff" vlink="#ff0f0f">
<div class="Section1">
  <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>Step 3:
    Package your components</span></h3>
  <h3 align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img width="572" height="358" id="_x0000_i1025" src="images/step3.jpg"> </span></h3>
  <p><b>Brief Introduction to CosMIC:</b></p>
  <p>The Component Synthesis
    using Model Integrated Computing (CoSMIC) project is a MDA toolset being
    developed by the Institute for Software Integrated Systems (ISIS) at
    <st1:place w:st="on">
    <st1:PlaceName w:st="on">
    Vanderbilt
    <st1:PlaceType w:st="on">
    University

    to:</p>
  <p style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;'>1.<span style="FONT:7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </span><i>Model and</i> <i>analyze </i>distributed real-time and embedded
    application functionality and QoS requirements.</p>
  <p style='MARGIN-LEFT:39pt;TEXT-INDENT:-0.25in;'>2.<span style="FONT:7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp; </span><i>Synthesize</i> CCM-specific deployment metadata required to deliver
    end-to-end QoS to DRE applications.</p>
  <p>The CoSMIC toolsuite
    provides modeling of DRE systems, their QoS requirements, and QoS adaptation
    policies used for DRE application QoS management. The component behavior, their
    interactions, and QoS requirements are modeled using a domain specific modeling
    language that adheres to <span style='COLOR:black'>the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG
    Deployment &amp; Configuration (D&amp;C) specification (ptc/2003-07-08)</a></span>.
    CoSMIC enables modeling the standards-based CCM components. </p>
  <p>Hand-writing the required
    XML descriptors to configure our components is tedious and error prone. We
    therefore utilize CosMIC (we specifically use a subset of CosMIC called PICML,
    which stands for Platform-Independent Component Modeling Language) to generate
    the bulk of descriptors for us.</p>
  <p>For more information on
    CosMIC, please refer to the following article:</p>
  <p><a href="http://www.cs.wustl.edu/~schmidt/PDF/mamad2003.pdf">CoSMIC:
    An MDA Generative Tool for Distributed Real-time and Embedded Applications</a>.</p>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <p><b><span style='COLOR:black'>Importing IDL to PICML</span></b><span style='COLOR:black'><br>
    <br>
    &nbsp;&nbsp; To quick start our Stock Quoter modeling process in GME, CoSMIC
    introduces <em>idl_to_picml</em> , which is an executable program that imports
    the IDL files you just created into PICML.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> Make sure <code> <span style='FONT-SIZE:10pt'>%COSMIC_ROOT%\bin</span></code> is included in
      the PATH variable, e.g., c:\Program Files\ISIS\CoSMIC\bin.
    <li style='COLOR:black;'> Open a command prompt, run VCVARS32.BAT from the MSVC .NET folder if you
      haven't done so. It will set the environment for using Microsoft Visual Studio
      .NET tools so that <i>idl_to_picml</i> works properly.<br>
      in my machine, VCVARS32.bat is in C:\Program Files\Microsoft Visual Studio .NET
      2003\Vc7\bin
    <li style='COLOR:black;'> In the same command prompt, change directory to <code> <span style='FONT-SIZE:10pt'>Quoter\Simple</span></code>, and type the
      following command:<br>
      &nbsp;&nbsp; &gt; <kbd> <span style='FONT-SIZE:10pt'> idl_to_picml -I%CIAO_ROOT% -x Quoter -r .&nbsp;</span></kbd><br>
      <em>idl_to_picml</em> will parse your IDL files and generated a <code> <span style='FONT-SIZE:10pt'>Quoter.xme</span></code> file in the <code>
      <span style='FONT-SIZE:10pt'>Quoter</span></code> directory. Note that if
      -x option is not used, the default xme file name will be <code> <span style='FONT-SIZE:10pt'>PICML_default_xme_file.xme.</span></code><br>
      <span style='COLOR:black;'>When this command is run a second time, be sure to delete all E.idl files first!</span><br>
      <br>
    <LI style="COLOR: black;    "> Start GME, select <strong>File-&gt;Import xml..</strong>, and choose the xme
      file just generated. You should be able to see an imported PICML model similar
      to the one shown in Figure 2. </LI>
  </ol>
  <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1027" src="images/fig2.jpg"><br>
    <br>
    Figure 2</span></p>
  <p><span style='COLOR:black'>&nbsp; In the Browser of the generated model, the <em>PredefinedTypes</em> folder contains a bunch of atomic datatype elements that will be referenced by
    other modeling parts later. You don't have to worry about them for now. The
    models in <em>InterfaceDefinitions</em> folder are the PICML representations
    of the IDL files you just imported. Double-click to open <em>StockBroker</em>, it
    will show you a white, document-like entity which represents a
    &lt;&lt;FileRef&gt;&gt; instance and a yellow box-shaped entity representing a
    &lt;&lt;Package&gt;&gt; instance. Their equivalent representations in IDL files
    are "#include" and "module" respectively. Figure 3 gives
    you a clear view of GME representation of all the 3 idl files created. We will
    cover the other folders in the next section.</span></p>
  <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="1" id="_x0000_i1028" src="images/fig3.jpg"><br>
    <br>
    Figure 3</span></p>
  <p style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>Now
    we are ready to model the rest of the Stock Quoter systems.<br>
    <br>
    <br>
    </span></p>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3>Building Stock Quoter system in PICML<span style='COLOR:black'> </span></h3>
  <p><span style='COLOR:black'>This section describes modeling the Quoter
    application using PICML. If you have trouble producing a functioning model from
    this tutorial, please see the, <a href="Model/Quoter.xme">pre-built Quoter model</a> which is provided for your reference. This model contains all
    elements created as part of this tutorial.</span></p>
  <p><strong><span style='COLOR:black'>Note:</span></strong><span style='COLOR:black'> To import an XML file in GME, select <em>File-&gt;Import
    XML..</em> from GME and choose your XML model</span></p>
  <p><span style='COLOR:black'>The PICML paradigm is designed for the <a href="http://www.omg.org/cgi-bin/doc?ptc/2003-07-08">OMG
    Deployment &amp; Configuration (D&amp;C) specification (ptc/2003-07-08)</a>, so the modeling process
    is straightforward if you are familiar with the specification. Please see the <a href="../../../releasenotes/dance.html">DAnCE
    project</a> for more
    information.&nbsp;For those who hate specification (including me, :-)), an <a href="http://www.cs.wustl.edu/%7Eschmidt/PDF/DAnCE.pdf">overview
    of D&amp;C</a> and as well as a <a href="http://www.cs.wustl.edu/%7Eschmidt/OMG-CCM-Tutorial.ppt">tutorial of D&amp;C
    and CCM</a> can help to reduce the learning curve. In addition, it is
    also helpful to read through documentation which originally came from the TAO's Developer's Guide 1.4a (CIAO
    and CCM) which thoroughly describes the various descriptors required for a
    component (*.iad, *.ccd, *.cid, etc). This chapter is available <a href="../../../CIAO.pdf">here.</a></span></p>
  <h3><span style='COLOR:black'>Table of Contents</span></h3>
  <ul type="disc">
    <li style='COLOR:black;'> <a href="#1">ImplementationArtifacts</a>
    <li style='COLOR:black;'> <a href="#2">ComponentImplementations</a>
    <li style='COLOR:black;'> <a href="#3">ComponentPackages</a>
    <li style='COLOR:black;'> <a href="#4">PackageConfiguration</a>
    <li style='COLOR:black;'> <a href="#5">TopLevelPackage</a>
    <li style='COLOR:black;'> <a href="#6">Targets</a>
    <li style='COLOR:black;'> <a href="#7">DeploymentPlan</a></li>
  </ul>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <p><span style='COLOR:black'>The complete PICML Quoter model consists of
    modeling elements distributed across various folders. If you used <em>idl_to_picml</em> to generate the initial model, you will see that it has created all these
    folders and some of the tedious boilerplate modeling for us. The rest of the
    section will explain the purpose of each folder as well as the modeling
    entities contained in these folders. We will also show how to model some of the
    folders that have to be done by hand.</span></p>
  <p><b><span style='BACKGROUND:silver;COLOR:red;FONT-VARIANT:small-caps;'>Important:</span></b><span style='BACKGROUND:silver;COLOR:black;'> The interpreters that generate deployment
    artifacts expect very strict constraints in the model. When you finish your
    model, and any time you wish to generate anything, it is a good idea to check
    constraints by clicking on <em>File-&gt;Check-&gt;Check All</em> in GME. This
    will help you find many logic errors in your model.</span><span style='COLOR:black'> </span></p>
  <h3><span style='COLOR:black'>ImplementationArtifacts</span></h3>
  <p><span style='COLOR:black'>This folder contains implementation artifacts
    associated with components. <em>idl_to_picml</em> has created these artifacts
    for us, with their dependency relationships correctly captured. In order to match the current DAnCE specification, both execPoints
    should be removed. Figure 4 shows the Implementation Artifacts for <em>StockBroker</em>.</span>
  </p>

  <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1031" src="images/fig4.jpg"><br>
    Figure 4.</span></p>
  <div align="center" style='TEXT-ALIGN:center'><a name="1"></a><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><span style='COLOR:black'>ComponentImplementation<a name="2"></a></span></h3>
  <p><span style='COLOR:black'>This folder contains models that describe the implementations
    of component interfaces. In the Quoter example, we will have two monolithic
    component implementations - named <em>StockDistributorImplementation</em> and <em>StockBrokerImplementation</em> - and an assembly component implementation named <em>StockQuoter</em>, which is
    an assembly of <em>StockDistributorImplementation</em> and <em>StockBrokerImplementaion</em>. <em>idl_to_picml</em> has created the monolithic component implementations for
    us, as shown in figure 5 for example, but we have to change this model in order to meet the DAnCE specification.</span></p>
  <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1033" src="images/fig5.jpg"><br>
    Figure 5</span>
  </p>

  <p><span style='COLOR:black'>First thing we need to do is delete the following attributes.
    <ul>
      <li>StockBroker_stubRef</li>
      <li>StockBroker_svntRef</li>
      <li>StockBroker_execRef</li>
      <li>ComponentIOR</li>
    </ul>
    After that we need to create a reference to the artifacts.
    <ol>
      <li>Drag a &lt;&lt;ComponentImplementationArtifact&gt;&gt; and a
        &lt;&lt;ComponentServantArtifact&gt;&gt; from the Part browser to the modeling window.
      </li>
      <li>These two parts need to be linked to the StockBroker_exec and StockBroker_svnt artifacts in
        <code><span style='FONT-SIZE:10pt'>Quoter/ImplementationArtifacts/StockBrokerArtifacts</span></code>.
        This can be established by expanding the tree view and drag StockBroker_exec to the
        &lt;&lt;ComponentImplementationArtifact&gt;&gt; and StockBroker_svnt to
        &lt;&lt;ComponentServantArtifact&gt;&gt; on the window. On succes,
        the &lt;&lt;ComponentImplementationArtifact&gt;&gt; icon should change into a
        &lt;&lt;ImplementationArtifactReference&gt;&gt; icon.
      </li>
      <li>Now we should define which entry point is used. Since this tutorial is about unhomed components and the
        in the IDL we used homed component, we should create an entry point in code in order to support unhomed component.
        This can be done by:
        <ol>
          <li>Opening StockBroker_exec.h and add an entry point in the extern "C" section. This function should return
           a <code>::Components::EnterpriseComponent_ptr</code> instead of a <code>::Components::HomeExecutorBase_ptr</code>. See
            <a href="Broker/StockBroker_exec.h">StockBroker_exec.h</a> for more details.
          </li>
          <li>Opening StockBroker_exec.cpp and implement the extern "C" function. See
            <a href="Broker/StockBroker_exec.cpp">StockBroker_exec.cpp</a> for more details.
          </li>
          <li>Now we should turn back to the model to configure this entry point. This should be done
            by selecting the <em>ComponentImplemtationArtifact</em> and specify this new extern "C" function
            (<code>create_Stock_StockBrokerComp_Impl</code>) in the attribute window.<br>
          </li>
        </ol>
        The same has to be done for the <em>ComponentServantArtifact</em>. Mind that the entry point in code should be
        implemented in the right namespace (<code>CIAO_Stock_StockBroker_Impl</code>). In this case the function is called
        "create_Stock_StockBroker_Servant". See <a href="Broker/StockBroker_svnt.h">StockBroker_exec.h</a> and
        <a href="Broker/StockBroker_svnt.cpp">StockBroker_exec.cpp</a> for more details.
      </li>
      <li>Connect <em>ComponentServantArtifact</em> and <em>ComponentImplementationArtifact</em> to
        <em>StockBrokerMonolithicImpl</em>. To connect two items, one should switch to connect mode by clicking
        <img border="0" width="16" height="16" id="_x0000_i1035" src="Icons/AddConnMode.gif" />. First click
        <em>StockBrokerMonolithicImpl</em> and then <em>ComponentServantArtifact</em>.
      </li>
    </ol>
    Don't forget to perform the previous steps for StockDistributor!<br/>
    The result of these actions is shown in figure 5a.</span>
  </p>
  <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1033" src="images/fig5a.jpg"><br>
    <br/>
    Figure 5a</span>
  </p>


    We also need to specify the connections between a <em>StockDistributorImplementation</em> and a <em>StockBrokerImplementaion</em> in
    order to construct a Quoter system. Therefore we need to create the mentioned
    StockQuoter component assemby</span></p>

  <p><span style='COLOR:black'>Assembly components provide a boundary for the composition
    of monolithic components and even other assemblies. Assembly components do not
    provide actual implementations for their interface, it is a virtual component
    that delegates its ports and attributes to one or more of the entities it
    contains. There are slight differences between modeling an assembly and
    modeling a monolithic component. Since the assembly is a virtual component, it
    is not necessary to model a </span><code><span style='FONT-SIZE:10pt;
    COLOR:black'>MonolithicImplementation</span></code><span style='COLOR:black'>.
    Instead, <em>instances</em> of other components are placed within the assembly
    and connected. Let's try to assemble the <em>StockQuoter</em>.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> Right click the <em>ComponentImplementations</em> folder, choose <strong>Insert
      Model-&gt;ComponentImplementationContainer</strong>, rename it as
      "StockQuoterImplementation" in the Attribute Panel. Double click to open it.
    </li>
    <li style='COLOR:black;'> From the Part Browser, drag a &lt;&lt;ComponentAssembly&gt;&gt; to the modeling
      window, name it "StockQuoter". Double click to open it.
    </li>
    <li style='COLOR:black;'> Now we will create two instances for interfaces <em>StockBroker</em> and <em>StockDistributor</em>.
      To do that, expand the folder <em> <span style="FONT-SIZE:10pt;
     FONT-FAMILY:'Courier New'">InterfaceDefinitions</span></em>, then expand the
     <em><span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/StockBroker</span></em>, then
     <em><span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'">InterfaceDefinitions/StockBroker/Stock</span></em> until the interface definition of <em>StockBroker</em> shows.
      While expanding the tree, always keep the "StockQuoter" &lt;&lt;ComponentAssembly&gt;&gt; window open.
      Then press the ALT key and drag <code> <span style='FONT-SIZE:10pt'>Quoter/InterfaceDefinitions/Broker/Stock/StockBroker</span></code>
      in the browser to the "StockQuoter" &lt;&lt;ComponentAssembly&gt;&gt; window'
      Repeat the same steps for <code> <span style='FONT-SIZE:10pt'>Quoter/InterfaceDefinitions/Distributor/Stock/StockDistributor</span></code>,
      and you will see two instances of component interfaces have been created as
      shown in Figure 6 (the black line in the figure only indicates .mapping)
      </li>
  </ol>
  <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1034" src="images/fig6.jpg"><br>
    <br>
    Figure 6</span></p>
  <ol start="4" type="1">
    <li style='COLOR:black;'> Create an &lt;&lt;PublishConnector&gt;&gt; by dragging it from the "Part browser" onto the "StockQuoter" window.
    </li>
    <li style='COLOR:black;'> Now assemble the components together according to <a href="images/fig1.jpg">Figure
      1</a> (make sure you change to connect mode <img border="0" width="16" height="16" id="_x0000_i1035" src="Icons/AddConnMode.gif" />)
      and the resulting assembly model should look like Figure 7. Note that to create connections between StockDistributor.notify_out and StockBroker.notify_in,
      you will need the intermediate connector &lt;&lt;PublishConnector&gt;&gt;.
    </li>
    <li style='COLOR:black;'>In one of the previous steps we've removed ComponentIOR. With ComponentIOR one could
      configure the name of the IOR file. This is still needed. In this step we need to create them again. This can
      be done by dragging two &lt;&lt;Property&gt;&gt; items from the part browser onto the window;
      one for StockBroker and one for StockDistributor. The following steps should be taken in order
      to configure both properties correct:
      <ol>
        <li>Double click on one of them. An empty window appears and the part browser only has one part, called "DataType". Drag this part onto the empty window.
        </li>
        <li>In the tree window, browse to <code> <span style='FONT-SIZE:10pt'>Quoter/PredefinedTypes</span></code>
        </li>
        <li>Drag tree item "String" onto the "DataType" item.
        </li>
        <li>Go back to the previous window and repeat these steps for the other &lt;&lt;Property&gt;&gt;.
        </li>
      </ol>
      Now it's time to configure the name and value of both &lt;&lt;Property&gt;&gt; items.
      <ul>
        <li>The name of each &lt;&lt;Property&gt;&gt; should be "edu.vanderbilt.dre.DAnCE.InstanceIOR"
        </li>
        <li>One of the values should be "StockBroker.ior"; the other one should be "StockDistributor.ior"
        </li>
      </ul>
    </li>
  </ol>
  <p align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <img border="0" id="_x0000_i1036" src="images/fig7.jpg" />
    <br><br>
    Figure 7</span></p>

  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="3"></a><span style='COLOR:black'>ComponentPackage</span></h3>
  <p><span style='COLOR:black'>This folder contains deployable component packages. Every instance in an assembly should have a corresponding
    monolithic implementation and packaged in a ComponentPackage. To create a package for <em>StockBroker</em>.instance</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> Right click folder <em>ComponentPackage</em>s , insert a
      &lt;&lt;PackageContainer&gt;&gt;, name it "Broker". Double click to open it.
    <li style='COLOR:black;'> From the PartBrowser, add the following:
      <ul type="circle">
        <li style='COLOR:black;'> a &lt;&lt;ComponentPackage&gt;&gt; named "Broker";
        <li style='COLOR:black;'> a &lt;&lt;ComponentImplementationReference&gt;&gt; named "ComponentImplBrokerRef";
        <li style='COLOR:black;'> a &lt;&lt;ComponentRef&gt;&gt; named "ComponentBrokerRef";</li>
      </ul>
    <li style='COLOR:black;'>Now we need to create references for "ComponentImplBrokerRef" and "ComponentBrokerRef".
      To create a reference in GME, simply drag the tree node in the Browser "into" the reference model.<br/>
      We need to refer &lt;&lt;ComponentImplementationReference&gt;&gt; "ComponentImplBrokerRef" to
      <code><span style='FONT-SIZE:10pt'>Quoter/ComponentImplementations/StockBrokerImplementation/StockBrokerMonolithicImpl</span></code>
      and &lt;&lt;ComponentRef&gt;&gt; "ComponentBrokerRef" to <code><span style='FONT-SIZE:10pt'>Quoter/InterfaceDefinitions/StockBroker/Stock/StockBroker</span></code>.<br/>
      For example, you should drag the tree node <code><span style='FONT-SIZE:10pt'>Quoter/ComponentImplementations/StockBroker</span></code>Implementation/StockBrokerMonolithicImpl
      into &lt;&lt;ComponentImplementationReference&gt;&gt; "ComponentImplBrokerRef".<br/> Check GME manual(tutorials) for more information.
    <li style='COLOR:black;'> Switch to Connect Mode and create two connections according to the following relationship.
      <ul type="circle">
        <li style='COLOR:black;'> &lt;&lt;ComponentImplementationReference&gt;&gt; "ComponentImplBrokerRef" implements
          &lt;&lt;ComponentPackage&gt;&gt; "Broker"
        </li>
        <li style='COLOR:black;'> &lt;&lt;ComponentPackage&gt;&gt; "Broker" realizes
          &lt;&lt;ComponentRef&gt;&gt; "ComponentBrokerRef".
        </li>
      </ul>
      <br/>
      <br/>
      The model you built should resemble Figure 8.
      <br />
      <br />
      <p align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;'><span style='COLOR:black'><img border="0" id="_x0000_i1038" src="images/fig8.jpg">
        <br><br>
        Figure 8</span>
      </p>
      <p>Now create a StockDistributor following the same steps.</p>
    </li>

    <li style='LIST-STYLE-POSITION:outside;COLOR:black;'>
      We will also need to create a component package for the assembly component StockQuoter. Remember assembly component is a virtual component, it does not "realize" a
      certain interface, so different from the Broker and Distributor packages, the StockQuoter does not need a &lt;&lt;ComponentRef&gt;&gt;. To create this model:<br/>

      <ol>
        <li>Insert a &lt;&lt;ComponentPackage&gt;&gt; named "StockQuoter"
        </li>
        <li>Add a &lt;&lt;ComponentImplementationReference&gt;&gt; named "ComponentImplStockQuoterRef", refer it to
          <code><span style='FONT-SIZE:10pt'>Quoter/ComponentImplementations/StockQuoterImplementation/StockQuoter</span></code>
        </li>
        <li>Switch to connect mode and connect &lt;&lt;ComponentImplementationReference&gt;&gt; "ComponentImplStockQuoterRef" with
          &lt;&lt;ComponentPackage&gt;&gt; "StockQuoter", as in Figure 9.
          <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1039" src="images/fig9.jpg">
            <br><br>
            Figure 9</span>
          </p>
        </li>
      </ol>
  </ol>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="4"></a><span style='COLOR:black'>InterfaceDefinitions</span></h3>
  <p><span style='COLOR:black'>
    <ol>
      <li>Nagivate to <code><span style='FONT-SIZE:10pt'>
        Quoter/InterfaceDefinitions/StockBroker/Stock</span></code> and double click it.
      </li>
      <li>Switch to connect mode and connect <em>StockBrokerHome</em> and
        <em>StockBroker</em> with each other.
      </li>
    </ol></span>
    Do the same for Distributor.
  </p>

  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="4"></a><span style='COLOR:black'>PackageConfiguration</span></h3>
  <p><span style='COLOR:black'>This folder contains just one
    model capturing specific configuration of Component packages.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> In the folder <em>PackageConfiguratio</em>n, and create a
      &lt;&lt;PackageConfigurationContainer&gt;&gt;, name it "Default", double click to open
      it.
    <li style='COLOR:black;'> Add a &lt;&lt;PackageConfiguration&gt;&gt; named "default" and a
      &lt;&lt;ComponentPackageReference&gt;&gt;, name it "StockQuoter", connect
      "Default" to "StockQuoter"
    <li style='COLOR:black;'> Refer &lt;&lt;ComponentPackageReference&gt;&gt; StockQuoter to
      &lt;&lt;ComponentPackage&gt;&gt; <code> <span style='FONT-SIZE:10pt'>Quoter/ComponentPackage/StockQuoter/StockQuoter</span></code><span style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New'"><br>
      <code>(Not &lt;&lt;ComponentImplementationReference&gt;&gt;</code></span> <code> <span style='FONT-SIZE:10pt'>Quoter/ComponentPackage/StockQuoter/ComponentImplStockQuoterRef!)&nbsp;</span></code></li>
  </ol>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="5"></a><span style='COLOR:black'>ToplevelPackage</span></h3>
  <p><span style='COLOR:black'>This folder contains one model
    capturing information about the top-level element that will be fed to the
    application.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> In the folder <em>ToplevelPackages</em>, create a
      &lt;&lt;ToplevelPackageContainer&gt;&gt; and name it "Default". Double click to
      open it.
    <li style='COLOR:black;'> Add a &lt;&lt;ToplevelPackage&gt;&gt; named "ToplevelPackage" and a
      &lt;&lt;PackageConfigurationReference&gt;&gt;, name it "Default", connect
      "ToplevelPackage" to "Default"
    <li style='COLOR:black;'> Refer "Default" to <code><span style='FONT-SIZE:10pt'>Quoter/PackageConfiguration/Default/Default</span></code></li>
  </ol>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="6"></a><span style='COLOR:black'>Targets</span></h3>
  <p><span style='COLOR:black'>This folder contains
    domain-specific models capturing information about the target environment in
    which component-based application will be deployed. In this Quoter example, we
    can either deploy the two components into ONE host, or into TWO different host.
    We will deploy the Quoter into two different host.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> In the folder <i>Targets</i>, insert a new &lt;&lt;Domain&gt;&gt; named
      "Domain"; double click to open it.
    <li style='COLOR:black;'> From the Part Browser, add two &lt;&lt;Node&gt;&gt;s, named "Broker" and
      "Distributor" respectively.</li>
  </ol>
  <p><span style='COLOR:black'><br>
    Now we are ready to deploy our Components to the actual physical environment.</span></p>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <h3><a name="7"></a><span style='COLOR:black'>DeploymentPlan</span></h3>
  <p><span style='COLOR:black'>This folder contains a plan model
    that captures information about the assignment of component to nodes.</span></p>
  <ol start="1" type="1">
    <li style='COLOR:black;'> In the folder <em>DeploymentPlan</em>, insert a model
      &lt;&lt;DeploymentPlan&gt;&gt;; name it "Plan". Double click to open it.
    <li style='COLOR:black;'> From the PartBrowser, add the following:
      <ul type="circle">
        <li style='COLOR:black;'> Two &lt;&lt;NodeReference&gt;&gt; named "Node_Broker" and "Node_Distributor"
          respectively, refering to <code> <span style='FONT-SIZE:10pt'>Quoter/Targets/Domain/Broker</span></code> and
          <code><span style='FONT-SIZE:10pt'>Quoter/Targets/Domain/Distributor</span></code> respectively.<br/>
          A &lt;&lt;CollationGroup&gt;&gt;, named "DefaultGroup", is added automatically when adding a &lt;&lt;NodeReference&gt;&gt;.
        </li>
        <li style='COLOR:black;'> Two &lt;&lt;ComponentRef&gt;&gt; named "StockBroker" and "StockDistributor"
          respectively, refering to <code> <span style='FONT-SIZE:10pt'>Quoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockBroker</span></code>
          and <code><span style='FONT-SIZE:10pt'>Quoter/ComponentImplementations/StockQuoterImplementation/StockQuoter/StockDistributor</span></code> respectively.<br/>
          Note that the &lt;&lt;ComponentRef&gt;&gt; in DeploymentPlan is not referring to the interface, but rather the actual instance of the implementation.
        </li>
      </ul>
    <p>The model should look like this:</p>
  </ol>
  <p align="center" style='MARGIN-BOTTOM:12pt;MARGIN-LEFT:0.5in;TEXT-ALIGN:center;'><span style='COLOR:black'><img border="0" id="_x0000_i1044" src="images/fig10.jpg"><br>
    <br>
    Figure 10.</span></p>
  <ol start="4" type="1">
    <li style='MARGIN-BOTTOM:12pt;COLOR:black;'> Now we need to associate &lt;&lt;ComponentRef&gt;&gt; StockBroker to the
      &lt;&lt;CollocationGroup&gt;&gt; running on the &lt;&lt;NodeReference&gt;&gt; Node_Broker, and &lt;&lt;ComponentRef&gt;&gt; StockDistributor to the
      &lt;&lt;CollocationGroup&gt;&gt; running on the &lt;&lt;NodeReference&gt;&gt; Node_Distributor. To do that, switch the Edit Mode Bar to Set Mode
      (<img border="0" width="16" height="16" id="_x0000_i1045" src="Icons/SetMode.gif">), and move the cursor to the &lt;&lt;CollocationGroup&gt;&gt; running on
      &lt;&lt;NodeReference&gt;&gt; Node_Distributor, right-click on it. You will find the cursor is changed to set mode cursor, and only the &lt;&lt;CollocationGroup&gt;&gt;
      you clicked in is highlighted, as shown in Figure 11.
    </li>
  </ol>
  <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1046" src="images/fig11.jpg">
    <!-- 01.html,v 1.3 2006/02/10 14:34:35 mxiong Exp -->
    <br><br>
    Figure 11</span>
  </p>
  <p><span style='COLOR:black'>Now move your cursor to &lt;&lt;ComponentRef&gt;&gt;&nbsp; StockDistributor, and left-click it, so that
    it looks like Figure 12.</span>
  </p>
  <p align="center" style='MARGIN-BOTTOM:12pt;TEXT-ALIGN:center'><span style='COLOR:black'><img border="0" id="_x0000_i1047" src="images/fig12.jpg"> &nbsp;<br>
    <br>
    Figure 12</span>
  </p>
  <p style='MARGIN-BOTTOM:12pt'><span style='COLOR:black'>This operation associates <em>StockDistributor</em> component to the
    &lt;&lt;CollocationGroup&gt;&gt; running on <em>Distributor</em> node. To do the same with Broker, just right-click on the associate
    &lt;&lt;CollocationGroup&gt;&gt;, and left-click on StockBroker &lt;&lt;CollocationGroup&gt;&gt; which is then highlighted.</span>
  </p>
  <div align="center" style='TEXT-ALIGN:center'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <p><a name="8"></a><span style='COLOR:black'>Up to this point, we are basically
    done with the modeling part. Before we generate anything from this model
    though, please <b>DO</b> remember to check the constraints of the model as we
    mentioned earlier.</span></p>
  <p><span style='COLOR:black'>After we are done with the modeling, the
    Deploymentplan interpreter that comes along with PICML will help us
    to generate a Plan.cdp file. Please make sure you generate
    this file to Quoter/descriptors. Note that to get the example working</span><span style="COLOR:black; FONT-FAMILY:'Courier New'">,</span><span style='COLOR:black'>a
    Node Map file (NodeMap.dat) in Quoter/descriptors should be created to map logical nodes to NodeManager object
    references,e.g:</span></p>
  <pre wrap=""><span style='COLOR:black'>DistributorNode corbaloc:iiop:localhost:30000/NodeManager</span></pre>
  <pre><span
style='COLOR:black'>BrokerNode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; corbaloc:iiop:localhost:40000/NodeManager</span></pre>
  <pre><span
style='COLOR:black'>&nbsp;</span></pre>
  <pre><span style='COLOR:black'>&nbsp;</span></pre>
  <p align="center" style='TEXT-ALIGN:center;'><span style='COLOR:black'><a href="02.html">Previous</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="04.html">Next</a> </span></p>
  <div align="center" style='TEXT-ALIGN:center;'><span style='COLOR:black'>
    <hr size="2" width="100%" align="center">
    </span></div>
  <address>
  <span style='COLOR:black'><a href="mailto:ming.xiong@vanderbilt.edu">Ming
  Xiong<br>
  </a> </span><a href="mailto:abdullah.sowayan@lmco.com">Abdullah Sowayan</a>
  </address>
  <P><SPAN style="COLOR: black"> $Id$ </SPAN>&nbsp;</P>
</div>
</body>
</html>