Seam 3. Pete Muir JBoss, a Division of Red Hat

Similar documents
Seam & Web Beans. Pete Muir JBoss, a division of Red Hat.

Seam. Pete Muir JBoss, a Division of Red Hat.

JSR-299 (CDI), Weld and the Future of Seam. Dan Allen Principal Software Engineer JBoss by Red Hat

JSR 299: Web Beans. Web Beans Expert Group. Version: Public Review

PATTERNS & BEST PRACTICES FOR CDI

JVA-163. Enterprise JavaBeans

Java EE 6 - Update Harpreet Singh GlassFish Portfolio Product Manager

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

Improve and Expand JavaServer Faces Technology with JBoss Seam

Seam. Pete Muir JBoss, a Division of Red Hat.

Developing Applications with Java EE 6 on WebLogic Server 12c

Java EE 6: Develop Business Components with JMS & EJBs

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Introduction to CDI Contexts and Dependency Injection

Introduction to Seam. Pete Muir. JBoss, a division of Red Hat

Java EE 6: Develop Web Applications with JSF

Apache OpenWebBeans and DeltaSpike Deep Dive Mark Struberg Gerhard Petracek

TheServerSide.com. Part 3 of dependency injection in Java EE 6

Java EE 7: Back-End Server Application Development

Refactoring to Seam. NetBeans. Brian Leonard Sun Microsystems, Inc. 14o

This is the first part of a multi-article series. For part 2 please see: Dependency Injection in Java EE 6 - Part 2

V3 EJB Test One Pager

CO Java EE 7: Back-End Server Application Development

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Web Application Development Using Spring, Hibernate and JPA

Courses For Event Java Advanced Summer Training 2018

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

}w!"#$%&'()+,-./012345<ya

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Specialized - Mastering JEE 7 Web Application Development

open source community experience distilled

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

object/relational persistence What is persistence? 5

Shale and the Java Persistence Architecture. Craig McClanahan Gary Van Matre. ApacheCon US 2006 Austin, TX

Eclipse Java Ejb 3.0 Tutorial For Beginners With Examples Pdf

JSR 365 (CDI 2.0) Review

Web Application Development Using Spring, Hibernate and JPA

Contents at a Glance

Apache MyFaces CODI. Mark Struberg, INSO TU-Vienna

Fast Track to EJB 3.0 and the JPA Using JBoss

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

Enterprise Java in 2012 and Beyond From Java EE 6 To Cloud Computing

TheServerSide.com. Dependency Injection in Java EE 6 - Part 5

Struts: Struts 1.x. Introduction. Enterprise Application

The Next Generation. Prabhat Jha Principal Engineer

Web Application Development Using Spring, Hibernate and JPA

Enterprise Java Development using JPA, Hibernate and Spring. Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009

Leverage Rational Application Developer v8 to develop Java EE6 application and test with WebSphere Application Server v8

1 Markus Eisele, Insurance - Strategic IT-Architecture

Migrating traditional Java EE applications to mobile

An Introduction to Seam 3

Introduction to Spring 5, Spring MVC and Spring REST

Hands-on Development of Web Applications with Java EE 6

Concepts: business logic and middleware

Java Platform, Enterprise Edition 6 with Extensible GlassFish Application Server v3

This is the second part of a multi-article series. For part 1 please see: Dependency Injection in Java EE 6 - Part 1

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

ADVANCED JAVA COURSE CURRICULUM

<Insert Picture Here> Exploring Java EE 6 The Programming Model Explained

Fast Track to Java EE

TheServerSide.com. Dependency Injection in Java EE 6: Conversations (Part 4) Dependency Injection in Java EE 6 (Part 4) by Reza Rahman

Spring & Hibernate. Knowledge of database. And basic Knowledge of web application development. Module 1: Spring Basics

Introduction to Web Beans

Oracle Corporation

ADVANCED JAVA TRAINING IN BANGALORE

"Charting the Course... Mastering EJB 3.0 Applications. Course Summary

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Seam Tools Tutorial. Version: Final-SNAPSHOT

Java Technologies Contexts and Dependency Injection (CDI)

Integrating Seam and GWT

New Features in EJB 3.1

com Spring + Spring-MVC + Spring-Boot + Design Pattern + XML + JMS Hibernate + Struts + Web Services = 8000/-

WHAT IS EJB. Security. life cycle management.

"Web Age Speaks!" Webinar Series

ENTERPRISE JAVABEANS TM (EJB TM ) 3.1 TECHNOLOGY

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

For this week, I recommend studying Chapter 2 of "Beginning Java EE 7".

Fast Track to Spring 3 and Spring MVC / Web Flow

