SlideShare a Scribd company logo
JBoss Seam Introduction Xiaogang Cao, RedSaga http://www.ucosoft.com 2007-4-19
MVC Pros pull the page logic out of mud A clean structure of request process Cons It’s only focus on request/response Modal and View are linked static Very hard to abstract ‘widgets’ in web pages I dreamed : XML,DB,entity, web based data window been unified
The Seam way Consider the whole web app in a human understandable way Servlet Context is not enough, people have to write codes to manage state everywhere Seam unified all state management to ‘ Declared State Management’ The core cool feature of Seam is ‘Conversation Context’
Conversations Samples Create Order:  Select a customer  Check balance Add a product to detail list Add more products Confirm and assign a Order Number
Conversations Samples(cont.) Online Digital Photo Print Wizard Browse for photos, add them to print cart Review and update print qty Print them User profile update wizard  View and begin edit of user profile Add a photo Edit details Review changes Confirm change
Seam’s Contexts Stateless context Event (or request) context  Page context Conversation context Session context / Http Session Business process context  / JBPM Application context Contexts.lookupInStatefulContexts()
Conversation context Conversation spans more than one page Conversation is a whole interaction of a certain task Conversation may means a ‘User Story’ or a ‘Use Case’ Nothing magic it’s implemented by url param(ServerConversationContext) or a client param(ClientConversationContext) Contexts Class use ThreadLocal to store all contexts.
Conversation Lifecycle @Begin @End Conversation have timeout Conversation doesn’t result to a transaction Conversations can be nested Conversation can be merged by same id Conversation can be managed by ‘workspace’
Business Process Context BusinessProcessContext can span more than 1 user jBPM backend Sample
The meaning of 2 additional context Make program much more clear and easy to understand Use conversations and Business Process (jBPM) directly in JSF Eliminate the chance of silly mistakes and memory leaks Reduce the debug time You never want to convert back
Events Events JSF events <h:commandButton value=&quot;Click me!&quot; action=&quot;#{helloWorld.sayHello}&quot;/>  jBPM transition events <start-page name=&quot;hello&quot; view-id=&quot;/hello.jsp&quot;> <transition to=&quot;hello&quot;> <action expression=&quot;#{helloWorld.sayHello}&quot;/> </transition> </start-page>  Seam page actions <pages> <page view-id=&quot;/hello/*&quot; action=&quot;#{helloWorld.sayHello}&quot;/> </pages>  Seam component-driven events <components> <event type=&quot;hello&quot;> <action expression=&quot;#{helloListener.sayHelloBack}&quot;/> <action expression=&quot;#{logger.logHello}&quot;/> </event> </components>  @Name(&quot;helloWorld&quot;) public class HelloWorld { @RaiseEvent(&quot;hello&quot;) public void sayHello() { FacesMessages.instance().add(&quot;Hello World!&quot;); } }  Seam contextual events Lots of build-in events , such as  org.jboss.seam.validationFailed  No Event object exists  in seam. You can pass params if needed
Seam Component Seam component is a mix of jsf backingbean(managed bean),service class(normally named as ***Manager or **Service. )  It can maintain the states for your objects It can be  Stateless session beans Stateful session beans Entity beans JavaBeans Message-driven beans
Seam Component (cont.) The key of lightweight container is Dependency Injection (DI).  DI uses the lightweight framework container to inject services or other objects into a POJO.  The major differences between lightweight frameworks are how they wire container services together and implement Dependency Injection. The service architecture and metadata expression are the key issues here. ‘ Components’ are the ‘Spring beans’ in Seam world Components have the ability to be wired in Web tier ---- Michael  Juntao  Yuan
Seam Component (cont.2) @Entity @Name(&quot;greeter&quot;) public class Greeter implements Serializable {      private long id;      private String name;      @Id(generate=AUTO)      public long getId() { return id;}      public void setId(long id) { this.id = id; }      public String getName() { return name; }      public void setName(String name) { this.name = name; } }  <h:form> Please enter your name:<br/> <h:inputText value=&quot;#{greeter.name}&quot; size=&quot;15&quot;/><br/> <h:commandButton type=&quot;submit&quot; value=&quot;Say Hello&quot; action=&quot;#{manager.sayHello}&quot;/> </h:form>
Seam Component (cont.3) @Stateless @Interceptors(SeamInterceptor.class) @Name(&quot;manager&quot;) public class ManagerAction implements Manager {     @In    private Greeter greeter;     @Out    private List <Greeter> allGreeters;    @PersistenceContext    private EntityManager em;    public String sayHello () {      em.persist (greeter);      allGreeters = em.createQuery(&quot;from Greeter g&quot;).getResultList();      return null;    } }  <p>The following persons have said &quot;hello&quot; to JBoss Seam:</p> <h:dataTable value=&quot;#{ allGreeters }&quot; var=&quot;person&quot;>    <h:column>      <h:outputText value=&quot;#{person.name}&quot;/>    </h:column> </h:dataTable>  ---------------above codes from Michael Yuan , http://java.sys-con.com/read/180347.htm
Seam bijection In other containers DI happens only when the POJO is created Injection is the action between container and beans the reference does not subsequently change for the lifetime of the component instance  This is good for stateless beans For a stateful component, we need to change the reference within different context In Seam injection and outjection are the action between context and components DI happens when the context switches
Seam bijection(cont.) Bijection is Contextual Reference can change in difference context  bidirectional   Values are ‘Injected’ from context, and also ‘Outjected’ to the context dynamic   Bijection and contextual components are the soul of Seam!
Other cool stuffs JSF with EJB 3.0 (Ajax4jsf,icefaces,..) Enhance to JSF EL Validation Conversation written with JPA considered Build-in Testable Build-in BPM Build-in Security Build-in mail, webmail as a option
Develop simplified Rails style seam-gen Template based generation EL support in HQL/EJB-QL  simplified annotation based configuration
Highly integrated JSF EJB3/JPA JAAS authentication JSP Unified EL JavaMail Portlet buni-meldware mail/web mail Facelets jBPM Hibernate iText Drools JCaptcha Ajax4JSF ICEFaces Spring MyFaces Jboss microcontainer
EJB 3.0 or Java Beans? Both EJB 3.0 session beans and entity beans are supported as a component Java Beans also supported EJB 3.0 have declared transactions and state replicate capability Use Java Beans instead of EJB 3.0 allow you use Seam directly in Tomcat, not a EJB 3.0 container Java Beans support hot deploy
EJB 3.0 and JavaBeans(Cont.) booking example have several versions /examples/booking is a EJB 3.0 version /examples/hibernate is a Hibernate 3.0 version /examples/icefaces is using icefaces instead of Ajax4JSF /examples/glassfish is a version runs on Java EE 5 reference implementation Tips: Seam has a lot of well written completed examples comparing to hibernate
Seam and JSF EJB 3 beans are JSF managed Beans Actually every Component are JSF managed Beans Currently JSF is the only view supported Seam will be a main strength to promote JSF However, JSF is not very popular in China now
Seam and iText Pros: Seam use facelets document to generate PDF Cons: Still like a toy, comparing to Crystal Reports or JReport Report is one of very important feature in real world Suggest to use JasperReports as a solid report  tool Tips: Foxit Reader ActiveX can render PDF in lighting speed within the IE browser.
Seam and AJAX Interface.js  <script type=&quot;text/javascript&quot; src=&quot;seam/resource/remoting/interface.js?customerAction&accountAction&quot;></script>  Remote.js <script type=&quot;text/javascript&quot; src=&quot;seam/resource/remoting/resource/remote.js&quot;></script>  Make the AJAX call Seam.Component.getInstance(&quot;helloAction&quot;).sayHello(name, sayHelloCallback);  Return fields is been controlled at server side @WebRemote(exclude = {&quot;widgetList.secret&quot;, &quot;widgetMap[value].secret&quot;})  public Widget getWidget();  Return Data is typed Primitives / Basic Types ,String, Date,Number, Boolean,Enum, Bag, Map Support subscribe to JMS topic
Seam and AJAX(Cont.) Pros: Seam remoting allow seam been used with other  client JS library Currently two open source JSF-based AJAX solutions: ICEfaces and Ajax4JSF  Cons: Actually, RichFaces also like a toy comparing to dojo or Ext AJAX design pattern is still evolving. Especially in a portal page. Current Seam remote.js is tied too tight with JSF.  It’s possible to write a customized Ext dataset to communicate with Seam Remoting, but require many codes. Hope it can support JSON/Burlap in the future and support a dataSet model
Seam PageFlow Pros:jPDL visiable XML define Cons: you must use jBPM
Seam Security Simple mode and Advanced mode Advanced mode use Drools, provide rule based security checks  Authenticate built upon JAAS  offers a much more simplified method of authentication  Authorization Security API for securing access to components, component methods, and pages  Role based security check Security is a major advantage comparing to other frameworks like ROR.
Seam and persistence Tight integration with EJB 3.0 entity bean ,JPA and Hibernate No need to say more!  
Conclusion Seam is the most advanced J2EE stack now State Management is the most important feature But Seam is also heavy and complex Still lack of advanced Report ability AJAX support is behind era You must use JSF to gain max benefit But JSF is not popular enough Seam can simplify your code Remove glue codes between layers Some of Seam function is not standard yet No, but maybe that isn’t a problem, just like the success of hibernate in EJB 2.0 era.
Conclusion(cont.) Ruby improve productivity by using dynamic language and provide a ready to use Rails framework ROR is lack of wide range of libraries support comparing to Java Seam introduce Contextual Components , which will dramatically improve java programmer’s productivity But Seam’s inner complex will cost more time for developers to go in deep
Hope resolve the problem of EJB 3 beans hot deploy, that’s really a handy feature Add more views besides JSF. How about Eclipse RAP or Ext? Current client conversation can be used in a full AJAX solution. Exadel can improve the usability of Seam
About redsaga www.redsaga.com, an open source community only for matures Open source project hosting service available for good projects Contributed to Hibernate & Spring by organize the translate of reference documents and write book in Chinese Hibernate Core Hibernate Annotations Hibernate EntityManager Spring Reference Seam Reference translation in progress and open for volunteers http://wiki.redsaga.com/confluence/display/SeamRef/Seam+1.2.1+GA+Reference+Translate+Overview Coming soon! http:// www.ucosoft.com
Ad

