SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Introduction to
                  JBoss Seam
                  Ashish Kulkarni



                                       1
01 October 2008       www.ebizss.com




                                           1
How this presentation is organised

           A brief history of Java Web Applications
           What else has happened to the Web
           Where does JBoss Seam fit
           Demo
           Questions
                Welcome anytime as long as you can accept the
                following answers:
                         I don’t know but I will find out
                         Can we park that question and take it up after this
                         presentation?
                                                                               2
                                              www.ebizss.com
       01 October 2008




Gavin King and Pete Muir have been making a lot of presentations on JBoss
Seam.


This presentation tries not to duplicate any of the concepts or ideas mentioned by
either of them.


Instead, this presentation gives an insight into Seam from an Analyst and
Developer’s perspective.


I am assuming that the target audience has got some experience in developing
Web Applications using Java.




                                                                                     2
A brief history of Java Web Applications

           Java Web Applications have been around
           for years now.
           They have undergone a radical change
           from the simple JSP / Servlet days to
           Frameworks allowing the use of MVC and
           similar design patterns.



                                                                               3
                                       www.ebizss.com
       01 October 2008




The first generation of Java based Web applications had a simple HTML front-
end that did HTML FORM posting to Java Servlets.


The arrival of JSPs on the landscape simplified Java Web Application
development significantly. We could now embed Java scriptlets inside HTML
code instead of embedding HTML code inside a Java class. And although at
runtime, the JSPs get converted into a Servlet, it is this simplicity that is to this
day at the heart of most frameworks such as Struts that rely on the use of Tag
Libraries within JSPs.


Emergence of MVC frameworks such as Struts marked a revolution in the
approach Java Developers took to developing Web Applications as they no
longer had to develop a framework to manage the flow-of-control and validations
any more. Instead, they could rely on a robust and freely available framework to
do that.




                                                                                        3
The Model 1 Architecture
                                   HTML / JSP Front-end




                         Pseudo Controller Servlet Integration Layer




                            EJB 1.x / Java DAO Business Layer




                                         Database
                                          Layer


                                                                          4
                                        www.ebizss.com
       01 October 2008




This slide describes the Model 1 Architecture used by the first generation of Java
Web Applications.


These had HTML or JSP front-end. The middleware was either a JSP or a
Servlet that did the processing of submitted form data.


For this, it mostly relied upon the back-end Java Classes that usually
implemented some form of a DAO mechanism.


The work of this Servlet was to convert the posted FORM data into Java objects
understood by the back-end layer and vice versa.


This Servlet also had to do validations. Response messages were handled either
by means of request attributes or by means of a request redirection or both.




                                                                                     4
The Model 2 Architecture - MVC
                                       HTML / JSP Front-end




                                 Controller Servlet Integration Layer




                         EJB 1.x / 2.x / Java DAO / Hibernate Business Layer




                                              Database
                                               Layer


                                                                               5
                                             www.ebizss.com
       01 October 2008




While the basics remained the same in Model 2, with the advent of complex
frameworks such as Struts, most of the work was now delegated to the
framework.


Under the hood, the framework still did input validation, request redirection and
so on. But this was now hidden from the developer. The developer had to simply
create xml configuration files.


As the popularity of these frameworks grew, tools quickly evolved to automate
tasks such as creation of front-end, middleware and back-end artifacts and
management of these xml configuration files.




                                                                                    5
Issues with traditional approach
             Too many artifacts
             Struts – JSPs, Action Classes, ActionForm
             Classes, validation.xml, struts-config.xml
             Hibernate – .hbm.xml file for every database
             table
             Integration Layer converting front-end java
             objects to business layer java objects and vice
             versa (too much plumbing code)
             Time consuming even with the best tools
             Ever-changing business requirements
                                                                                           6
                                             www.ebizss.com
         01 October 2008




Although, the use of frameworks such as Struts streamlined or standardised Java Web
Applications, they also brought the need to create and maintain various artifacts.


We need Java Objects that can hold data being displayed on and/or being posted by the front-
end. We need to specify validation rules for that data. We need to specify messages to display
when these rules fail. And so on.


A lot of this can be automated by the proper use of correct tools.


In fact, at one point, I even initiated a project within my company to read database metadata and
create JSPs, XML sciptlets and Java Classes for use with Struts with some elementary user input.


Number of artifacts is just one issue. From an architectural point of view, there is another bigger
issue. The frond-end is unaware of the existance of back-end and vice versa. These two layers
exist without the knowledge of each-other. And it is up to the integration layer to cast objects from
back-end to front-end classes and back.


In fact, in most projects, that all the Integration layer really does. Convert objects,
serialize/deserialize objects and pass them back and forth between front-end and back-end.




                                                                                                        6
What else has happened to the Web

            PHP
                 Very easy deployment
                 Agile
            Ruby-on-Rails
                 Agile
                 Generates Scaffolding Code
                 Deployment not as easy as PHP (debatable)
                 Uses ActiveRecord Design Pattern
                                                                                          7
                                            www.ebizss.com
        01 October 2008




While we Java Developers and Architects were busy churning out tonnes and tonnes of
repeatitive plumbing code, the world had started to move on.

