I understand the changes and why, but the users like CRUD screens...

Really I used a similar approach in the CRUD case before asking you, but I
needed to be sure that is the best way. 
In my case, I changed the template to render only one form with onclik
events in the buttons and ignoring fields already rendered, now I'm
thinking about a way to keep the struts validator working that way... I
think it's ok.

About reusing the activity graph with another controller class, since we
can assign only one class with the activity graph, I'm thinking in a way
to create new classes inheriting the controller methods, but the following
code:

    private final static Controller INSTANCE = new Controller();

makes it impossible... maybe the controller class should have a static
method to initialize the singleton and that could be different to each new
derived class... any idea ?

regards,

Walter

"Wouter Zoons" <[EMAIL PROTECTED]> grava:
>Hi Walter,
>
>Thanks for the feedback, keep it coming, I need it to improve the docs.
>
>See my response below:
>
>> I'm building a small project (library management) to teach the
>"modelers"
>> of my company how to work with andromda/bpm4struts, and I have some
>doubts
>> about the way to model an activity.
>> - Is there a way to have more than one controller class to the same
>> activity diagram, as before ?
>
>bpm4struts has changed radically, there are too many reasons to explain,
>but you have to know that for example working with the DispatchAction
>imposes too many issues in the long run, although it has always been a
>very attractive and clean solution (for the C in MVC)
>
>
>
>
>> - I could not think a way to model a screen with more than one button,
>> like a CRUD. Could you please make a small activity graph example or
>> suggest another way ?
>> 
>
>you mean in the new version, right ? it's very easy, but you have to
>understand how bpm4struts behaves by default:
>
>Each page can trigger actions, each action is represented by a button.
>An action may carry parameters to send to the server (often represented
>by input fields).
>
>Because each action may result in a call to a different Struts action
>class I'm rendering a different form with a single button for each one
>of them.
>
>So if you have CRUD operations you'll probably want to reuse the input
>fields in the page and have 4 buttons that will call the same action
>when clicked, all in the same form. This is how it was done in the
>previous version.
>
>Unfortunately you cannot do that anymore because each 'create',
>'update', ... operation will call a different action, and in HTML this
>means a different form for each of them.
>
>The reasoning behind this is very straightforward: each operation in
>CRUD is really a different operation, trying to combine them in the UML
>model is hacking and is not correct.
>
>The clean solution is this:
>
>1) model each crud operation differently, that means, on the desired
>page you will model an outgoing transition (<<FrontEndEvent>>) for each
>CRUD operation. That means 4 transitions in total.
>
>2) give the trigger on each transition a good name, such as 'create',
>'read', 'update' and 'delete'
>
>3) each operation should take different parameters (or maybe in this
>case they're all the same), so model for each operation the appropriate
>parameters on the corresponding transition
>
>that's it
>
>
>in your case you might now see 4 times the same form, each time with a
>different button
>
>to reuse a single form proceed like this (manually updating the JSP
>page):
>
>4) remove forms 2, 3 and 4; only work with form #1 but keep all buttons
>
>5) intercept the click on the submit buttons and set the 'action'
>attribute of the form to the appropriate URL, something like this:
>
><html:submit ... onclick="this.form.action='/myapp/create.do'; return
>true;" ... />
>
>this will make each submit button call a different action but still
>reuse the same input fields/form
>
>
>I hope this answers you question.
>
>If you are using MagicDraw you can send me your UML model and if you
>explain me in detail what you want I will model it for you.
>
>
>Good luck
>Wouter.
>
>
>




---------------------------------------------------------------------------
Walter Itamar Mour�o - Diretor de Tecnologia e Projetos - Arcadian S/A
www.arcadian.com.br



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Andromda-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to