Wicket In Action Chapter12読了

仕事の都合で先にChapter12の認証について読むことにした。

まずはカスタムSessionを使用して認証情報を管理する手法が説明されています。
そしてログインページをPanel化し、最後にIAuthorizationStrategyを使用した認証ロジックのカスタマイズまで網羅しています。
この辺を抑えておけばwicket-auth-roleパッケージの作りが一通り分かる構成になっています。

特にIAuthorizationStrategyの作りを追ってると、おもしろいですね。
ページの生成時に呼び出されるisInstantiationAuthorizedメソッドと、render時等に呼ばれるisActionAuthorizedメソッドをオーバライドする事で、認証の仕組みを独自に組み込める柔軟性には感心してしまいます。
この「オブジェクト指向をぶん回している感じ」が、やはりWicketの素敵な所ですね。

さらにwicket-auth-roleのソースを読んでおくと、この章の理解が深まると思います。

Wicket in Action Table of Contents
Part 1 Getting started with Wicket
1. What is Wicket?
2. The architecture of Wicket
3. Setting up a Wicket project
4. Building a cheesy Wicket application

Part 2 Getting a basic grip on Wicket
5. Understanding models
6. Using basic components
7. Using forms for data entry
8. Composing your pages

Part 3 Advanced Wicket
9. Creating custom components
10. Working with Wicket resources
11. Rich components and Ajax
12. Authentication and authorization
13. Localization
14. Multi-tiered architecture
15. Putting your application in production
16. Component index

Comment