Complexity of deployment of a Java Web Application was and still remains a burning issue.

PHP came up with a brilliant solution - simply let the web server interpret PHP pages. As a result,
a website created using PHP can be simply copied into the deployment folder and hey presto!!! Its
available to the world!!!. No need for complex deployment descriptors or server.xml or similar files
to wrestle with.

Testing a PHP web application is really simple. If you make a change, simply redeploy and retest.
No need to shut down or restart server!!!

And then came Ruby-on-Rails. Ruby has been around for as long as Java. It was the advent of
Rails that really made it popular.

Rails framework has tools that can generate most of the scaffolding code required for an RoR web
application.

Also, its Active Record design makes it possible to have back-end objects that know how to do
CRUD operations on the underlying tables in the database.

There have been a few other languages/frameworks that started to contend for the spotlight too
such as Python.




                                                                                                       7
Front-ends are changing
           More and more professional web
           applications are looking to provide Richer
           Experience
           There is an emergence of RIAs such as
           Flex
           Increasing number of websites are looking
           to provide AJAX functionality

                                                                            8
                                     www.ebizss.com
       01 October 2008




When we moved from traditional Client/Server applications to Web applications,
we had to sacrifice the richness of the Clients.


Even the thinnest of the clients in the client/server era were capable of rich user
experience.


With the passage of time, the focus has started shifting to having the same
richness of the user interface in web applications.


Adobe Flex and AJAX (Asynchronous JavaScript and XML) are two of the most
talked about technologies that developers are coming to rely on to make web
application interactions richer.




                                                                                      8
End users are still the same
           More demanding
           Smaller budgets
           Tighter deadlines
           “I want it all, I want it yesterday and I want
           to pay as little as possible”
           Low cost of ownership
           Low cost of maintenance

                                                                            9
                                     www.ebizss.com
       01 October 2008




Most of us have heard it all before. And I am sure, we will keep hearing it until the
day we retire!!!

The budgets are getting tighter. The deadlines are getting deadlier. The
requirements are soaring.

Customers want web applications developed faster than ever before and for
fraction of the price.

They have also become smart about cost of ownership. They don't want to pay
an arm and a leg to host and support their web application.

If you put yourself in their shoes, you would want the same. Won't you?

After all, why do we use Java? Because JDK is free. Why do we use tools such
as Eclipse? Again, because they are free. And the list goes on.

And the first time we find a bug in one of our free tools, we make a point of
reporting it and chasing it up.




                                                                                        9
Where does JBoss Seam fit
               Generates of Scaffolding code
               Agile
               Collapses the need to have an Integration Layer
               Provides dependency bi-jection
               New variable scopes – Conversation and
               Business Process
               Works well with JSF and JPA
               JSR-299 – WebBeans (Seam Core) to be part of
               Java EE
                                                                                                               10
                                                       www.ebizss.com
           01 October 2008




Lets face it. We are not just looking for something free. We are looking for something free that frees up our time too and
doesn't make us wrote more code.

If there is technology out there to generate scaffolding code, why not have it in Java? After all, at over 20%, Java does
lead the TIOBE index!!!

How about some agility? If we are able to test what we are developing quickly, we can find and fix any bugs that much
quicker. The only trouble is it is too addictive.

If all that the integration layer does is converts objects backwards and forwards and passes them between layers, why
not make the back-end objects visible to the front-end? After all, less code = less bugs.

One of the revolutionary feature offered by the Spring Framework is Dependency Injection. Seam takes it one step
further and makes Dependency Bi-jection (INjection as well as OUTjection) possible.

So once your user has logged in, you can OUTject the user object into the session and it will remain available throughout
that session. And if another java class needs it, simply INject it there and the SEAM container will take care of it for you.

How many of us have had to create a wizard-like form? Nearly all of us at some point or other.

And where did we put the data to be passed between the pages? Yes, in the Session scope. And what if the user
remained on the same site but navigated away to another part? You guessed it. Memory leak.

Seam has introduced a new context called Conversation that takes care of this for us. Objects within conversation scope
get garbage collected after that conversation either ends or times out. The user may still happily browse other parts of
our website.

JSR-299, which has been unanimously voted on positively, is a request to include Web Beans into Java EE. Web Beans
is, simply put, Seam Core. So Seam is slated to become part of the Java EE Standard.




                                                                                                                                10
Some Misconceptions
           JBoss Seam applications can run only on JBoss
           Application Server – false. They can run on
           WebSphere, WebLogic and Tomcat. However,
           for Tomcat, we need an embedded JBoss
           Server Instance.
           JBoss Seam applications can use only
           RichFaces or ICEFaces JSF libraries as their
           front-end – false. They can use Wicket, GWT or
           Flex as their front-end as well.

                                                                      11
                                   www.ebizss.com
       01 October 2008




Just because Seam is often called JBoss Seam doesn't mean that it runs only on
JBoss.


There is documentation available on SeamFramework.org as to how to use
Seam on various other Java Application Servers.


Seam does work with Tomcat as well. However, as it makes use of EJBs, it
needs an EJB container. So for using Seam on Tomcat, the best option is to use
it with an embedded JBoss Application Server.


Also, the Seam development team is working hard to ensure that it supports a
growing number of front-ends.




                                                                                 11
