Lines 125??“127 are produced based on the MOF
compliance for inputting the speci?¬?cation into the repository. The value ???false??? is
taken from the property value of the respective model element. For example, the code
for the singleton in line 125 is produced by the generator shown in Listing 6.1.
Once the domain concepts and their attributes and operations are produced, the
generator starts to navigate through any relationships the modeling objects have.
Inheritance relationships (or property values for each domain concept) are already
used if they existed, but the main relationships usually dealt with the aggregations and
associations each object may have. To avoid reporting the same relationships multiple
times, the generator started the navigation from relationships rather than from the
objects. Listing 6.4 shows the code for an association between a particular risk and
danger. This type of relationship was already de?¬?ned in the metamodel during
language design; see Fig. 6.4.
Listing 6.4 Code for specifying association for a risk and a danger.
Lines 1565??“1569 specify the association a particular risk has and lines 1571??“1574
specify the other end of the association, connecting to a danger. The string value
consisting of numbers is a unique name for that association end. The tool needs to give
1561 // **************************************************************
1562 // Associations
1563 // **************************************************************
1564
1565 // ***** RiskRIS_dailyallowance_X_CompositeDangerCGF_basis *****
1566 risk = (Risk) productpackage_.
Pages:
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