02.04.2013 Views

CONTENTS

CONTENTS

CONTENTS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

196 I. LAZĂR, S. MOTOGNA, AND B. PÂRV(1)<br />

Figure 2. (a) Creating a New Action (b) Domain Classes<br />

generating identity properties and basic persistence operations - Figure 2 - (b). See<br />

[5] for more details about our Object-Relational Mapping infrastructure.<br />

C. Create a new conversation and design its flow. As for actions, we are<br />

prompted to enter the conversation name and to choose its owner component. Figures<br />

3 and 4 present the result of creating a NewCustomer conversation and a new<br />

EditCustomer owner component: an EditCustomer class associated to the ConversationScope<br />

is created and a NewCustomer state machine is added in the context of<br />

this class. At this stage, the generated artifacts do not contain other elements. For<br />

saving space, Figures 3 and 4 show only the final result of the model prototype.<br />

Now we design the states and the conversation flow. Before running the model<br />

prototype we change the content of Index in order to execute our conversation - see<br />

Figure 5. A view is dynamically generated for each state. At the moment, we have<br />

obtained an executable conversation, but no data is presented. Next, we are going to<br />

enhance our conversation by adding actions and establishing data bindings.<br />

Figure 3. NewCustomer State Machine<br />

D. Add actions to a conversation. At this step we add behaviors to the state<br />

machine in order to produce the data required by the conversation. fUML activities<br />

may be added for specifying behaviors to be performed on a transition when the<br />

transition fires, or as entry/exit behaviors executed when a state is entered/exited. All<br />

activities must belong to the component, in order to easily access the conversational<br />

state. Figures 3 and 4 show the result of this process for our case study. initialize is<br />

added to create a new customer instance, save is added to store the new customer,<br />

and checkPassword is an intermediate step.<br />

Figure 4. EditCustomer Controller<br />

E. Generate views. Finally we can generate the views - see Figure 5. The views<br />

contain only presentation elements together with their mappings, the navigation part<br />

being defined by the state machine. When running the model prototype, actions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!