Storyboard TTC2011HelloWorldModelToText

For model to text transformation we provide a simple template mechanism.

The model transformation that builds our object model looks like:

      GreetingPO greetingPO = (GreetingPO) new Pattern<Pattern>()
            .startCreate()
            .has(new GreetingPO());

      GreetingMessagePO greetingMessagePO = greetingPO.hasGreetingMessage() 
            .hasText("Hello");

      PersonPO personPO = greetingPO.hasPerson()
            .hasName("TTC Participants");

The created object model looks like:

The model to text transfromation template mechanism is used like this:

      systemout = CGUtil.replaceAll("message name", 
         "message", greetingMessagePO.getText(),
         "name", personPO.getName());

systemout: Hello TTC Participants

Assume we change the text manually to: Hi dudes

      CGUtil.find("Hi dudes ", 0, "message name ", 
         "message", greetingMessagePO, GreetingMessage.PROPERTY_TEXT,
         "name", personPO, Person.PROPERTY_NAME
            );

Alternatively, plain java code that does the model to text transformation looks like:

      systemout = greetingMessagePO.getText() + " " + personPO.getName();