JVA-117A. Spring-MVC Web Applications

Oracle Fusion Middleware 11g: Build Applications with ADF I

JVA-563. Developing RESTful Services in Java

<Insert Picture Here> Productive JavaEE 5.0 Development

APPLICATION SECURITY ENHANCEMENTS IN JAVA EE 6

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Desarrollo de Aplicaciones Web Empresariales con Spring 4

Fun with EJB and OpenEJB. David #OpenEJB

Java EE 6 Community Roundtable. Reza Rahman Independent Consultant Author, EJB 3 in Action

DVS WEB INFOTECH DEVELOPMENT TRAINING RESEARCH CENTER

LTBP INDUSTRIAL TRAINING INSTITUTE

Enterprise Architectures

WebSphere Portal Application Development Best Practices using Rational Application Developer IBM Corporation

JSF 2.0: Insight and Opinion

Contents. 1. JSF overview. 2. JSF example

Mark Struberg / INSO, TU Vienna. Apache DeltaSpike...closes the gap

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

Java SE7 Fundamentals

Session 24. Introduction to Java Server Faces (JSF) Robert Kelly, Reading.

Chapter 1 Introducing EJB 1. What is Java EE Introduction to EJB...5 Need of EJB...6 Types of Enterprise Beans...7

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Transcription:

Seam 3 Pete Muir JBoss, a Division of Red Hat

Road Map Introduction Java EE 6 Java Contexts and Dependency Injection Seam 3

Mission Statement To provide a fully integrated development platform for building rich Internet applications based upon the Java EE environment.

:.&8!0&/1%"*"23 4&5!6,7#&8",9!"#$"%&%'!(")&* +&,-.-'&%/&!0&/1%"*"23

:.&8!0&/1%"*"23 4&5!6,7#&8",9 &"%'($%% )*+,$%%!"#$% -.,/$ 0,/$1"#$!"#$"%&%'!(")&* +&,-.-'&%/&!0&/1%"*"23 0$,"*'23 4+,"5$(2 62,777

:.&8!0&/1%"*"23 &"%'($%% )*+,$%%!"#$% 4&5!6,7#&8",9!"#$"%&%'!(")&*!"#$ -.,/$ 0,/$1"#$ 0$,"*'23 +&,-.-'&%/&!0&/1%"*"23 4+,"5$(2 62,777

JBoss Application Server

JBoss Application Server JBoss Enterprise Application Platform JBoss SOA Platform

WebSphere Web Logic Glassfish JBoss Application Server JBoss Enterprise Application Platform JBoss SOA Platform

WebSphere Web Logic Tomcat Glassfish JBoss Application Server JBoss Enterprise Application Platform JBoss SOA Platform

The Seam Stack A complete solution for developing applications based upon Java EE standards The stack consists of... Java EE integration Declarative security Page flows (jpdl) and business processes (jbpm) JavaScript remoting or AJAX through view layer Email, graphics, PDF, and XLS Spring integration and more... Other view layers - Wicket, Flex

Getting started...is easy! Focus on delivering useful functionality to users early on, then repeat Project generator, component templates, reverse engineering tool (from Java classes or database) Eclipse tooling JBoss Developer Studio (JBDS) Key benefit of working in Java is refactoring JBoss tooling takes every advantage of it Forms for all configuration files Visual page and navigation editors Incremental hot deployment

Road Map Introduction Java EE 6 Java Contexts and Dependency Injection Seam 3

Web Profile The EE 6 web profile removes most of the cruft that has developed over the years Full stack for building web applications mainly the totally useless stuff like web services, EJB 2 entity beans, etc some useful stuff like JMS is also missing, but vendors can include it if they like

JSF2 Convention over configuration Facelets added to spec no change to view definition Easy component creation inspired by facelets View parameters state held in bookmarkable URL easily generate links and buttons for navigation Built in resource handling

JSF2 Integrated AJAX support inspired by Ajax4jsf, IceFaces Exception handling good ootb behavior, pluggable New event systems including declarative events Bean validation integration Project stages add extra debug info automatically

EJB 3.1 No interface views great for prototyping! Embeddable EJB for unit testing Singletons Async support natural timer syntax Portable global JNDI

And more... Bean Validation 1.0 annotation-based validation API integrates cleanly with JSF2, JPA2, Spring etc. for model based validation JPA 2.0 typesafe criteria query API many more O/R mapping options - no need to use Hibernate APIs :-)

JSR-299 Spec formally known as Web Beans, now Java Contexts and Dependency Injection defines a unifying dependency injection and contextual lifecycle model a new, rich, dependency management model designed for use with stateful objects integrates the web and transactional tiers makes it much easier to build applications using JSF and EJB together includes a complete SPI allowing third-party frameworks to integrate cleanly in the EE 6 environment

Road Map Introduction Java EE 6 Java Contexts and Dependency Injection Seam 3

Contextual objects What can be injected? (Almost) any Java class EJB session beans Objects returned by producer methods Java EE resources (Datasources, JMS topics/ queues, etc) Persistence contexts (JPA EntityManager) Web service references Remote EJBs references

Loose coupling Events, interceptors and decorators enhance the loose-coupling that is inherent in this model: event notifications decouple event producers from event consumers interceptors decouple technical concerns from business logic decorators allow business concerns to be compartmentalized

Essential ingrediants API types Binding annotations Scope Deployment type A name (optional) Interceptor bindings The implementation

Simple Example public class Hello { public String hello(string name) { return "hello" + name; @Stateless public class Hello { public String hello(string name) { return "hello" + name; Any Java Bean can use these services So can EJBs

Simple Example public class Printer { @Current Hello hello; @Current is the default (built in) binding type public void hello() { System.out.println( hello.hello("world") );

Web Bean Names @Named("hello") public class Hello { public String hello(string name) { return "hello" + name; @Named public class Hello { public String hello(string name) { return "hello" + name; By default not available through EL. If no name is specified, then a default name is used. Both these beans have the same name

JSF Page <h:commandbutton value= Say Hello action= #{hello.hello /> Calling an action on a bean through EL

Binding Types A binding type is an annotation that lets a client choose between multiple implementations of an API at runtime Binding types replace lookup via string-based names @Current is the default binding type

Define a binding type public Creating a binding type is @BindingType really easy! @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER) @interface Casual {

Using a binding type @Casual public class Hi extends Hello { public String hello(string name) { return "hi" + name; We also specify the @Casual binding type. If no binding type is specified on a bean, @Current is assumed

Using a binding type Here we inject the Hello bean, and require an implementation which is bound to @Casual public class Printer { @Casual Hello hello; public void hello() { System.out.println( hello.hello("jboss") );

Scopes and Contexts Dependent scope, @Dependent Built-in scopes: Any servlet @ApplicationScoped @RequestScoped @SessionScoped JSF requests - @ConversationScoped Custom scopes

Scopes @SessionScoped Session scoped public class Login { private User user; public void login() { user =...; public User getuser() { return user;

Scopes public class Printer { @Current Hello hello; @Current Login login; No coupling between scope and use of implementation public void hello() { System.out.println( hello.hello( login.getuser().getname() ) );

Producer methods Producer methods allow control over the production of a Web Bean where: the objects to be injected are not required to be instances of Web Beans the concrete type of the objects to be injected may vary at runtime the objects require some custom initialization that is not performed by the Web Bean constructor

Producer methods @SessionScoped public class Login { private User user; public void login() { user =...; @Produces User getuser() { return user;

Producer methods public class Printer { @Current Hello hello; @Current User user; Much better, no public void hello() { dependency on Login! System.out.println( hello.hello( user.getname() ) );

Java EE Resources To inject Java EE resources, persistence contexts, web service references, remote EJB references, etc, we use a special kind of producer field declaration: public class PricesTopic { @Produces @Prices @Resource(name="java:global/env/jms/Prices") Topic pricestopic; public class UserDatabasePersistenceContext { @Produces @UserDatabase @PersistenceContext EntityManager userdatabase;

Road Map Introduction Java EE 6 Java Contexts and Dependency Injection Seam 3

Key themes Loose coupling pick and choose the modules you want Portability run the modules in any JCDI environment Full stack all core modules tested together, with examples showing how to use Sandbox for new module ideas

Environments JSR-299 is targeted at Java EE Java EE web profile Use with EJB 3.1 Embeddable Web Beans add supports for Servlet containers like Tomcat or Jetty Java SE

Integrations Other DI frameworks Seam 2 bridge Spring bridge Guice bridge A Seam 2 native layer for supporting Seam style dependency injection View layers JCDI requires JSF support Wicket Flex and other planned

Portable modules can be used in any JSR-299 environment jbpm log injection (choose between log4j and jlr, parameter interpolation Seam Security Reporting Excel PDF Mail Javascript remoting

Web Beans JSR-299 forms the core of Seam Web Beans is the Reference implementation Currently feature complete preview Download it, try it out, give feedback! Supported in this release: JBoss 5.1.CR1 GlassFish V3 build 46 Tomcat 6.0.x Jetty 6.1.x

Seam 3 Just getting started!

Q & A http://in.relation.to/bloggers/pete http://www.seamframework.org/