[YMIR-298] PageクラスのBaseにアクションやプロパティのStaticFinal定義を追加 Created: 2009-01-24 Updated: 2009-03-06 Resolved: 2009-03-06 |
|
Status: | Closed |
Project: | Ymir |
Component/s: | ymir-extension |
Affects Version/s: | 1.0.0 |
Fix Version/s: | 1.0.2 |
Type: | Improvement | Priority: | Major |
Reporter: | jflute | Assignee: | skirnir |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Description |
【概要】 @In(scopeClass = ConversationScope.class, actionName = "_get") public void setCondition(ConditionDto condition) { this.condition = condition; } というように、actionNameに「_get」と指定したりしますが、 アクションやプロパティは基本的に必ずPageクラスのBaseに定義されているため、 // 例えば、PageクラスのBaseに「String ACT_get = "_get"」と定義されていれば @In(scopeClass = ConversationScope.class, actionName = ACT_get) public void setCondition(ConditionDto condition) { this.condition = condition; } Conversationだけでなく、バリデーションなどアクションやプロパティを StringのStaticFinalでなく、独自のクラスの定義にしてもいいかも。 // 例えば、PageクラスのBaseに「Action ACT_get = "_get"」と定義されていれば。 // そして、@Inには「Action[] action」という属性を追加。 @In(scopeClass = ConversationScope.class, action = ACT_get) public void setCondition(ConditionDto condition) { this.condition = condition; } |
Comments |
Comment by skirnir [ 2009-03-06 ] |
完了とします。 |
Comment by jflute [ 2009-03-06 ] |
確認しましたー。ありがとうございます。 |
Comment by skirnir [ 2009-03-06 ] |
対処しました(r2899)。 |
Comment by jflute [ 2009-02-24 ] |
あと、できれば、URLもあると良いです。 URL = "/member/search/input.html";
|
Comment by jflute [ 2009-01-27 ] |
議論結果、実装することに。 // xxx.member.edit.InputPageクラスだとして PKG = "member.edit" NAME = "input" // プロパティ P_memberName = "memberName" P_memberAccount = "memberAccount" ... // アクション A_get = "_get" A_post_confirm = "_post_confirm" ... |
Comment by skirnir [ 2009-01-26 ] |
Stringのリテラルを極力タイプセーフにする感じですかね。良いと思います。何かの名前を変えた場合は定数名も変わり、その定数を参照している箇所はビルドエラーになるので、追従できていない箇所が分かりやすいと思います。 |
Comment by jflute [ 2009-01-26 ] |
定義名ですが、もっと割り切って: // xxx.member.edit.InputPageクラスだとして PKG = "member.edit" PAGE = "input" // プロパティ P_memberName = "memberName" P_memberAccount = "memberAccount" ... // アクション A_get = "_get" A_post_confirm = "_post_confirm" ... って短くてもいいかもです。 |
Comment by jflute [ 2009-01-26 ] |
> Conversationだけでなく、バリデーションなどアクションやプロパティを |
Comment by jflute [ 2009-01-24 ] |
まとめると、以下のようなイメージ: // xxx.member.edit.InputPageクラスだとして PKG = "member.edit" PAGE = "input" // プロパティ PROP_memberName = "memberName" PROP_memberAccount = "memberAccount" ... // アクション ACT_get = "_get" ACT_post_confirm = "_post_confirm" ... |
Comment by jflute [ 2009-01-24 ] |
プロパティ名やアクション名だけでなく、「パッケージ名」や @Conversation(name = "edit", phase = "input", followAfter = { "list", "confirm" }) public class InputPage extends InputPageBase { というConversation定義が @Conversation(name = PKG, phase = PAGE, followAfter = { ListPage.PAGE, ListPage.PAGE }) のようになります。 実際にはConversationは自由度の高いものであり、 |
Comment by jflute [ 2009-01-24 ] |
> StringのStaticFinalでなく、独自のクラスの定義にしてもいいかも。 |