QCon 2007 Notes: SEAM

Gavin King, SEAM

  • SEAM offers basic scaffolding, like Rails, Grails, etc. Out of the box there’s: a project skeleton, and ANT deploy, JPA integration, JSF integration, and basic login functionality.
  • GK offered a short diatribe against unit tests, which nobody wants to write and nobody should have to read: the tests GK cares about are integration tests of the user’s experience.
  • The SEAM debug page lets you interrogate anything in the context
  • Security is as simple as adding an annotation @Restrict("#{identity.loggedIn}")(Note that most places where SEAM takes a String you can pass in EL)
  • Navigation is also simple: make action methods return a String, for instance “/home.xhtml”, and then the returned value is used to enact a redirect.
    • If you want more decoupling, you can add a N.page.xml file and include the redirect-to strings there.
  • SEAM isn’t xml-heavy, but there is certainly some xml (but with autocomplete and checking that isn’t so bad)
  • SEAM offers a single
    • component model to handle JSF, EJB3, BPM, WS, ESB
    • rendering framework for html, pdf, email, etc (email.xhtml is just another JSF page)
  • You can bind components which access the database to the view: Java would call this heresy, but that’s why everyone else thinks Java is over-engineered.
  • The test database is an in-memory HSQLDB instance, and the dev database is selected when you create the scaffolding
  • JSF is fantastic at form handling, apparently
  • By default, a SEAM component is valid for one request, but we can change that with a simple annotation @Scope(ScopeType.CONVERSATION), and this sorts the back-button problem at the same time.
  • Ajax is covered out of the box: instead of a standard h:commandButton element, use a a:commandButton element, and add a rerender attribute for the bit of the page to be redrawn
  • As with Grails (and Rails and I think RIFE — SM), most validation is model-based, and Hibernate Validator is picked up by SEAM in form submit validation
  • Note the servlet spec gives no way of handling concurrent access to web state; so SEAM queues them. End of problem.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply