SlideShare a Scribd company logo
Seam


             Pete Muir
    JBoss, a Division of Red Hat

http://in.relation.to/Bloggers/Pete

       pete.muir@jboss.org
Road Map

 •   What is Seam?
 •   Why should I care about atomic conversations?
 •   How do I quickly build an application with Seam?
 •   What tools are available?
 •   The future
Application Stack
                                                    "%'($%%
                      :.&8!0&/1%quot;*quot;23               )*+,$%%

                                                     !quot;#$%


                      !quot;#!$%&'quot;()%*
                      4&5!6,7#&8quot;,9                  -.,/$




                                             !quot;#$
                                                    0,/$1quot;#$

                      !quot;#$quot;%&%'!(quot;)&*               0$,quot;*'23


                                                    4+,quot;5$(2
                    +&,-.-'&%/&!0&/1%quot;*quot;23
                                                      62,777
Where can I run my app?

                 WebSphere                   Web Logic



                   Tomcat                     Glassfish




                                          JBoss Enterprise
           JBoss Application Server
                                         Application Platform


                            JBoss SOA Platform
!quot;#quot;$%$&&
Seam is contextual
                                                 '($)quot;
 •   Stateful
     •   store objects for as long as you        *#+$
         need them

     •   Seam manages all interactions       ,-)($.&#quot;/-)
         with the context

     •   dependencies are injected and          !$&&/-)
         updated every time a component
         is accessed
                                            01&/)$&&!*.-2$&&


                                              344%/2#quot;/-)
Seam will store the
 The unified component model                                    component in the
                                                             conversation context
@Name(quot;discEditorquot;) @Scope(CONVERSATION)
public class DiscEditor {
                                          Inject the
    @In EntityManager entityManager;    EntityManager

    @In Session mailSession;

    @In @Out Item disc;                                                   Inject a
                                                                         JavaMail
    @In(scope=SESSION) User user;                                         session
                                           Alias the item from the
    // Use the components in some way     context, and update the
                                        ;-)
                                            context if the object
}                                                  changes
        Specify the
      context to inject
           from                                                      8
Road Map

 •   What is Seam?
 •   Why should I care about atomic conversations?
 •   How do I quickly build an application with Seam?
 •   What tools are available?
 •   The future
Why do I want an atomic conversation?

 •   Here’s a common scenario:
     •   A user has a task to complete which:
         •    spans multiple pages

         •    should be able to click cancel or back at any time, no changes made
              until the user is finished

         •    should be able to do the same task in multiple windows



                                                         Review and confirm
         View a hotel           Enter your booking
                                                              booking
What does Seam provide?
 •   A conversation scope
     •   shorter than the session, longer than a request

     •   demarcated by the application developer

     •   a conversation per window/tab


                                          Application
                                Session                                Session
               Conversation                             Conversation
     Request                  Request
What does Seam provide?

 •   A conversation scoped persistence context keeps entities
     attached for the entirety of the user’s task
     •   guarantees object equality

     •   allows lazy loading

 •   An atomic conversation needs to only flush changes at
     particular points
     •   Only flush the persistence context when explicitly instructed to
What does Seam provide?
 •   An atomic conversation needs to only flush changes at
     particular points
     •   Need to use a manual flush mode from Hibernate


         @Begin(flushMode=MANUAL)
         public void editDisc() {
             // Load the item to edit
         }

         @End
         public void saveDisc() {
            entityManager.flush();
         }
How do I manage the system transaction then?
  •   Seam manages the system transaction for you
      •   A read-write transaction

      •   A read only transaction for rendering the page (slightly better
          than Open Session in View)

                              CONVERSATION
                        EVENT                                 EVENT
          APPLY                          INVOKE     RENDER
RESTORE          PROCESS      UPDATE
        REQUEST                        APPLICATION RESPONSE
  VIEW          VALIDATIONS   MODEL
         VALUES


                         PERSISTENCE CONTEXT
                                                                 FLUSH

            SYSTEM TRANSACTION