Generated Scaffolding Code
             Is generated using Hibernate Tools and
             Freemarker Templates
             Is JavaEE compliant
             Supports Login Security out-of-the-box
             Can use RichFaces or ICEFaces front-end
             Built-in AJAX support
             Does validation using Hibernate Annotations
             Uses JPA back-end
             Runs on JBoss AS out-of-the-box
             Can be edited using Eclipse or NetBeans
                                                                                              12
                                             www.ebizss.com
         01 October 2008




The code generated by seam-gen, Seam's scaffolding code generation tool, is JavaEE compliant.

seam-gen makes use of Hibernate tools and Freemarker templates to generate the front-end JSF
code as well as Java classes required by the application.

The front-end pages are Facelets compliant XHTML pages.

The java classes implement Home design pattern which is much cleaner than the ActiveRecord
design pattern as it separates out the object and operations.

This code makes use of Hibernate-driven JPA for its back-end. If you are a diehard TopLink-
driven JPA fan, you can simply replace the hibernate jars with toplink jars.

After all, the role of JPA is to provide a layer of abstraction over Hibernate and TopLink.

One note for those new to JPA. JPA makes use of annotations instead of XML files for
representing database metadata.

And Seam uses these annotations to do validations.

For example, if a column as nullable=false set, then Seam will ensure that this column has an
input value before passing it to the database.




                                                                                                   12
The Model 2 Architecture – JBoss Seam
                             JSF / Facelets Front-end




                               JPA Business Layer




                                    Database
                                     Layer


                                                                      13
                                   www.ebizss.com
       01 October 2008




Architecture of a Java Web Application created using Seam is much simpler.




                                                                             13
Look Ma – No Integration Layer!!!

           Seam exposes Business Layer objects
           and their attributes on the front-end using
           EL expressions.
           Hence, there is no need to have a
           separate set of objects in the front-end
           layer or to convert them back and forth in
           the Integration Layer

                                                                         14
                                    www.ebizss.com
       01 October 2008




Since Seam can expose back-end objects on the front-end using EL (JSF
expression language), there is no need for an integration layer to convert objects
backwards and forwards anymore.




                                                                                     14
Demo
    This demo will demonstrate how quickly
    and easily we can generate a java web
    application using Seam and its tools from
    a database.




                                                15
                     www.ebizss.com
01 October 2008




                                                     15
Steps – pre-requisites
    Install JDK 1.5.x (and not JDK 1.6.x)
         http://java.sun.com/javase/downloads/index_jdk5.jsp
    Install ANT 1.7.x
         http://ant.apache.org/bindownload.cgi
    Install JBoss 4.2.3.GA
         http://www.jboss.org/jbossas/downloads/
    Install any JDBC compliant database (I am using
    PostgreSQL 8.1.x)
    Install JBoss Seam 2.0.2.SP1
         http://www.seamframework.org/Download
    Copy the JDBC driver for your database to
    SEAM_INSTALL_DIR/lib
                                                               16
                                www.ebizss.com
01 October 2008




                                                                    16
Steps (continued…)
    The following steps are for Windows
         Go to command-prompt, change directory to
         SEAM_INSTALL_DIR and run the following
         commands:
                  seam setup (only once per project)
                  seam create-project (again, only once per project)
                  seam generate
                  seam explode (or seam deploy if you want to deploy as .ear
                  file)
         Start JBoss Server with default configuration
         Visit http://localhost:8080/project_name/

                                                                               17
                                      www.ebizss.com
01 October 2008




                                                                                    17
Questions
    What do I need to know before I can start using JBoss Seam?
         JSF
         JPA
         EJB3 (optional)
         Hibernate (optional)
    Given the learning curve, what value have you seen from using JBoss
    Seam?
         Simple CRUD in an hour (with every box ticked)
         One-many or other kind of CRUD in a day (again, with every box ticked)
         Extendable using Hibernate Search (Its like adding Google Search to your web
         application – has your boss ever asked for it?)
    How can we change the look-and-feel of a seam-gen generated application
    to something more presentable?
         You WILL need a web designer with good CSS skills for this
         Use layout/template.xhtml as a starting point and create your own template
         Either overwrite layout/template.xhtml with your template or use your template as
         the template in the ui:composition tag in the generated xhtml pages.

                                                                                        18
                                       www.ebizss.com
01 October 2008




                                                                                             18
Where to go from here
           Me – ashish@ebizss.com
           My company’s website – www.ebizss.com
           My website – www.ashishkulkarni.com
           My company’s wiki – www.ebizss.com/wiki
           My company’s public SVN repository –
           www.ebizss.com/svn/public
           www.seamframework.org
           JSR-299 - http://jcp.org/en/jsr/detail?id=299
           Books:
                Manning – Seam in Action by Don Allen
                                                                          19
                                      www.ebizss.com
       01 October 2008




I would attempt to answer questions as long as it is practical for me to do so.


I would also welcome your feedback on this presentation.


In case you or your company is interested to hire my services and need a more
detailed CV, please feel free to contact me for that as well ☺.




                                                                                  19