More Related Content

What's hot (17)

Zend Framework
Zend FrameworkZend Framework
Zend Framework
Perttu Myry
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
BG Java EE Course
 
Ajax Security
Ajax SecurityAjax Security
Ajax Security
Joe Walker
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
IMC Institute
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questions
Sujata Regoti
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
Brian Cavalier
 
SocketStream
SocketStreamSocketStream
SocketStream
Paul Jensen
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
Montreal JUG
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
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
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
Lennart Schoors
 
- Webexpo 2010
- Webexpo 2010- Webexpo 2010
- Webexpo 2010
Petr Dvorak
 
JSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress comingJSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress coming
Andy Schwartz
 
Declarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHPDeclarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHP
Stephan Schmidt
 
OpenWebBeans/Web Beans
OpenWebBeans/Web BeansOpenWebBeans/Web Beans
OpenWebBeans/Web Beans
Gurkan Erdogdu
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
IMC Institute
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
IMC Institute
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questions
Sujata Regoti
 
EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)EJB et WS (Montreal JUG - 12 mai 2011)
EJB et WS (Montreal JUG - 12 mai 2011)
Montreal JUG
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 
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
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
Lennart Schoors
 
JSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress comingJSF 2 and beyond: Keeping progress coming
JSF 2 and beyond: Keeping progress coming
Andy Schwartz
 
Declarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHPDeclarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHP
Stephan Schmidt
 
OpenWebBeans/Web Beans
OpenWebBeans/Web BeansOpenWebBeans/Web Beans
OpenWebBeans/Web Beans
Gurkan Erdogdu
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
IMC Institute
 

Viewers also liked (7)

15 Tips For Home Fire Safety
15 Tips For Home  Fire Safety15 Tips For Home  Fire Safety
15 Tips For Home Fire Safety
Abdullah Sachwani
 
8 CLASSES SEAM
8 CLASSES SEAM8 CLASSES SEAM
8 CLASSES SEAM
SHANTO-MARIAM UNIVERSITY OF CREATIVE AND TECHNOLOGY
 
Seams used in garments
Seams used in garmentsSeams used in garments
Seams used in garments
Delwin Arikatt
 
Seams and stitches
Seams and stitchesSeams and stitches
Seams and stitches
Kundan Ganvir
 
Seams And Stitching Problems And Causes
Seams And Stitching Problems And CausesSeams And Stitching Problems And Causes
Seams And Stitching Problems And Causes
g l
 
Thread And Seam Construction
Thread And Seam ConstructionThread And Seam Construction
Thread And Seam Construction
Mackenzie Walton
 
Home Safety Presentation
Home Safety PresentationHome Safety Presentation
Home Safety Presentation
Sarah Parks
 
