Populating the transformation model
Now that the project is created, we can populate the model with the different elements that we want the transformation to create:
| The first thing to do is to create a new type to contain our transformation. To do so, right-click the root element and select New Æ Type. Type client for the new type.
|
| The analysis of the examplar lets us identify the files as the artifacts we want the transform to generate:
|
The project metadata files .classpath and .project
|
The main class itso.rad75.bank.client.BankClient.java
|
| We add these artifacts to the transformation model by dragging them from the left pane (exemplar) to the right pane (model) onto the client type we just created.
|
Figure 9-5 Artifacts added to the transformation model under the client type
Note: As you can see in Figure | -5, each time you drag an artifact from the exemplar to the model:
| A create action (create project or create file) is created into the model.
|
| The corresponding artifact into the exemplar is marked by a blue check mark.
|
|
| Each of the create actions will create the corresponding Eclipse resource. Here are the names and paths of the associated exemplar artifacts:
|
RAD75PatternsClient
|
RAD75PatternsClient/.classpath
|
RAD75PatternsClient/.project
|
RAD75PatternsClient/src/itso/rad75/bank/client/BankClient.java
|
Some of the components of the names and paths that are likely to vary from one test client to another include these:
RAD75PatternsClient (project name)
|
itso/rad75/bank/client (client directory corresponding to the client package)
|
According to JET transformation best practices, these variable names have to be stored in attributes and derived attributes.