SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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 - RJLeonardo 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 WebSocketsBen 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 Playersteveheffernan
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricksJavier Eguiluz
 
State And Ajax Zend Con
State And Ajax   Zend ConState And Ajax   Zend Con
State And Ajax Zend ConZendCon
 
Hands on Pier
Hands on PierHands on Pier
Hands on PierESUG
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introductionihamo
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with WingsRemy 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 MobileRemy Sharp
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialYi-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 applicationsJames 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 levelFrédéric Harper
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
[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 DesignChristopher Schmitt
 
HTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityHTML5 Real-Time and Connectivity
HTML5 Real-Time and ConnectivityPeter Lubbers
 

Tendances (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
 

En vedette

[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practice[Roblek] Distributed computing in practice
[Roblek] Distributed computing in practicejavablend
 
[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 cooljavablend
 
windows linux BEÑAT HAITZ
windows linux BEÑAT HAITZwindows linux BEÑAT HAITZ
windows linux BEÑAT HAITZguest5b2d8e
 
[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 applicationjavablend
 
Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360 Portfólio - Zarabatana Digital 360
Portfólio - Zarabatana Digital 360 Sergio Akash
 

En vedette (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
 

Similaire à [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 '09Steve Souders
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Service Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixService Oriented Integration With ServiceMix
Service Oriented Integration With ServiceMixBruce 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 Beyonddion
 
Smart Client Development
Smart Client DevelopmentSmart Client Development
Smart Client DevelopmentTamir Khason
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesJohn Brunswick
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验yiditushe
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSteve Souders
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
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 2009Christopher 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 2sleguiza
 
How Not To Code Flex Applications
How Not To Code Flex ApplicationsHow Not To Code Flex Applications
How Not To Code Flex Applicationsjeff 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 JavascriptJeff Haynie
 
Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous MerbMatt Todd
 

Similaire à [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
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
Google在Web前端方面的经验
Google在Web前端方面的经验Google在Web前端方面的经验
Google在Web前端方面的经验
 
Sxsw 20090314
Sxsw 20090314Sxsw 20090314
Sxsw 20090314
 
SXSW: Even Faster Web Sites
SXSW: Even Faster Web SitesSXSW: Even Faster Web Sites
SXSW: Even Faster Web Sites
 
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
 

Dernier

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

[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