Bonus
           I have created a utility called sg2me to
           migrate seam-gen generated applications
           in an exploded state to MyEclipse. This
           utility is available from my company’s
           public SVN site at:
                http://www.ebizss.com/svn/public/seam-
                gen2mews/


                                                                             20
                                      www.ebizss.com
       01 October 2008




As you can guess, I have been using MyEclipse. The project created by seam-
gen is not in a structure that everyone likes. Hence, I created this utility to migrate
a seam-gen generated project to a project that MyEclipse can understand.




                                                                                          20
A bit about me
    I am a Java Contractor currently contracting with JP
    Morgan in Glasgow. Apart from contracting, I am actively
    working with other developers at my company to develop
    bespoke software for private clients.
    I have been using JBoss Seam for just about a year now
    and am absolutely loving it.
    Having worked on FoxPro, Oracle, Visual C++ and SAP
    in the past, I have 14 years of development experience.
    I have been using Java since 2000 which to this day
    remains my favourite computer language.
    I have worked in a variety of industries such as Retail
    Banking, Investment Banking, Financial Institutions,
    Pharmaceuticals, Manufacturing, Automobiles and
    Telecommunications.
                                                          21
                          www.ebizss.com
01 October 2008




                                                               21

Weitere ähnliche Inhalte

Was ist angesagt?

Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applicationsJulien Dubois
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPTSummer Lu
 
Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012Bruno Borges
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksAngelin R
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBayTony Ng
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchReza Rahman
 
React.js alternatives modern web frameworks and lightweight java script libr...
React.js alternatives  modern web frameworks and lightweight java script libr...React.js alternatives  modern web frameworks and lightweight java script libr...
React.js alternatives modern web frameworks and lightweight java script libr...Katy Slemon
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Shreedhar Ganapathy
 
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-finalRohit Kelapure
 
Designing JEE Application Structure
Designing JEE Application StructureDesigning JEE Application Structure
Designing JEE Application Structureodedns
 
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...Edureka!
 
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6Rakuten Group, Inc.
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 

Was ist angesagt? (20)

Developing modular Java applications
Developing modular Java applicationsDeveloping modular Java applications
Developing modular Java applications
 
Asif
AsifAsif
Asif
 
Workshop OSGI PPT
Workshop OSGI PPTWorkshop OSGI PPT
Workshop OSGI PPT
 
Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012Introducing WebLogic 12c OTN Tour 2012
Introducing WebLogic 12c OTN Tour 2012
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application Frameworks
 
JSF 2.2
JSF 2.2JSF 2.2
JSF 2.2
 
Oracle History #5
Oracle History #5Oracle History #5
Oracle History #5
 
Hybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbaiHybernat and structs, spring classes in mumbai
Hybernat and structs, spring classes in mumbai
 
Enterprise OSGi at eBay
Enterprise OSGi at eBayEnterprise OSGi at eBay
Enterprise OSGi at eBay
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
React.js alternatives modern web frameworks and lightweight java script libr...
React.js alternatives  modern web frameworks and lightweight java script libr...React.js alternatives  modern web frameworks and lightweight java script libr...
React.js alternatives modern web frameworks and lightweight java script libr...
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained
 
Java EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolioJava EE 6 and GlassFish portfolio
Java EE 6 and GlassFish portfolio
 
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
 
Designing JEE Application Structure
Designing JEE Application StructureDesigning JEE Application Structure
Designing JEE Application Structure
 
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
Servlet Tutorial | JSP Tutorial | Advanced Java Tutorial | Java Certification...
 
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 

Andere mochten auch

Introduction To Hibernate
Introduction To HibernateIntroduction To Hibernate
Introduction To Hibernateashishkulkarni
 
Using WordPress For Business
Using WordPress For BusinessUsing WordPress For Business
Using WordPress For Businessashishkulkarni
 
Using LinkedIn For Business
Using LinkedIn For BusinessUsing LinkedIn For Business
Using LinkedIn For Businessashishkulkarni
 
Using LinkedIn To Get Business
Using LinkedIn To Get BusinessUsing LinkedIn To Get Business
Using LinkedIn To Get Businessashishkulkarni
 
C. Porchietto La Stampa 10.05.09
C. Porchietto La Stampa 10.05.09C. Porchietto La Stampa 10.05.09
C. Porchietto La Stampa 10.05.09Claudia Porchietto
 
Using FaceBook Pages for Business
Using FaceBook Pages for BusinessUsing FaceBook Pages for Business
Using FaceBook Pages for Businessashishkulkarni
 
C. Porchietto La Stampa Torin 06.06.09
C. Porchietto La Stampa Torin 06.06.09C. Porchietto La Stampa Torin 06.06.09
C. Porchietto La Stampa Torin 06.06.09Claudia Porchietto
 
Using LinkedIn For Business
Using LinkedIn For BusinessUsing LinkedIn For Business
Using LinkedIn For Businessashishkulkarni
 
C. Porchietto Cronaca Qui.It 10.06.09
C. Porchietto Cronaca Qui.It 10.06.09C. Porchietto Cronaca Qui.It 10.06.09
C. Porchietto Cronaca Qui.It 10.06.09Claudia Porchietto
 
