صفحه 1:
JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket
Matt Raible
matt@raibledesigns.com
http://raibledesigns.com
Raitle Designs oon
صفحه 2:
Today's Agenda
@ Introductions
@ Pros and Cons
8 Smackdown
@ Conclusion
@ QandA
صفحه 3:
۳۳-۴ سس ٍ
Introductions
© Your experience with webapps?
© Your experience with Java EE2
@ What do you want to get from this session?
@ Experience with Maven, Tomcat, Hibernate, Spring?
@ Web Framework Experience:
@ Spring MVC, Struts 2, Stripes, JSF, Tapestry,
Wicket
صفحه 4:
Who is Matt Raible?
@ Power user of Java Open Source Frameworks
@ Author of Spring Live and Pro JSP 2.0
© Founder of AppFuse and AppFuse Light
@ Member of Java EE 5, JSF 1.2 and Bean Validation
Expert Groups
2 Committer on Apache Projects: Roller and Struts
@ Java Blogger since 2002
Crt
LIVE
صفحه 5:
Struts بچییجو.
و
Struts
/ ۵ ۱
Sorin g مويل
||/Stripes Q@ werner
صفحه 6:
My Experience
صفحه 7:
Pros and Cons
I've got a new way for
you to build web apps!
Raible D.
صفحه 8:
JSF
@ Pros:
@ Java EE Standard - lots of demand and jobs
@ Fast and easy to develop with initially
@ Lots of component libraries
@ Cons:
@ Tag soup for JSPs
@ Doesn't play well with REST or Security
@ No single source for implementation
صفحه 9:
رم
Spring MVC
@ Lifecyle for overriding binding, validation, etc.
@ Integrates with many view options seamlessly:
JSP/JSTL, Tiles, Velocity, FreeMarker, Excel, PDF
@ Inversion of Control makes it easy to test
@ Cons:
@ Configuration intensive - lots of XML
@ Almost too flexible - no common parent
Controller
2 No built-in Ajax support
صفحه 10:
Stripes
@ Pros:
و No XML - Convention over Configuration
© Good documentation (easy to learn)
@ Enthusiastic community
@ Cons:
2 Small Community
@ Notas actively developed as other projects
@ Hard-coded URLs in ActionBeans
صفحه 11:
۳۳-۴ سس ٍ
Struts 2
@ Pros:
@ Simple architecture - easy to extend
@ Tag Library is easy to customize with
FreeMarker or Velocity
© Controller-based or page-based navigation
@ Cons:
@ Documentation is poorly organized
@ No feedback for missing properties or invalid
OGNL expressions
@ Googling results in Struts 1.x documentation
صفحه 12:
Tapestry
@ Pros:
@ Very productive once you learn it
@ Templates are HTML - great for designers
@ Lots of innovation between releases
@ Cons:
2 Documentation very conceptual, rather than
pragmatic
@ Steep learning curve
@ Long release cycles - major upgrades every year
صفحه 13:
۳۳-۴ سس ٍ
Wicket
@ Pros:
@ Great for Java developers, not web developers
@ Tight binding between pages and views
@ Active community - support from the creators
@ Cons:
@ HTML templates live next to Java code
@ Need to have a good grasp of OO
@ The Wicket Way - everything done in Java
صفحه 14:
The Smackdown
صفحه 15:
۳۳-۴ سس ٍ
Evaluation Criteria
Ajax Support: Is it built-in and easy to use? و
2 Bookmark-ability: Can users bookmark pages and
return to them easily?
@ Validation: How easy is it to use and does it support
client-side JavaScript) validation?
@ Testability: How easy is it to test Controllers out of
container?
صفحه 16:
دحع_عٍعچ حجچجچحچ چعچٍ
Evaluation Criteria, cont.
@ Post and Redirect: How does the framework handle
the duplicate post problem?
@ Internationalization: How is i18n supported and
how easy is it to get messages in Controllers?
@ Page Decoration: What sort of page decoration/
composition mechanisms does the framework
support?
@ Community and Support: Can you get questions
answered quickly (and respectfully)?
صفحه 17:
دحع_عٍعچ حجچجچحچ چعچٍ
Evaluation Criteria, cont.
@ Tools: وا there good tool (particularly IDE) support
for the framework?
@ Marketability of Skills: If you learn the framework,
will it help you get a job?
© Job Count: What is the demand for framework skills
on dice.com and indeed.com?
صفحه 18:
Ajax Support
@ Is Ajax support built-in and easy to use?
@ JSF: No Ajax support, use ICEfaces and Ajax4JSF
@ Stripes: No libraries, supports streaming results
@ Struts 2: Dojo built-in, plugins for GWT, JSON
@ Spring MVC: No libraries, use DWR & Spring
MVC Extras
@ Tapestry: Dojo built-in in 4.1
@ Wicket: Dojo and Script.aculo.us (Wicket Stuff)
صفحه 19:
Bookmarking and URLs
@ JSF does a POST for everything - URLs not even
considered
@ Stripes uses conventions, but you can override
@ Struts 2 has namespaces - makes it easy
@ Spring MVC allows full URL control
@ Tapestry still has somewhat ugly URLs
@ Wicket allows pages/URLs to be mounted
صفحه 20:
۳۳-۴ سس ٍ
Validation
@ JSF has ugly default messages, but easiest to
configure
@ Spring MVC allows you to use Commons Validator -
a mature solution
@ Struts 2 uses OGNL for powerful expressions -
client-side only works when specifying rules on
Actions
@ Tapestry has very robust validation - good messages
without need to customize
@ Stripes and Wicket do validation in Java - no client-
side
صفحه 21:
Testability
@ Spring and Struts 2 allow easy testing with mocks
(e.g. EasyMock, jMock, Spring Mocks)
@ Tapestry appears difficult to test because page
classes are abstract, Creator class simplifies
@ JSF page classes can be easily tested and actually
look a lot like Struts 2 actions
@ Wicket has WicketTester, a powerful solution
@ Stripes has Servlet AP] Mocks and MockRoundtrip
صفحه 22:
Post and Redirect
@ The duplicate-post problem: redirect after POST
@ Is there support for allowing success messages to
live through a redirect?
© Spring MVC allows you to add parameters to a
redirect
@ Stripes, Tapestry and Wicket all have "flash"
support
@ Struts 2 requires a custom solution
@ JSF requires a custom solution, i18n messages
difficult to get in page beans
صفحه 23:
29233331 27 ٠ر121 1 .سس
Internationalization
@ JSTL’s <fmt:message> tag makes it easy
@ No standard for getting i18n messages in controller
classes
@ Stripes, Spring MVC and JSF use a single
ResourceBundle per locale
@ Struts 2, Tapestry and Wicket advocate separate files
for each page/action
@ JSF requires resource bundle to be declared on each
page
@ Tapestry's <span key="key.name"> is awesome
صفحه 24:
رم
Page Decoration
@ Tiles Experience: used since it first came out
@ SiteMesh is much easier to setup and use
@ Tiles can be used in Struts 2, Spring and JSF
@ Requires configuration for each page
@ SiteMesh can be used with all frameworks
@ Requires very little maintenance after setup
@ SiteMesh not supported or recommended for use
with JSF, Tapestry or Wicket
صفحه 25:
Marketability of Skills
@ Struts 1 is still in high-demand and widely-used
@ Spring is getting more press, but mostly due to the
framework’s other features
@ JSF is becoming popular; awful with JSP
@ Struts 2 is gaining ground, but very scarce on job
boards
@ Tapestry has increased in popularity in last couple
years
@ Wicket and Stripes are virtually unknown
صفحه 26:
Pretty Graphs
صفحه 27:
Dice.com Job Count
۳ ۱ Struts 2
® Spring MVC
748 BB Stripes
5
600 ™ Wicket
1178 Tapestry
400
200
5 امد
تا سس 0
15
November 14, 2007
صفحه 28:
Dice Job with Struts 1.x
۱ Struts 2
aus BH Spring MVC
BB Stripes
5 ع5
2,250 ! Wicket
۲"
19 Struts 1
1,500
750
748
0 لح حا _
November 1 4, 2007
صفحه 29:
Job Trends
Job Trends
——struts2 — webwork — spring mvc — stripes java — jsfjava tapestry java
I— wicket java
= 5 5
Percentage of Matching Job Postings
Apr'0S Jul'05 Oct 05 Jan'06 Apr'06 Jul’06 0606 مهل 07 Apr'O? Jul'O7
www.indeed.com Feb 3, 2005 - Sep 27, 2007
صفحه 30:
Job Trends vs. Struts
Job Trends
——struts2 — webwork — spring mvc — stripes java — jsfjava tapestry java
I— wicket java > struts
01
Apr'0S مول 0105 08'ابل 06'رصث 05'سول 0605 05'ابل 07 Apr'O7 Jul ‘07
www.indeed.com Feb 3, 2005 - Sep 27, 2007
Percentage of Matching Job Postings
صفحه 31:
[۵9 1161005 ۷۶۰ 2۳
Job Trends
——struts2 — webwork — spring mvc — stripes java — jsfjava tapestry java
سح wicket java == j2ee
15
Apr'0S مول 0405 08'ابل 06رصث 05'سول 0605 05 انا 07 Apr'O7 Jul ‘07
www.indeed.com Feb 3, 2005 - Sep 27, 2007
Percentage of Matching Job Postings
صفحه 32:
رم
Job Trends vs. Java
Job Trends
——struts2 — webwork — spring mvc — stripes java — jsfjava tapestry java
I— wicket java > j2ee سس java
Percentage of Matching Job Postings
Apr’0S 05'الال 01005 Jan'06 Apr'OS Jul06 0606 07'سقل Apr'O7 7
www.indeed.com Feb 3, 2005 - Sep 27, 2007
صفحه 33:
Employer Search on Monster.com
Resumes posted in last 2 weeks
118 Struts 2
®@ Spring MVC
Stripes
™ Wicket
SF
۱۷ Tapestry
صفحه 34:
Mailing List 0
Struts
Stripes
MyFaces
Tapestry
Wicket
0 500 1,000 1,500 2,000
* Spring MVC is not listed here because they have a forum instead of a mailing list and I couldn’t
figure out a way to count the number of messages for each month
صفحه 35:
Releases in 2007
10.0 MM Struts 2
® Spring MVC
M™ Stripes
75 [MyFaces
™ Wicket
3 ۳ ت۱۳
5 pesiry
7
25
0
صفحه 36:
Tools Available
Struts 2
Spring MVC
Stripes
Wicket
JSF
Tapestry
15.00
11.25
7,50
“ a 12 7
۲ a ا
0 0
May 2007
صفحه 37:
Books on Amazon
8 ۲ ۷۶ 2
® Spring MVC
M™ Stripes
ع5 ۳ 75
10
™ Wicket
۲ Tapestr
58 1 pestry
7
۱ ۱
0 ۳
October 2007
صفحه 38:
How do you choose?
صفحه 39:
Eliminate, Don’t Include
صفحه 40:
صفحه 41:
دحع_عٍعچ حجچجچحچ چعچٍ
Important Factors 6
@ What type of Application are you building?
@ Ease of Development / Is full-stack an option?
@ Project Community
@ Project Future and Roadmap
8 Maintenance
@ Technical Features
صفحه 42:
Don’t believe the Hype
@ Don’t believe blogs and articles
@ Try it yourself
@ Believe developers, not evangelists
@ Believe developers that are experienced with the
framework and have used it in production
@ Beware of corporate interests - they can twist
marketing
@ Books are a good sign
صفحه 43:
Best Tool for the Job
@ Frameworks have sweet spots - is your
application one of them?
@ Pick 2-3 frameworks for your type of application...
@ ... and prototype!
@ If prototyping is painful, switch
@ Make sure you prototype more than one and doa
presentation comparing the pros and cons of each
صفحه 44:
After Choosing...
2 Document the reasons for your decision
@ Allow developers to challenge it
@ Allow your prototype to be written with other
frameworks
@ Don’t be afraid to try new frameworks
@ Don't be afraid to use old frameworks
@ Don’t be afraid to keep your existing framework
صفحه 45:
What do I think?
صفحه 46:
SOFEA (Service-Oriented Front-End Architecture)
PF) 7
‘Client Application
Download
Server
Application Download
(AD)
۷
1
SOA Business
Services
> ee
Baty tntarchng
REST
Application
Container \_ Service
Interface
صفحه 47:
29233331 27 ٠ر121 1 .سس
Conclusion
@ The future is bright because of all the competition
@ Developers should know more than one web
framework
© You should try a framework before dissing it
@ The plethora of web frameworks is a good thing!
@ Doing proper research can save time and money
@ Testing is the best path to future maintenance
صفحه 48:
http://raibledesigns.com/rd/page/pul