Having two properties for each domain object type
(one for the type name and the other for a variable name) was not seen as a viable
option.
After having produced the code for variables, imported packages, tags, exceptions,
and data types, code for each element of the insurance is generated. Listing 6.3 shows
the generated code for one danger. The code generator simply iterates through all the
domain concepts as modeling objects in the models.
Listing 6.3 Generated code for a danger ???extended noti?¬?cation period???.
122 // ****** Elementary Danger Extended Notification Period ********
123 elementaryDanger = new ElementaryDanger
("extended_notification_period");
124 elementaryDanger.setGivenName("Extended Notification Period");
125 elementaryDanger.setIsSingleton(false);
126 elementaryDanger.setIsRoot(false);
127 elementaryDanger.setIsLeaf(false);
128 elementaryDanger.setDomaintype ("extended_notification_period");
129 selectionViewFalse_.addTaggedModelElement(elementaryDanger);
130
131 productpackage_.addMofClass(elementaryDanger);
136 INSURANCE PRODUCTS
This code maps to one object of the modeling languages referring to a domain
concept Danger (see the metamodel in Fig. 6.3). Line 122 shows the comment using
the type name of the model element and its given name. This particular danger is
related to the extended noti?¬?cation period and this name is taken from the model and
used in different conventions.
Pages:
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