[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 

Forum Read-Only! Check the new site and forum here!

ApplicationManager mais limpo?  XML
Forum Index -> Comentários Gerais
Author Message
saoj



Joined: 01/07/2005 09:59:17
Messages: 2846
Location: Rio de Janeiro, RJ
Offline

O que vcs preferem:

Code:
 ActionConfig ac = new ActionConfig("/HelloWorld", HelloMentawai.class);
 ac.addConsequence(HelloMentawai.SUCCESS, new Forward("/hello.jsp"));
 ac.addConsequence(HelloMentawai.ERROR, new Forward("/username.jsp"));
 addActionConfig(ac);
 


ou

Code:
 addActionConfig(new ActionConfig("/HelloWorld", HelloMentawai.class)
         .addConsequence(HelloMentawai.SUCCESS, new Forward("/hello.jsp"))
         .addConsequence(HelloMentawai.ERROR, new Forward("/username.jsp")));
 


Acho que o segundo é menos error prone do que o primeiro.

Fica menos verbose e mais limpo.

O que acham?

O mentawai suporte os dois.

Sergio Oliveira

roberto.soares


[Avatar]

Joined: 28/06/2005 23:07:34
Messages: 20
Location: Brasil
Offline

No tipo 2, como ficaria o Action Chaining?

Code:
addActionConfig(new ActionConfig("/HelloWorld", HelloMentawai.class)
 .addConsequence(HelloMentawai.CONTINUE, new Chain("/Action"))
 .addConsequence(HelloMentawai.SUCCESS, new Forward("/hello.jsp"))
 .addConsequence(HelloMentawai.ERROR, new Forward("/username.jsp")));

Roberto Soares
[Email] [WWW] [MSN]
saoj



Joined: 01/07/2005 09:59:17
Messages: 2846
Location: Rio de Janeiro, RJ
Offline

No caso de Action Chanining até dá para usar essa sintaxe nova, mas a antiga é melhor.

Sergio Oliveira

 
Forum Index -> Comentários Gerais
Go to:   
Powered by JForum 2.1.6 © JForum Team