wicket の W は(笑)の W

Preview:

DESCRIPTION

20080318 x.tokyo

Citation preview

Wicket の W は(笑)の W

Yoshiori SHOJI

X.Tokyo

自己紹介

自己紹介

•庄司 嘉織

• http://yoshiori.org/

• mailto:yoshiori@gmail.com

• java-ja やってます

Why Wicket?

http://wicket.apache.org/introduction.html

web application programming in Java• Echo

• Cocoon

• Millstone

• OXF

• Struts

• SOFIA

• Tapestry

• WebWork

• RIFE

• Spring MVC

• Canyamo

• Maverick

• JPublish

• JATO

• Folium

• Jucas

• Verge

• Niggle

• Bishop

• Barracuda

• Action Framework

• Shocks

• TeaServlet

• wingS

• Expresso

• Bento

• jStatemachine

• jZonic

• OpenEmcee

• Turbine

• Scope

• Warfare

• JWAA

• Jaffa

• Jacquard

• Macaw

• Smile

• MyFaces

• Chiba

• JBanana

• Jeenius

• JWarp

• Genie

• Melati

• Dovetail

• Cameleon

• JFormular

• Xoplon

• Japple

• Helma

• Dinamica

• WebOnSwing

• Nacho

• Cassandra

• Baritus

• Stripes

• Click

• GWT

なんで、車輪の再発明を

するの?

シンプルな答

より丸く出来たから

もう少し詳しく

Tapestryのように、普通のHTMLエディタで簡単な編集ができ、コンポーネントを指示する

のに特別なHTML属性を使用する

Echoのように、Wicketには、ファーストクラスの

コンポーネントモデルがある

でも全然ちがうよ

ほとんどのフレームワークはserver-side state の

扱いが苦手

Wicketでは、すべてのステートが自動的に管理される状態を保存するのに直接HttpSessionオブ

ジェクトか同様のラッパーを使うことはない代わりに、ステートはコンポーネントに関連

しているそれぞれのサーバサイドページコンポーネン

トはステートフルの入れ子にされた階層構造を保持する。各コンポーネントのモデルはPOJO。 各ユーザのセッションのときにこれらのページマップを維持する。

(ry

英語翻訳疲れた↓各自3回朗読

http://wicket.apache.org/introduction.html

Goals

EASY (SIMPLE / CONSISTENT / OBVIOUS)

• POJO-centric

• All code written in Java ala Swing

• Minimize "conceptual surface area"

• Avoid overuse of XML configuration files

• Fully solve back button problem

• Easy to create bookmarkable pages

• Maximum type safety and compile-time problem diagnosis

• Maximum diagnosis of run-time problems

• Minimum reliance on special tools

• Components, containers and conventions should be consistent

REUSABLE•Components written in Wicket should be fully reusable

•Reusable components should be easily distributed in ordinary JAR files

NON-INTRUSIVE• HTML or other markup not polluted with

programming semantics

• Only one simple tagging construct in markup

• Compatible with any ordinary HTML editor

• Easy for graphics designers to recognize and avoid framework tagging

• Easy to add tagging back to HTML if designers accidentally remove it

SAFE•Code is secure by default•Only explicitly bookmarkable links can expose state in the page or URL

•All logic in Java with maximum type safety

•Easy to integrate with Java security

EFFICIENT / SCALABLE•Efficient and lightweight, but not at the expense of other goals

•Clustering through sticky sessions preferred

•Clustering via session replication is easy to accomplish and easy to tune by working with detachable models.

COMPLETE• The Wicket team is committed to deliver a feature

complete, ready-to-use framework for developing Java web applications. The core framework was written and contributed by the author of this introduction, Jonathan Locke. The current team consists of a group of experienced programmers, some of which were active on some of the other frameworks stated above, and all of which have extensive experience building large scale Java web applications. We eat our own dogfood, and will thus work on Wicket from a framework user's perspective.

で、

基本•ほぼすべて session に入れるので Serializable 必須

•MVC でいうと View と ControllerStruts と同じような担当

•他のライブラリとの連携が豊富に用意されている

大事な class

• org.apache.wicket.protocol.http.WebApplication

• org.apache.wicket.Component

• org.apache.wicket.model.Model

org.apache.wicket.protocol.http.WebApplication

• 基本になるクラス

• とりあえず web.xml に書くクラス

org.apache.wicket.Component

• コンポーネント

• パーツ的なものは全部これ

こんな感じpage

formtextArea

LinkLabel

Button

(X)HTMLDOM構造

WicktJavaBean

org.apache.wicket.model.Model

• 値を保持する

• 色々抜け道(?)あり

サンプルコードで説明

•T/O

fin

Recommended