Road Map

 •   What is Seam?
 •   Why should I care about atomic conversations?
 •   How do I quickly build an application with Seam?
 •   What tools are available?
 •   The future
Application Framework
  •   UI orientated controller components               Can define in XML or
                                                          Java for custom
  •   EntityHome for CRUD                                    behaviour

<fwk:entity-home entity-class=quot;com.acme.Discquot; name=quot;discHomequot;/>



<s:decorate template=quot;/edit.xhtmlquot;>
  <h:inputText value=quot;#{disc.name}quot; required=quot;truequot; />
</s:decorate>
<h:commandButton action=quot;#{discHome.update}quot; value=quot;Savequot; />
<h:commandButton action=quot;#{discHome.remove}quot; value=quot;Deletequot; />

 Seam provides JSF                             Bind directly to
  controls for easy                            the entities, no
 decoration of fields                           need for DTOs
Application Framework
   •   EntityQuery for search
<fwk:entity-query name=quot;discsquot; ejbql=quot;select d from Disc dquot; order=quot;d.namequot;
max-results=quot;5quot;>
  <fwk:restrictions>
    <value>lower(d.name) like concat(#{exampleDisc.name}, '%'))</value>
  </fwk:restrictions>
</fwk:entity-query>                               Basic queries can be
                                                   specified in XML

<component name=quot;exampleDiscquot; class=quot;com.acme.Artistquot; scope=quot;sessionquot; />

                         A prototype, used
                           to bind query
                            parameters
                          between UI and
                               query
Application Framework
   •   EntityQuery for search
                                        Search criteria
<h:form>
  Filter by name:
  <h:inputText value=quot;#{exampleDisc.name}quot;>
    <a:support reRender=quot;artistsquot; event=quot;onkeyupquot; />
  </h:inputText>
</h:form>
                                                          Output the results
<h:table value=quot;#{discs.dataModel}quot; var=quot;dquot; id=quot;discsquot;>
  <h:column>
    <s:link action=quot;discquot; value=quot;#{disc.name}quot;>
      <f:param name=quot;discIdquot; value=quot;#{disc.id}quot; />

   </s:link>
  </h:column>
</h:table>
<h:inputText value=quot;#{disc.name}quot; required=quot;truequot;>
                          <s:validate />
                        </h:inputText>



Validation
 •    Need to report validation errors back to the user on the correct
      field
 •    BUT normally need to enforce same constraints at the
      persistence layer and the database

@Entity public class Item {

    @Id @GeneratedValue Long id;

    @Length(min=3, max=1000, message=quot;Must be between 3 & 1000 charsquot;)
    String description;
}
Road Map

 •   What is Seam?
 •   Why should I care about atomic conversations?
 •   How do I quickly build an application with Seam?
 •   What tools are available?
 •   The future
Tooling

 • seam-gen - command line tool for generating skeleton
    project and reverse engineering a database schema
    using Seam Application Framework
 • JBoss Developer Studio - Eclipse based IDE
    •     For $99 you get a full installer + JBoss EAP
    •     Based on the freely available JBoss Tools Eclipse plugins
Demo
Road Map

 •   What is Seam?
 •   Why should I care about atomic conversations?
 •   How do I quickly build an application with Seam?
 •   What tools are available?
 •   The future
Flex as a view layer

•   A community effort
•   Uses Granite Data Services or Blaze Data Services
•   Check out a couple of demos at


                    http://www.rationaldeveloper.com
JSF 2

 •   Easy Component Creation & Templating
     •   Standardizes Facelets

     •   No XML needed to create a component

 •   Built in Ajax support
 •   Many improvements to JSF
     •   lifecycle (performance!)

     •   error handling

     •   navigation
What else?

 •   Seam 2.1 release candidate in the next week or two
     •   Friendly URLs

     •   Identity Management

     •   ACL style permissions

     •   Wicket support

     •   Excel reporting module

     •   Support for JAX-RS (REST)
Q&A




      http://in.relation.to/Bloggers/Pete


      http://www.seamframework.org

More Related Content

What's hot

Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Leonardo Balter
 
Building Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSocketsBuilding Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSockets
Ben Limmer
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
steveheffernan
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
Javier Eguiluz
 
Step objects
Step objectsStep objects
Step objects
Tim Sukhachev
 
State And Ajax Zend Con
State And Ajax   Zend ConState And Ajax   Zend Con
State And Ajax Zend Con
ZendCon
 
Hands on Pier
Hands on PierHands on Pier
Hands on Pier
ESUG
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
ihamo
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
dynamis
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
Remy Sharp
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
David Kaneda
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
Remy Sharp
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
Yi-Ting Cheng
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
James Pearce
 
Firefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next levelFirefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next level
Frédéric Harper
 
Angularjs Performance
Angularjs PerformanceAngularjs Performance
Angularjs Performance
Steven Lambert
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
dion
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
HTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityHTML5 Real-Time and Connectivity
HTML5 Real-Time and Connectivity
Peter Lubbers
 

What's hot (19)

Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
Building Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSocketsBuilding Realtime Apps with Ember.js and WebSockets
Building Realtime Apps with Ember.js and WebSockets
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
Step objects
Step objectsStep objects
Step objects
 
State And Ajax Zend Con
State And Ajax   Zend ConState And Ajax   Zend Con
State And Ajax Zend Con
 
Hands on Pier
Hands on PierHands on Pier
Hands on Pier
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
 
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
How to Develop a Rich, Native-quality User Experience for Mobile Using Web St...
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
HTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applicationsHTML5 and the dawn of rich mobile web applications
HTML5 and the dawn of rich mobile web applications
 
Firefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next levelFirefox OS Web APIs, taking it to the next level
Firefox OS Web APIs, taking it to the next level
 
Angularjs Performance
Angularjs PerformanceAngularjs Performance
Angularjs Performance
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design[cssdevconf] Adaptive Images in Responsive Web Design
[cssdevconf] Adaptive Images in Responsive Web Design
 
HTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityHTML5 Real-Time and Connectivity
HTML5 Real-Time and Connectivity
 

Viewers also liked

[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice
javablend
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
javablend
 
.
..
Bryanpulido
BryanpulidoBryanpulido
Bryanpulido
Bryan Pulido
 
windows linux BEÑAT HAITZ
windows linux BEÑAT HAITZwindows linux BEÑAT HAITZ
windows linux BEÑAT HAITZ
guest5b2d8e
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
javablend
 
Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360 Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360
Sergio Akash
 

Viewers also liked (7)

[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice
 
[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool[Strukelj] Why will Java 7.0 be so cool
[Strukelj] Why will Java 7.0 be so cool
 
.
..
.
 
Bryanpulido
BryanpulidoBryanpulido
Bryanpulido
 
windows linux BEÑAT HAITZ
windows linux BEÑAT HAITZwindows linux BEÑAT HAITZ
windows linux BEÑAT HAITZ
 
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
[Pilarczyk] Adrenaline programing implementing - SOA and BPM in your application
 
Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360 Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360
 

Similar to [Muir] Seam 2 in practice

Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
Steve Souders
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
Javier Toledo
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
jeresig
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
Bruce Snyder
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
dion
 
Sinatra
SinatraSinatra
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client Development
Tamir Khason
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
John Brunswick
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web Sites
Steve Souders
 
Sxsw 20090314
Sxsw 20090314Sxsw 20090314
Sxsw 20090314
guestcabcf63
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验
yiditushe
 
Os Haase
Os HaaseOs Haase
Os Haase
oscon2007
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
Orlando_Ruby_Users_Group
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
dosire
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
Christopher Judd
 
Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2
sleguiza
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
jeff tapper
 
Developing Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and JavascriptDeveloping Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and Javascript
Jeff Haynie
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
Matt Todd
 

Similar to [Muir] Seam 2 in practice (20)

Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMix
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
Sinatra
SinatraSinatra
Sinatra
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client Development
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web Sites
 
Sxsw 20090314
Sxsw 20090314Sxsw 20090314
Sxsw 20090314
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009IPhone Web Development With Grails from CodeMash 2009
IPhone Web Development With Grails from CodeMash 2009
 
Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2Webcast 09/2008 - Silverlight 2 Beta 2
Webcast 09/2008 - Silverlight 2 Beta 2
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applications
 
Developing Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and JavascriptDeveloping Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and Javascript
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
 

Recently uploaded

20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 

Recently uploaded (20)

20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024What’s New in Teams Calling, Meetings and Devices May 2024
What’s New in Teams Calling, Meetings and Devices May 2024
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 

[Muir] Seam 2 in practice

  • 1. Seam Pete Muir JBoss, a Division of Red Hat http://in.relation.to/Bloggers/Pete pete.muir@jboss.org
  • 2. Road Map • What is Seam? • Why should I care about atomic conversations? • How do I quickly build an application with Seam? • What tools are available? • The future
  • 3. Application Stack &quot;%'($%% :.&8!0&/1%quot;*quot;23 )*+,$%% !quot;#$% !quot;#!$%&'quot;()%* 4&5!6,7#&8quot;,9 -.,/$ !quot;#$ 0,/$1quot;#$ !quot;#$quot;%&%'!(quot;)&* 0$,quot;*'23 4+,quot;5$(2 +&,-.-'&%/&!0&/1%quot;*quot;23 62,777
  • 4. Where can I run my app? WebSphere Web Logic Tomcat Glassfish JBoss Enterprise JBoss Application Server Application Platform JBoss SOA Platform
  • 5. !quot;#quot;$%$&& Seam is contextual '($)quot; • Stateful • store objects for as long as you *#+$ need them • Seam manages all interactions ,-)($.&#quot;/-) with the context • dependencies are injected and !$&&/-) updated every time a component is accessed 01&/)$&&!*.-2$&& 344%/2#quot;/-)
  • 6. Seam will store the The unified component model component in the conversation context @Name(quot;discEditorquot;) @Scope(CONVERSATION) public class DiscEditor { Inject the @In EntityManager entityManager; EntityManager @In Session mailSession; @In @Out Item disc; Inject a JavaMail @In(scope=SESSION) User user; session Alias the item from the // Use the components in some way context, and update the ;-) context if the object } changes Specify the context to inject from 8
  • 7. Road Map • What is Seam? • Why should I care about atomic conversations? • How do I quickly build an application with Seam? • What tools are available? • The future
  • 8. Why do I want an atomic conversation? • Here’s a common scenario: • A user has a task to complete which: • spans multiple pages • should be able to click cancel or back at any time, no changes made until the user is finished • should be able to do the same task in multiple windows Review and confirm View a hotel Enter your booking booking
  • 9. What does Seam provide? • A conversation scope • shorter than the session, longer than a request • demarcated by the application developer • a conversation per window/tab Application Session Session Conversation Conversation Request Request
  • 10. What does Seam provide? • A conversation scoped persistence context keeps entities attached for the entirety of the user’s task • guarantees object equality • allows lazy loading • An atomic conversation needs to only flush changes at particular points • Only flush the persistence context when explicitly instructed to
  • 11. What does Seam provide? • An atomic conversation needs to only flush changes at particular points • Need to use a manual flush mode from Hibernate @Begin(flushMode=MANUAL) public void editDisc() { // Load the item to edit } @End public void saveDisc() { entityManager.flush(); }
  • 12. How do I manage the system transaction then? • Seam manages the system transaction for you • A read-write transaction • A read only transaction for rendering the page (slightly better than Open Session in View) CONVERSATION EVENT EVENT APPLY INVOKE RENDER RESTORE PROCESS UPDATE REQUEST APPLICATION RESPONSE VIEW VALIDATIONS MODEL VALUES PERSISTENCE CONTEXT FLUSH SYSTEM TRANSACTION
  • 13. Road Map • What is Seam? • Why should I care about atomic conversations? • How do I quickly build an application with Seam? • What tools are available? • The future
  • 14. Application Framework • UI orientated controller components Can define in XML or Java for custom • EntityHome for CRUD behaviour <fwk:entity-home entity-class=quot;com.acme.Discquot; name=quot;discHomequot;/> <s:decorate template=quot;/edit.xhtmlquot;> <h:inputText value=quot;#{disc.name}quot; required=quot;truequot; /> </s:decorate> <h:commandButton action=quot;#{discHome.update}quot; value=quot;Savequot; /> <h:commandButton action=quot;#{discHome.remove}quot; value=quot;Deletequot; /> Seam provides JSF Bind directly to controls for easy the entities, no decoration of fields need for DTOs
  • 15. Application Framework • EntityQuery for search <fwk:entity-query name=quot;discsquot; ejbql=quot;select d from Disc dquot; order=quot;d.namequot; max-results=quot;5quot;> <fwk:restrictions> <value>lower(d.name) like concat(#{exampleDisc.name}, '%'))</value> </fwk:restrictions> </fwk:entity-query> Basic queries can be specified in XML <component name=quot;exampleDiscquot; class=quot;com.acme.Artistquot; scope=quot;sessionquot; /> A prototype, used to bind query parameters between UI and query
  • 16. Application Framework • EntityQuery for search Search criteria <h:form> Filter by name: <h:inputText value=quot;#{exampleDisc.name}quot;> <a:support reRender=quot;artistsquot; event=quot;onkeyupquot; /> </h:inputText> </h:form> Output the results <h:table value=quot;#{discs.dataModel}quot; var=quot;dquot; id=quot;discsquot;> <h:column> <s:link action=quot;discquot; value=quot;#{disc.name}quot;> <f:param name=quot;discIdquot; value=quot;#{disc.id}quot; /> </s:link> </h:column> </h:table>
  • 17. <h:inputText value=quot;#{disc.name}quot; required=quot;truequot;> <s:validate /> </h:inputText> Validation • Need to report validation errors back to the user on the correct field • BUT normally need to enforce same constraints at the persistence layer and the database @Entity public class Item { @Id @GeneratedValue Long id; @Length(min=3, max=1000, message=quot;Must be between 3 & 1000 charsquot;) String description; }
  • 18. Road Map • What is Seam? • Why should I care about atomic conversations? • How do I quickly build an application with Seam? • What tools are available? • The future
  • 19. Tooling • seam-gen - command line tool for generating skeleton project and reverse engineering a database schema using Seam Application Framework • JBoss Developer Studio - Eclipse based IDE • For $99 you get a full installer + JBoss EAP • Based on the freely available JBoss Tools Eclipse plugins
  • 20. Demo
  • 21. Road Map • What is Seam? • Why should I care about atomic conversations? • How do I quickly build an application with Seam? • What tools are available? • The future
  • 22. Flex as a view layer • A community effort • Uses Granite Data Services or Blaze Data Services • Check out a couple of demos at http://www.rationaldeveloper.com
  • 23. JSF 2 • Easy Component Creation & Templating • Standardizes Facelets • No XML needed to create a component • Built in Ajax support • Many improvements to JSF • lifecycle (performance!) • error handling • navigation
  • 24. What else? • Seam 2.1 release candidate in the next week or two • Friendly URLs • Identity Management • ACL style permissions • Wicket support • Excel reporting module • Support for JAX-RS (REST)
  • 25. Q&A http://in.relation.to/Bloggers/Pete http://www.seamframework.org