27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ize:Class”, with an empty precondition set, and with the only<br />

effect being the proposition “specialization(Class)”, where<br />

Class is the name of the class that contains the method being<br />

overwritten.<br />

Let us use the Diagram from figure 2 as an example. This<br />

diagram represents the sequence for updating a screen in the<br />

SWING framework. To use this function, it is necessary to<br />

overwrite the method paint of a class that specializes a “Panel”.<br />

Then this mechanism must be started by the method “validate”<br />

from a “JFrame” object. Once overwritten, it is possible to use<br />

an object of the type “Graphics”. Using this information, the<br />

following operators are made:<br />

Name : overwrite:Panel.paint<br />

PC : sequence(Update Screen),<br />

link(JFrame, Panel), specialization(Panel)<br />

E : object(Graphics)<br />

Name : specialize:Panel<br />

PC : {}<br />

E : specialization(Panel)<br />

IV. CREATING SEQUENCE DIAGRAMS<br />

To make the sequence diagrams, a partial order planner<br />

is used. The planner requires three inputs: a set of possible<br />

operators, a goal state and an initial state. The possible<br />

operators are the ones constructed based on the framework<br />

model. The goal state will be a state composed of a proposition<br />

“interface(Target Interface)”, representing the interface that the<br />

user wishes to execute and an empty initial state will be used,<br />

so that it is considered that no element of the framework is<br />

currently being used.<br />

Fig. 5: Sequence diagram resulting from the plan from figure 4<br />

Activities Diagram shown in figure 6. This diagram shows the<br />

application needs to first create a window, then ask the user to<br />

choose an image file, then print the selected file in the screen.<br />

<br />

<br />

<br />

<br />

Fig. 4: Plan for the goal “interface(Create Window)”<br />

Using these inputs, the planner will generate a sequence<br />

of operators that will allow the correct use of the desired<br />

interface. Using this plan, a sequence diagram is made in such<br />

a way that the methods it contains reflect the order of the<br />

operators used in the plan.<br />

For example, let us consider a user that wishes to use<br />

the interface “Create Window” from the SWING framework.<br />

First, all the operators from the framework would be extracted,<br />

following the steps described in section III. Next, the planner<br />

would be initialized with an empty state, the framework operators<br />

and the goal “interface(Create Window)”. This would<br />

result in the plan shown in figure 4. Next, based on this plan,<br />

the sequence diagram shown in figure 5 can be constructed.<br />

This is a very simple example of how this method can<br />

be used. It becomes more interesting when a sequence of<br />

interfaces is desired, using it as the description for the behavior<br />

of an application.<br />

Suppose, then, a simple application for visualizing images.<br />

One possible way to model this application behavior is by the<br />

Fig. 6: Activity Diagram of the Image Viewer Application<br />

To complete this application model, let us use a simple Class<br />

Diagram, composed of only one class with a single method,<br />

responsible for the sequence of actions. Such diagram is shown<br />

in figure 7.<br />

Fig. 7: Class Diagram of the Image Viewer Application<br />

Using the activities described in figure 6 as the goals<br />

for the application, we get the sequence of propositions:<br />

566

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

Saved successfully!

Ooh no, something went wrong!