SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 256 | Next

Steven Kelly and Juha-Pekka Tolvanen

"Domain-Specific Modeling"

This code is produced by the
generator ???_Package class main??? (see Fig. 6.8). The string ???Basis??? in line 15 refers to
the product name taken from the Product object and its property Given name (see the
metamodel in Fig. 6.3). Similarly, the string ???BBBasis??? in lines 17 and 18 is taken
from the name property of the Package object that refers to the insurance speci?¬?cation.
All the rest is produced by the generator since they are common for the
implementation.
Listing 6.2 Produced code for a product called BASIS.
15 public class Basis extends ProductRepository
16 {
17 private static BBBasisProductRepository instance;
18 private BBBasisProductRepository (String name)
19 {
20 super(name);
21 MofPackage productpackage = createProduct();
22 this.addMofPackage(productpackage);
23 }
This code is followed by the de?¬?nition of the variables for each domain-speci?¬?c
type used in the speci?¬?ed product. The generator named ???_Global instances???
(Fig. 6.8) created the necessary global variables. To follow naming conventions, the
variable names had to be written starting with a small letter. For such a convention, the
generator could either translate each name for a required naming convention or just
add an arbitrary lower case letter in front of the name. Note that it was not possible to
ask the user to give a name correctly for code generation or place in the metamodel a
rule that the name start with a lower case letter since the same value is used elsewhere
starting with a capital letter.


Pages:
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
nianie Warszawa liceum dla dorosłych warszawa AutoGiełda MOTO OGŁOSZENIA Pościel dziecięca Bielizna