• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Seam Applications

Introduction to Seam Applications



An introduction to JBoss Seam framework

An introduction to JBoss Seam framework



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Introduction to Seam Applications Introduction to Seam Applications Presentation Transcript

    • Introduction to Seam Applications Nuwan Gunarathna www.geveo.com
    • Agenda
      • Common WebApp Development Patterns.
      • Why Seam?
      • Features.
      • CRUD App demo with seam-gen.
      • Q&A
    • Today’s Web Applications
      • Too many layers
        • Too many Integration Points
        • Too much Xml configuration
      • For new features, You have to lean new Frameworks
      • “ Stateless” Architecture
      • JSF falls short – Not fully enough for Web 2.0
      • Not a platform, merely a set of libraries and wrappers
      • Documentation is not at one place(Too many dependent frameworks)
    • Why Seam?
      • To provide a Complete solution for Java Web Application
        • Whithin an Application
      • Is it good? Yes.
      Gavin King
    • Some Good Reasons
      • Stateful Wep Applications
        • All components are inherently stateful – no need state management Code
      • Configuration by Exception( convention over configuration )
        • Idea is to have a common-sense default behaviors for components
      • Gluing JSF and EJB3 across framework boundaries.
        • Collapse artificial façade object layer in between
      • Annotation based integration
      • Gives correct wayt to use ORM
        • Lazy loading just works fine: Eliminate most encountered Exception with stateless frameworks all the time
        • Only framework that support lazy loading correctly in web application
    • Some Good Reasons cont..
      • No more DTOs to write
      • POJO as business services
        • No framework interfaces, No Abstract classes
        • Using dependency bijection
      • App Generator via seam-gen (aka scaffolding)
      • It makes persistence a breeze
      • Annotations over XML, end to end
      • Automated integration testing using TestNg and JUnit
      • And many more … (Rules Engine, BPM, Ajax Support, Pdf, E-mail, RESTful …)
      • Open source. Open standards. Future of Java EE
    • Layers in Seam View (JSF/Wicket/GWT/Flex etc.,) Business Layer (SFSB/SLSB/POJO) DB Persistence Layer (Entities) Hey, No Integration Layer!
        Seam exposes Business Layer objects and their attributes on the front-end using EL expressions.
      • No DAOs
      • No DTOs
    • Contextual Components
      • Most of the problems relate to state management
      • Traditional contexts for Java Servlets focused on technology instead of on application
      • EJB itself has no strong model of state management
      • We need a richer context model that includes “logical” context
      • We should be able to use annotations everywhere
      • An EJB should be able to be a JSF managed bean (vice versa)
      • Main idea: realization of desktop-like wizards and dialogs, possibly in parallel
      • It makes sense to think of binding EJB components directly to the JSF view
    • The Seam Context Model *source: www.reverttoconsole.com
    • Conversations
      • Conversations are not that exciting until you really start thinking about them:
      • Multi-window operation
      • “ Workspace Management”
      • Stack of continuable states (nested conversation)
      • No more HttpSession object
        • Reduce codes and memory leaks
      • Avoid unexpected behaviors with multiple browser windows
    • Conversations Cont..
      • Allows multiple concurrent state containers for a single user over HTTP session
      • Each conversation resides in its own Browser or Tab
      User Session Browser1 Browser2 Browser3 User Concurrent Conversations C3 C2 C1
    • Page Flow/Navigation Rules
      • Seam specific file to enhance page navigation
        • pages.xml integrates stateful components
      • Manage complicated navigation flows based on current state of the application
      • Define navigation rules for each page
      • Flow is based on events and conditions
    • New Programing Patterns
      • EntityHome
        • Manage persistence state of a single Object
        • CRUD operations
        • • persist();
        • • getInstance();
        • • update();
        • • remove();
      • EntityQuery
        • Manage JP/EJB QL(Query Language) result se t
    • Ajax Support
      • Seam's totally unique concurrency model and state-management model was conceived and designed with AJAX in mind.
      • Page Wide Support (region, zone)
        • Add support to existing components
        • Sub view processing
        • Partial tree rendering, partial page refresh
      • Component Wide
        • Ajaxified components
        • Client validations
    • Integration Testing
      • Seam components can easily be tested in TestNG or Junit
      • The JBoss Embeddable EJB3 container is a great platform for integration testing: perform an end to end testing in it’s own embeddable container -- in a single unit test!
      • Test he entire flow of a request or conversation
      • Test all layers of Java code in the application, from presentation to persistence.
    • Seam-gen
      • Generate a project structure with build
      • Generate CRUD views
      • Reverse engineering of POJOs
      • Entity model validations enforced with ajax feedback
      • Generates Ant build script itself
      • Ready made project files for eclipse, netbeans, idea
      • Basic page level authorization
      • Datasource creation and configuring persistence layer
      • Richfaces Ui components
    • Other Technologies?
      • But what about Spring, Spring MVC, Grails, hibernate stack or JSF?
      • Grails ... Probably.
        • Leverage the Groovy programming language
      • But Seam is:
        • An “application stack” not a “web framework”
        • A unified development platform of {programming model, frameworks, best practices and tooling}
    • Resources
        • Reference docs, more than 30 examples, forums and best overall place - www.seamframework.org
        • Richfaces 3.3 - http://www.jboss.org/jbossrichfaces/docs/
        • Richfaces book – Practical Richfaces (Max Katz)
        • JSF 2 (includes “seam” like features) - http://nejug.org/events/show/91
        • EJB 3.1 - http://jcp.org/en/jsr/detail?id=318
        • Seam Books – Seam in Action (Dan Allen) & Seam Framework – Experience the evolution of Java EE (Jacob Orshalick)
        • Tools: JBoss Tools for Eclipse. Intellij and Netbeans also have excellent support for Seam