Ad

Similar to Seam Introduction (20)

Os Leonard
Os LeonardOs Leonard
Os Leonard
oscon2007
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 
Struts Overview
Struts OverviewStruts Overview
Struts Overview
elliando dias
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
Jim Driscoll
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003
Wes Yanaga
 
Spring and DWR
Spring and DWRSpring and DWR
Spring and DWR
wiradikusuma
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
rajivmordani
 
Lecture1
Lecture1Lecture1
Lecture1
Châu Thanh Chương
 
Component Framework Primer for JSF Users
Component Framework Primer for JSF UsersComponent Framework Primer for JSF Users
Component Framework Primer for JSF Users
Andy Schwartz
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
Geoffrey Fox
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
Svetlin Nakov
 
JBUG.Jbpm.2009
JBUG.Jbpm.2009JBUG.Jbpm.2009
JBUG.Jbpm.2009
Andries Inzé
 
Basic Hibernate Final
Basic Hibernate FinalBasic Hibernate Final
Basic Hibernate Final
Rafael Coutinho
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
Guillaume Laforge
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
Divyam Pateriya
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
Jim Driscoll
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy
 
IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003IE8 Dev Overview_pp2003
IE8 Dev Overview_pp2003
Wes Yanaga
 
Component Framework Primer for JSF Users
Component Framework Primer for JSF UsersComponent Framework Primer for JSF Users
Component Framework Primer for JSF Users
Andy Schwartz
 
CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
Geoffrey Fox
 
J2EE - Practical Overview
J2EE - Practical OverviewJ2EE - Practical Overview
J2EE - Practical Overview
Svetlin Nakov
 
Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
Guillaume Laforge
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
Divyam Pateriya
 
Ad

Recently uploaded (20)

Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 