C. Porchietto Giornale Piemonte 27.05.09
C. Porchietto Giornale Piemonte 27.05.09C. Porchietto Giornale Piemonte 27.05.09
C. Porchietto Giornale Piemonte 27.05.09Claudia Porchietto
 
Proteus OCM Company Profile
Proteus OCM Company ProfileProteus OCM Company Profile
Proteus OCM Company ProfileKGanzy
 
Using Social Media For Business
Using Social Media For BusinessUsing Social Media For Business
Using Social Media For Businessashishkulkarni
 
Corporate Governance-India Board Report 2011
Corporate Governance-India Board Report 2011Corporate Governance-India Board Report 2011
Corporate Governance-India Board Report 2011Suresh Raina
 
Using Linked In For BNI
Using Linked In For BNIUsing Linked In For BNI
Using Linked In For BNIashishkulkarni
 
Ganadores drac novell 2012
Ganadores drac novell 2012Ganadores drac novell 2012
Ganadores drac novell 2012Zenith España
 

Andere mochten auch (20)

Introduction To Hibernate
Introduction To HibernateIntroduction To Hibernate
Introduction To Hibernate
 
Using WordPress For Business
Using WordPress For BusinessUsing WordPress For Business
Using WordPress For Business
 
Using LinkedIn
Using LinkedInUsing LinkedIn
Using LinkedIn
 
Using LinkedIn For Business
Using LinkedIn For BusinessUsing LinkedIn For Business
Using LinkedIn For Business
 
Using LinkedIn To Get Business
Using LinkedIn To Get BusinessUsing LinkedIn To Get Business
Using LinkedIn To Get Business
 
C. Porchietto La Stampa 10.05.09
C. Porchietto La Stampa 10.05.09C. Porchietto La Stampa 10.05.09
C. Porchietto La Stampa 10.05.09
 
Using FaceBook Pages for Business
Using FaceBook Pages for BusinessUsing FaceBook Pages for Business
Using FaceBook Pages for Business
 
C. Porchietto La Stampa Torin 06.06.09
C. Porchietto La Stampa Torin 06.06.09C. Porchietto La Stampa Torin 06.06.09
C. Porchietto La Stampa Torin 06.06.09
 
Using LinkedIn For Business
Using LinkedIn For BusinessUsing LinkedIn For Business
Using LinkedIn For Business
 
C. Porchietto Cronaca Qui.It 10.06.09
C. Porchietto Cronaca Qui.It 10.06.09C. Porchietto Cronaca Qui.It 10.06.09
C. Porchietto Cronaca Qui.It 10.06.09
 
C. Porchietto Giornale Piemonte 27.05.09
C. Porchietto Giornale Piemonte 27.05.09C. Porchietto Giornale Piemonte 27.05.09
C. Porchietto Giornale Piemonte 27.05.09
 
Proteus OCM Company Profile
Proteus OCM Company ProfileProteus OCM Company Profile
Proteus OCM Company Profile
 
Diy SEO
Diy SEODiy SEO
Diy SEO
 
Using Social Media For Business
Using Social Media For BusinessUsing Social Media For Business
Using Social Media For Business
 
Parco Termale Termini Imerese
Parco Termale Termini ImereseParco Termale Termini Imerese
Parco Termale Termini Imerese
 
Corporate Governance-India Board Report 2011
Corporate Governance-India Board Report 2011Corporate Governance-India Board Report 2011
Corporate Governance-India Board Report 2011
 
Using Linked In For BNI
Using Linked In For BNIUsing Linked In For BNI
Using Linked In For BNI
 
Alt01-LT
Alt01-LTAlt01-LT
Alt01-LT
 
Art and Social Media
Art and Social MediaArt and Social Media
Art and Social Media
 
Ganadores drac novell 2012
Ganadores drac novell 2012Ganadores drac novell 2012
Ganadores drac novell 2012
 

Ähnlich wie Introduction To J Boss Seam

December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationJonathan Abrams
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Codemotion
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412FirmansyahIrma1
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1Д. Ганаа
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptKalsoomTahir2
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to strutsAnup72
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Abhishek Gupta
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Abhishek Gupta
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3Oracle
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch ProcessingChris Adkin
 
WebBee rapid web app development teck stack
WebBee rapid web app development teck stackWebBee rapid web app development teck stack
WebBee rapid web app development teck stackALDAN3
 
Lift web framework
Lift web frameworkLift web framework
Lift web frameworkPetr Hošek
 

Ähnlich wie Introduction To J Boss Seam (20)

December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
 
GlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and FutureGlassFish and JavaEE, Today and Future
GlassFish and JavaEE, Today and Future
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412
 
Lecture 19 dynamic web - java - part 1
Lecture 19   dynamic web - java - part 1Lecture 19   dynamic web - java - part 1
Lecture 19 dynamic web - java - part 1
 
Jspx Jdc2010
Jspx Jdc2010Jspx Jdc2010
Jspx Jdc2010
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 
Frameworks in java
Frameworks in javaFrameworks in java
Frameworks in java
 
Spring Mvc
Spring MvcSpring Mvc
Spring Mvc
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2Glass Fish Slides Fy2009 2
Glass Fish Slides Fy2009 2
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
Jetty Vs Tomcat
Jetty Vs TomcatJetty Vs Tomcat
Jetty Vs Tomcat
 
