30
Wicket の W は (笑)の W Yoshiori SHOJI X.Tokyo

wicket の W は(笑)の W

Embed Size (px)

DESCRIPTION

20080318 x.tokyo

Citation preview

Page 1: wicket の W は(笑)の W

Wicket の W は(笑)の W

Yoshiori SHOJI

X.Tokyo

Page 2: wicket の W は(笑)の W

自己紹介

Page 3: wicket の W は(笑)の W

自己紹介

•庄司 嘉織

• http://yoshiori.org/

• mailto:[email protected]

• java-ja やってます

Page 4: wicket の W は(笑)の W

Why Wicket?

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

Page 5: wicket の W は(笑)の W

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

Page 6: wicket の W は(笑)の W

なんで、車輪の再発明を

するの?

Page 7: wicket の W は(笑)の W

シンプルな答

Page 8: wicket の W は(笑)の W

より丸く出来たから

Page 9: wicket の W は(笑)の W

もう少し詳しく

Page 10: wicket の W は(笑)の W

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

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

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

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

Page 11: wicket の W は(笑)の W

でも全然ちがうよ

Page 12: wicket の W は(笑)の W

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

扱いが苦手

Page 13: wicket の W は(笑)の W

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

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

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

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

(ry

Page 14: wicket の W は(笑)の W

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

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

Page 15: wicket の W は(笑)の W

Goals

Page 16: wicket の W は(笑)の W

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

Page 17: wicket の W は(笑)の W

REUSABLE•Components written in Wicket should be fully reusable

•Reusable components should be easily distributed in ordinary JAR files

Page 18: wicket の W は(笑)の W

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

Page 19: wicket の W は(笑)の W

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

Page 20: wicket の W は(笑)の W

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.

Page 21: wicket の W は(笑)の W

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.

Page 22: wicket の W は(笑)の W

で、

Page 23: wicket の W は(笑)の W

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

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

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

Page 24: wicket の W は(笑)の W

大事な class

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

• org.apache.wicket.Component

• org.apache.wicket.model.Model

Page 25: wicket の W は(笑)の W

org.apache.wicket.protocol.http.WebApplication

• 基本になるクラス

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

Page 26: wicket の W は(笑)の W

org.apache.wicket.Component

• コンポーネント

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

Page 27: wicket の W は(笑)の W

こんな感じpage

formtextArea

LinkLabel

Button

(X)HTMLDOM構造

WicktJavaBean

Page 28: wicket の W は(笑)の W

org.apache.wicket.model.Model

• 値を保持する

• 色々抜け道(?)あり

Page 29: wicket の W は(笑)の W

サンプルコードで説明

•T/O

Page 30: wicket の W は(笑)の W

fin