Seam Introduction

  • 1. JBoss Seam Introduction Xiaogang Cao, RedSaga http://www.ucosoft.com 2007-4-19
  • 2. MVC Pros pull the page logic out of mud A clean structure of request process Cons It’s only focus on request/response Modal and View are linked static Very hard to abstract ‘widgets’ in web pages I dreamed : XML,DB,entity, web based data window been unified
  • 3. The Seam way Consider the whole web app in a human understandable way Servlet Context is not enough, people have to write codes to manage state everywhere Seam unified all state management to ‘ Declared State Management’ The core cool feature of Seam is ‘Conversation Context’
  • 4. Conversations Samples Create Order: Select a customer Check balance Add a product to detail list Add more products Confirm and assign a Order Number
  • 5. Conversations Samples(cont.) Online Digital Photo Print Wizard Browse for photos, add them to print cart Review and update print qty Print them User profile update wizard View and begin edit of user profile Add a photo Edit details Review changes Confirm change
  • 6. Seam’s Contexts Stateless context Event (or request) context Page context Conversation context Session context / Http Session Business process context / JBPM Application context Contexts.lookupInStatefulContexts()
  • 7. Conversation context Conversation spans more than one page Conversation is a whole interaction of a certain task Conversation may means a ‘User Story’ or a ‘Use Case’ Nothing magic it’s implemented by url param(ServerConversationContext) or a client param(ClientConversationContext) Contexts Class use ThreadLocal to store all contexts.
  • 8. Conversation Lifecycle @Begin @End Conversation have timeout Conversation doesn’t result to a transaction Conversations can be nested Conversation can be merged by same id Conversation can be managed by ‘workspace’
  • 9. Business Process Context BusinessProcessContext can span more than 1 user jBPM backend Sample
  • 10. The meaning of 2 additional context Make program much more clear and easy to understand Use conversations and Business Process (jBPM) directly in JSF Eliminate the chance of silly mistakes and memory leaks Reduce the debug time You never want to convert back
  • 11. Events Events JSF events <h:commandButton value=&quot;Click me!&quot; action=&quot;#{helloWorld.sayHello}&quot;/> jBPM transition events <start-page name=&quot;hello&quot; view-id=&quot;/hello.jsp&quot;> <transition to=&quot;hello&quot;> <action expression=&quot;#{helloWorld.sayHello}&quot;/> </transition> </start-page> Seam page actions <pages> <page view-id=&quot;/hello/*&quot; action=&quot;#{helloWorld.sayHello}&quot;/> </pages> Seam component-driven events <components> <event type=&quot;hello&quot;> <action expression=&quot;#{helloListener.sayHelloBack}&quot;/> <action expression=&quot;#{logger.logHello}&quot;/> </event> </components> @Name(&quot;helloWorld&quot;) public class HelloWorld { @RaiseEvent(&quot;hello&quot;) public void sayHello() { FacesMessages.instance().add(&quot;Hello World!&quot;); } } Seam contextual events Lots of build-in events , such as org.jboss.seam.validationFailed No Event object exists in seam. You can pass params if needed
  • 12. Seam Component Seam component is a mix of jsf backingbean(managed bean),service class(normally named as ***Manager or **Service. ) It can maintain the states for your objects It can be Stateless session beans Stateful session beans Entity beans JavaBeans Message-driven beans
  • 13. Seam Component (cont.) The key of lightweight container is Dependency Injection (DI). DI uses the lightweight framework container to inject services or other objects into a POJO. The major differences between lightweight frameworks are how they wire container services together and implement Dependency Injection. The service architecture and metadata expression are the key issues here. ‘ Components’ are the ‘Spring beans’ in Seam world Components have the ability to be wired in Web tier ---- Michael Juntao Yuan
  • 14. Seam Component (cont.2) @Entity @Name(&quot;greeter&quot;) public class Greeter implements Serializable {      private long id;      private String name;      @Id(generate=AUTO)      public long getId() { return id;}      public void setId(long id) { this.id = id; }      public String getName() { return name; }      public void setName(String name) { this.name = name; } } <h:form> Please enter your name:<br/> <h:inputText value=&quot;#{greeter.name}&quot; size=&quot;15&quot;/><br/> <h:commandButton type=&quot;submit&quot; value=&quot;Say Hello&quot; action=&quot;#{manager.sayHello}&quot;/> </h:form>
  • 15. Seam Component (cont.3) @Stateless @Interceptors(SeamInterceptor.class) @Name(&quot;manager&quot;) public class ManagerAction implements Manager {    @In    private Greeter greeter;    @Out    private List <Greeter> allGreeters;    @PersistenceContext    private EntityManager em;    public String sayHello () {      em.persist (greeter);      allGreeters = em.createQuery(&quot;from Greeter g&quot;).getResultList();      return null;    } } <p>The following persons have said &quot;hello&quot; to JBoss Seam:</p> <h:dataTable value=&quot;#{ allGreeters }&quot; var=&quot;person&quot;>    <h:column>      <h:outputText value=&quot;#{person.name}&quot;/>    </h:column> </h:dataTable> ---------------above codes from Michael Yuan , http://java.sys-con.com/read/180347.htm
  • 16. Seam bijection In other containers DI happens only when the POJO is created Injection is the action between container and beans the reference does not subsequently change for the lifetime of the component instance This is good for stateless beans For a stateful component, we need to change the reference within different context In Seam injection and outjection are the action between context and components DI happens when the context switches
  • 17. Seam bijection(cont.) Bijection is Contextual Reference can change in difference context bidirectional Values are ‘Injected’ from context, and also ‘Outjected’ to the context dynamic Bijection and contextual components are the soul of Seam!
  • 18. Other cool stuffs JSF with EJB 3.0 (Ajax4jsf,icefaces,..) Enhance to JSF EL Validation Conversation written with JPA considered Build-in Testable Build-in BPM Build-in Security Build-in mail, webmail as a option
  • 19. Develop simplified Rails style seam-gen Template based generation EL support in HQL/EJB-QL simplified annotation based configuration
  • 20. Highly integrated JSF EJB3/JPA JAAS authentication JSP Unified EL JavaMail Portlet buni-meldware mail/web mail Facelets jBPM Hibernate iText Drools JCaptcha Ajax4JSF ICEFaces Spring MyFaces Jboss microcontainer
  • 21. EJB 3.0 or Java Beans? Both EJB 3.0 session beans and entity beans are supported as a component Java Beans also supported EJB 3.0 have declared transactions and state replicate capability Use Java Beans instead of EJB 3.0 allow you use Seam directly in Tomcat, not a EJB 3.0 container Java Beans support hot deploy
  • 22. EJB 3.0 and JavaBeans(Cont.) booking example have several versions /examples/booking is a EJB 3.0 version /examples/hibernate is a Hibernate 3.0 version /examples/icefaces is using icefaces instead of Ajax4JSF /examples/glassfish is a version runs on Java EE 5 reference implementation Tips: Seam has a lot of well written completed examples comparing to hibernate
  • 23. Seam and JSF EJB 3 beans are JSF managed Beans Actually every Component are JSF managed Beans Currently JSF is the only view supported Seam will be a main strength to promote JSF However, JSF is not very popular in China now
  • 24. Seam and iText Pros: Seam use facelets document to generate PDF Cons: Still like a toy, comparing to Crystal Reports or JReport Report is one of very important feature in real world Suggest to use JasperReports as a solid report tool Tips: Foxit Reader ActiveX can render PDF in lighting speed within the IE browser.
  • 25. Seam and AJAX Interface.js <script type=&quot;text/javascript&quot; src=&quot;seam/resource/remoting/interface.js?customerAction&accountAction&quot;></script> Remote.js <script type=&quot;text/javascript&quot; src=&quot;seam/resource/remoting/resource/remote.js&quot;></script> Make the AJAX call Seam.Component.getInstance(&quot;helloAction&quot;).sayHello(name, sayHelloCallback); Return fields is been controlled at server side @WebRemote(exclude = {&quot;widgetList.secret&quot;, &quot;widgetMap[value].secret&quot;}) public Widget getWidget(); Return Data is typed Primitives / Basic Types ,String, Date,Number, Boolean,Enum, Bag, Map Support subscribe to JMS topic
  • 26. Seam and AJAX(Cont.) Pros: Seam remoting allow seam been used with other client JS library Currently two open source JSF-based AJAX solutions: ICEfaces and Ajax4JSF Cons: Actually, RichFaces also like a toy comparing to dojo or Ext AJAX design pattern is still evolving. Especially in a portal page. Current Seam remote.js is tied too tight with JSF. It’s possible to write a customized Ext dataset to communicate with Seam Remoting, but require many codes. Hope it can support JSON/Burlap in the future and support a dataSet model
  • 27. Seam PageFlow Pros:jPDL visiable XML define Cons: you must use jBPM
  • 28. Seam Security Simple mode and Advanced mode Advanced mode use Drools, provide rule based security checks Authenticate built upon JAAS offers a much more simplified method of authentication Authorization Security API for securing access to components, component methods, and pages Role based security check Security is a major advantage comparing to other frameworks like ROR.
  • 29. Seam and persistence Tight integration with EJB 3.0 entity bean ,JPA and Hibernate No need to say more! 
  • 30. Conclusion Seam is the most advanced J2EE stack now State Management is the most important feature But Seam is also heavy and complex Still lack of advanced Report ability AJAX support is behind era You must use JSF to gain max benefit But JSF is not popular enough Seam can simplify your code Remove glue codes between layers Some of Seam function is not standard yet No, but maybe that isn’t a problem, just like the success of hibernate in EJB 2.0 era.
  • 31. Conclusion(cont.) Ruby improve productivity by using dynamic language and provide a ready to use Rails framework ROR is lack of wide range of libraries support comparing to Java Seam introduce Contextual Components , which will dramatically improve java programmer’s productivity But Seam’s inner complex will cost more time for developers to go in deep
  • 32. Hope resolve the problem of EJB 3 beans hot deploy, that’s really a handy feature Add more views besides JSF. How about Eclipse RAP or Ext? Current client conversation can be used in a full AJAX solution. Exadel can improve the usability of Seam
  • 33. About redsaga www.redsaga.com, an open source community only for matures Open source project hosting service available for good projects Contributed to Hibernate & Spring by organize the translate of reference documents and write book in Chinese Hibernate Core Hibernate Annotations Hibernate EntityManager Spring Reference Seam Reference translation in progress and open for volunteers http://wiki.redsaga.com/confluence/display/SeamRef/Seam+1.2.1+GA+Reference+Translate+Overview Coming soon! http:// www.ucosoft.com

Editor's Notes