WebBee rapid web app development teck stack
WebBee rapid web app development teck stackWebBee rapid web app development teck stack
WebBee rapid web app development teck stack
 
Lift web framework
Lift web frameworkLift web framework
Lift web framework
 
J2ee seminar
J2ee seminarJ2ee seminar
J2ee seminar
 
Java EE 7 - Overview and Status
Java EE 7  - Overview and StatusJava EE 7  - Overview and Status
Java EE 7 - Overview and Status
 

Kürzlich hochgeladen

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 

Kürzlich hochgeladen (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 

Introduction To J Boss Seam

  • 1. Introduction to JBoss Seam Ashish Kulkarni 1 01 October 2008 www.ebizss.com 1
  • 2. How this presentation is organised A brief history of Java Web Applications What else has happened to the Web Where does JBoss Seam fit Demo Questions Welcome anytime as long as you can accept the following answers: I don’t know but I will find out Can we park that question and take it up after this presentation? 2 www.ebizss.com 01 October 2008 Gavin King and Pete Muir have been making a lot of presentations on JBoss Seam. This presentation tries not to duplicate any of the concepts or ideas mentioned by either of them. Instead, this presentation gives an insight into Seam from an Analyst and Developer’s perspective. I am assuming that the target audience has got some experience in developing Web Applications using Java. 2
  • 3. A brief history of Java Web Applications Java Web Applications have been around for years now. They have undergone a radical change from the simple JSP / Servlet days to Frameworks allowing the use of MVC and similar design patterns. 3 www.ebizss.com 01 October 2008 The first generation of Java based Web applications had a simple HTML front- end that did HTML FORM posting to Java Servlets. The arrival of JSPs on the landscape simplified Java Web Application development significantly. We could now embed Java scriptlets inside HTML code instead of embedding HTML code inside a Java class. And although at runtime, the JSPs get converted into a Servlet, it is this simplicity that is to this day at the heart of most frameworks such as Struts that rely on the use of Tag Libraries within JSPs. Emergence of MVC frameworks such as Struts marked a revolution in the approach Java Developers took to developing Web Applications as they no longer had to develop a framework to manage the flow-of-control and validations any more. Instead, they could rely on a robust and freely available framework to do that. 3
  • 4. The Model 1 Architecture HTML / JSP Front-end Pseudo Controller Servlet Integration Layer EJB 1.x / Java DAO Business Layer Database Layer 4 www.ebizss.com 01 October 2008 This slide describes the Model 1 Architecture used by the first generation of Java Web Applications. These had HTML or JSP front-end. The middleware was either a JSP or a Servlet that did the processing of submitted form data. For this, it mostly relied upon the back-end Java Classes that usually implemented some form of a DAO mechanism. The work of this Servlet was to convert the posted FORM data into Java objects understood by the back-end layer and vice versa. This Servlet also had to do validations. Response messages were handled either by means of request attributes or by means of a request redirection or both. 4
  • 5. The Model 2 Architecture - MVC HTML / JSP Front-end Controller Servlet Integration Layer EJB 1.x / 2.x / Java DAO / Hibernate Business Layer Database Layer 5 www.ebizss.com 01 October 2008 While the basics remained the same in Model 2, with the advent of complex frameworks such as Struts, most of the work was now delegated to the framework. Under the hood, the framework still did input validation, request redirection and so on. But this was now hidden from the developer. The developer had to simply create xml configuration files. As the popularity of these frameworks grew, tools quickly evolved to automate tasks such as creation of front-end, middleware and back-end artifacts and management of these xml configuration files. 5
  • 6. Issues with traditional approach Too many artifacts Struts – JSPs, Action Classes, ActionForm Classes, validation.xml, struts-config.xml Hibernate – .hbm.xml file for every database table Integration Layer converting front-end java objects to business layer java objects and vice versa (too much plumbing code) Time consuming even with the best tools Ever-changing business requirements 6 www.ebizss.com 01 October 2008 Although, the use of frameworks such as Struts streamlined or standardised Java Web Applications, they also brought the need to create and maintain various artifacts. We need Java Objects that can hold data being displayed on and/or being posted by the front- end. We need to specify validation rules for that data. We need to specify messages to display when these rules fail. And so on. A lot of this can be automated by the proper use of correct tools. In fact, at one point, I even initiated a project within my company to read database metadata and create JSPs, XML sciptlets and Java Classes for use with Struts with some elementary user input. Number of artifacts is just one issue. From an architectural point of view, there is another bigger issue. The frond-end is unaware of the existance of back-end and vice versa. These two layers exist without the knowledge of each-other. And it is up to the integration layer to cast objects from back-end to front-end classes and back. In fact, in most projects, that all the Integration layer really does. Convert objects, serialize/deserialize objects and pass them back and forth between front-end and back-end. 6
  • 7. What else has happened to the Web PHP Very easy deployment Agile Ruby-on-Rails Agile Generates Scaffolding Code Deployment not as easy as PHP (debatable) Uses ActiveRecord Design Pattern 7 www.ebizss.com 01 October 2008 While we Java Developers and Architects were busy churning out tonnes and tonnes of repeatitive plumbing code, the world had started to move on. Complexity of deployment of a Java Web Application was and still remains a burning issue. PHP came up with a brilliant solution - simply let the web server interpret PHP pages. As a result, a website created using PHP can be simply copied into the deployment folder and hey presto!!! Its available to the world!!!. No need for complex deployment descriptors or server.xml or similar files to wrestle with. Testing a PHP web application is really simple. If you make a change, simply redeploy and retest. No need to shut down or restart server!!! And then came Ruby-on-Rails. Ruby has been around for as long as Java. It was the advent of Rails that really made it popular. Rails framework has tools that can generate most of the scaffolding code required for an RoR web application. Also, its Active Record design makes it possible to have back-end objects that know how to do CRUD operations on the underlying tables in the database. There have been a few other languages/frameworks that started to contend for the spotlight too such as Python. 7
  • 8. Front-ends are changing More and more professional web applications are looking to provide Richer Experience There is an emergence of RIAs such as Flex Increasing number of websites are looking to provide AJAX functionality 8 www.ebizss.com 01 October 2008 When we moved from traditional Client/Server applications to Web applications, we had to sacrifice the richness of the Clients. Even the thinnest of the clients in the client/server era were capable of rich user experience. With the passage of time, the focus has started shifting to having the same richness of the user interface in web applications. Adobe Flex and AJAX (Asynchronous JavaScript and XML) are two of the most talked about technologies that developers are coming to rely on to make web application interactions richer. 8
  • 9. End users are still the same More demanding Smaller budgets Tighter deadlines “I want it all, I want it yesterday and I want to pay as little as possible” Low cost of ownership Low cost of maintenance 9 www.ebizss.com 01 October 2008 Most of us have heard it all before. And I am sure, we will keep hearing it until the day we retire!!! The budgets are getting tighter. The deadlines are getting deadlier. The requirements are soaring. Customers want web applications developed faster than ever before and for fraction of the price. They have also become smart about cost of ownership. They don't want to pay an arm and a leg to host and support their web application. If you put yourself in their shoes, you would want the same. Won't you? After all, why do we use Java? Because JDK is free. Why do we use tools such as Eclipse? Again, because they are free. And the list goes on. And the first time we find a bug in one of our free tools, we make a point of reporting it and chasing it up. 9
  • 10. Where does JBoss Seam fit Generates of Scaffolding code Agile Collapses the need to have an Integration Layer Provides dependency bi-jection New variable scopes – Conversation and Business Process Works well with JSF and JPA JSR-299 – WebBeans (Seam Core) to be part of Java EE 10 www.ebizss.com 01 October 2008 Lets face it. We are not just looking for something free. We are looking for something free that frees up our time too and doesn't make us wrote more code. If there is technology out there to generate scaffolding code, why not have it in Java? After all, at over 20%, Java does lead the TIOBE index!!! How about some agility? If we are able to test what we are developing quickly, we can find and fix any bugs that much quicker. The only trouble is it is too addictive. If all that the integration layer does is converts objects backwards and forwards and passes them between layers, why not make the back-end objects visible to the front-end? After all, less code = less bugs. One of the revolutionary feature offered by the Spring Framework is Dependency Injection. Seam takes it one step further and makes Dependency Bi-jection (INjection as well as OUTjection) possible. So once your user has logged in, you can OUTject the user object into the session and it will remain available throughout that session. And if another java class needs it, simply INject it there and the SEAM container will take care of it for you. How many of us have had to create a wizard-like form? Nearly all of us at some point or other. And where did we put the data to be passed between the pages? Yes, in the Session scope. And what if the user remained on the same site but navigated away to another part? You guessed it. Memory leak. Seam has introduced a new context called Conversation that takes care of this for us. Objects within conversation scope get garbage collected after that conversation either ends or times out. The user may still happily browse other parts of our website. JSR-299, which has been unanimously voted on positively, is a request to include Web Beans into Java EE. Web Beans is, simply put, Seam Core. So Seam is slated to become part of the Java EE Standard. 10
  • 11. Some Misconceptions JBoss Seam applications can run only on JBoss Application Server – false. They can run on WebSphere, WebLogic and Tomcat. However, for Tomcat, we need an embedded JBoss Server Instance. JBoss Seam applications can use only RichFaces or ICEFaces JSF libraries as their front-end – false. They can use Wicket, GWT or Flex as their front-end as well. 11 www.ebizss.com 01 October 2008 Just because Seam is often called JBoss Seam doesn't mean that it runs only on JBoss. There is documentation available on SeamFramework.org as to how to use Seam on various other Java Application Servers. Seam does work with Tomcat as well. However, as it makes use of EJBs, it needs an EJB container. So for using Seam on Tomcat, the best option is to use it with an embedded JBoss Application Server. Also, the Seam development team is working hard to ensure that it supports a growing number of front-ends. 11
  • 12. Generated Scaffolding Code Is generated using Hibernate Tools and Freemarker Templates Is JavaEE compliant Supports Login Security out-of-the-box Can use RichFaces or ICEFaces front-end Built-in AJAX support Does validation using Hibernate Annotations Uses JPA back-end Runs on JBoss AS out-of-the-box Can be edited using Eclipse or NetBeans 12 www.ebizss.com 01 October 2008 The code generated by seam-gen, Seam's scaffolding code generation tool, is JavaEE compliant. seam-gen makes use of Hibernate tools and Freemarker templates to generate the front-end JSF code as well as Java classes required by the application. The front-end pages are Facelets compliant XHTML pages. The java classes implement Home design pattern which is much cleaner than the ActiveRecord design pattern as it separates out the object and operations. This code makes use of Hibernate-driven JPA for its back-end. If you are a diehard TopLink- driven JPA fan, you can simply replace the hibernate jars with toplink jars. After all, the role of JPA is to provide a layer of abstraction over Hibernate and TopLink. One note for those new to JPA. JPA makes use of annotations instead of XML files for representing database metadata. And Seam uses these annotations to do validations. For example, if a column as nullable=false set, then Seam will ensure that this column has an input value before passing it to the database. 12
  • 13. The Model 2 Architecture – JBoss Seam JSF / Facelets Front-end JPA Business Layer Database Layer 13 www.ebizss.com 01 October 2008 Architecture of a Java Web Application created using Seam is much simpler. 13
  • 14. Look Ma – No Integration Layer!!! Seam exposes Business Layer objects and their attributes on the front-end using EL expressions. Hence, there is no need to have a separate set of objects in the front-end layer or to convert them back and forth in the Integration Layer 14 www.ebizss.com 01 October 2008 Since Seam can expose back-end objects on the front-end using EL (JSF expression language), there is no need for an integration layer to convert objects backwards and forwards anymore. 14
  • 15. Demo This demo will demonstrate how quickly and easily we can generate a java web application using Seam and its tools from a database. 15 www.ebizss.com 01 October 2008 15
  • 16. Steps – pre-requisites Install JDK 1.5.x (and not JDK 1.6.x) http://java.sun.com/javase/downloads/index_jdk5.jsp Install ANT 1.7.x http://ant.apache.org/bindownload.cgi Install JBoss 4.2.3.GA http://www.jboss.org/jbossas/downloads/ Install any JDBC compliant database (I am using PostgreSQL 8.1.x) Install JBoss Seam 2.0.2.SP1 http://www.seamframework.org/Download Copy the JDBC driver for your database to SEAM_INSTALL_DIR/lib 16 www.ebizss.com 01 October 2008 16
  • 17. Steps (continued…) The following steps are for Windows Go to command-prompt, change directory to SEAM_INSTALL_DIR and run the following commands: seam setup (only once per project) seam create-project (again, only once per project) seam generate seam explode (or seam deploy if you want to deploy as .ear file) Start JBoss Server with default configuration Visit http://localhost:8080/project_name/ 17 www.ebizss.com 01 October 2008 17
  • 18. Questions What do I need to know before I can start using JBoss Seam? JSF JPA EJB3 (optional) Hibernate (optional) Given the learning curve, what value have you seen from using JBoss Seam? Simple CRUD in an hour (with every box ticked) One-many or other kind of CRUD in a day (again, with every box ticked) Extendable using Hibernate Search (Its like adding Google Search to your web application – has your boss ever asked for it?) How can we change the look-and-feel of a seam-gen generated application to something more presentable? You WILL need a web designer with good CSS skills for this Use layout/template.xhtml as a starting point and create your own template Either overwrite layout/template.xhtml with your template or use your template as the template in the ui:composition tag in the generated xhtml pages. 18 www.ebizss.com 01 October 2008 18
  • 19. Where to go from here Me – ashish@ebizss.com My company’s website – www.ebizss.com My website – www.ashishkulkarni.com My company’s wiki – www.ebizss.com/wiki My company’s public SVN repository – www.ebizss.com/svn/public www.seamframework.org JSR-299 - http://jcp.org/en/jsr/detail?id=299 Books: Manning – Seam in Action by Don Allen 19 www.ebizss.com 01 October 2008 I would attempt to answer questions as long as it is practical for me to do so. I would also welcome your feedback on this presentation. In case you or your company is interested to hire my services and need a more detailed CV, please feel free to contact me for that as well ☺. 19
  • 20. Bonus I have created a utility called sg2me to migrate seam-gen generated applications in an exploded state to MyEclipse. This utility is available from my company’s public SVN site at: http://www.ebizss.com/svn/public/seam- gen2mews/ 20 www.ebizss.com 01 October 2008 As you can guess, I have been using MyEclipse. The project created by seam- gen is not in a structure that everyone likes. Hence, I created this utility to migrate a seam-gen generated project to a project that MyEclipse can understand. 20
  • 21. A bit about me I am a Java Contractor currently contracting with JP Morgan in Glasgow. Apart from contracting, I am actively working with other developers at my company to develop bespoke software for private clients. I have been using JBoss Seam for just about a year now and am absolutely loving it. Having worked on FoxPro, Oracle, Visual C++ and SAP in the past, I have 14 years of development experience. I have been using Java since 2000 which to this day remains my favourite computer language. I have worked in a variety of industries such as Retail Banking, Investment Banking, Financial Institutions, Pharmaceuticals, Manufacturing, Automobiles and Telecommunications. 21 www.ebizss.com 01 October 2008 21