DevEX - reference for building teams, processes, and platforms
Developer Productivity with Forge, Java EE 6 and Arquillian
1. RAPID JAVA Using
APPLICATION JBoss Forge,
Arquillian &
Java EE 6
DEVELOPMENT
Ray Ploski
Director, Developer Programs & Strategy
JBoss, by Red Hat, Inc.
2. DEVELOPER PRODUCTIVITY
- WHAT IF?
Faster Start-Up Times
80% Less Configuration
?
50% Less Code
Open eco-system
25% Less Classes
Vendor Agnostic
Rapid Application Tooling
Easier Integration Testing
* Based on a Sample POJO/JPA/REST Based Application
11. DEVELOPER PRODUCTIVITY
WHAT IF?
Faster Start-Up Times
80% Less Configuration
?
50% Less Code
Open eco-system
25% Less Classes
Vendor Agnostic
Rapid Application Tooling
Easier Integration Testing
* Based on a Sample POJO/JPA/REST Based Application
12. JAVA EE 5
¡ R esource injection in JEE5
§ @EJB, @Resource, @PersistenceContext,
§ @PersistenceUnit
¡ I nto Container Components:
§ Servlets, JSF backing beans and other EJBs
¡ P rogress but still Problems
§ No POJOs
§ Cannot inject DAOs or helper classes that were not written as
EJBs
§ Hard to integrate anything but strictly business components
16. EJB 3.1 CLIENT VIEW
@EJB BankLocal bank;!
!
public void makeDeposit() !
{!
bank.deposit(2500.00, new Account(12345));!
}!
17. HOW DID THEY DO THAT?
¡ C onfiguration by exception with sensible
defaults
§ Security permissions defaults to UNCHECKED
§ Transaction type defaults to CONTAINER
§ Transaction attribute defaults to REQUIRED
¡ U se Annotations
§ To choose explicitly (recommended)
§ To override defaults
¡ D eployment descriptor is no longer required
§ But can override above configurations
27. DEFINING THE BEANS
@NumberOfDigits(Digits.EIGHT)!
public class IssnGenerator implements NumberGenerator {!
!
public String generateNumber() {!
return “8-” + nextNumber();!
}!
!
// …!
}!
!
@NumberOfDigits(Digits.THIRTEEN)!
public class IsbnGenerator implements NumberGenerator {!
!
public String generateNumber() {!
return “13-84356-” + nextNumber();!
}!
!
// …!
}!
28.
29. CDI - EXTENSIBLE BY DESIGN
¡ M any community projects of extensions:
§ Seam 3, CODI, Cambridge Technology Partners
¡ These multiple projects merging to deliver a
vendor-neutral open ecosystem for extensions
named DeltaSpike .
¡ Hosted on Apache. Works on all Java EE 6
servers
+ + CDISource DeltaSpike
31. DEVELOPER PRODUCTIVIT Y
- WHAT IF?
Faster Start-Up Times
80% Less Configuration
?
50% Less Code
Open eco-system
25% Less Classes
Vendor Agnostic
Rapid Application Tooling
Easier Integration Testing
* Based on a Sample POJO/JPA/REST Based Application
32. ISN’T JAVA EE TOO SLOW & FAT?
¡ Startup Times w/ an Application
Deployed
§ JBoss AS 7.10 ~ 2 seconds
§ GlassFish v3 ~ 4 seconds
§ Tomcat 6 + Spring ~ 4 seconds
§ Java EE 6 War File < 100kb
46. JAVA EE 6 SPECIFICATION
No Where in the
Specification does it
mention that
App Servers must be slow
and complex.
47. DEVELOPER PRODUCTIVIT Y
- WHAT IF?
80% Less Configuration
Faster Start-Up Times
?
Open eco-system
50% Less Code
25% Less Classes
Vendor Agnostic
Rapid Application Tooling
Easier Integration Testing
* Based on a Sample POJO/JPA/REST Based Application
62. A powerful programming model.
Less code, greater portability.
Optimized for productivity & automation.
CDI and Forge plugins.
Absolutely. You saw it first hand.
63. ¡ Max Andersen
§ “See Context & Dependency Injection from Java EE 6 in
Action”
§ http://www.slideshare.net/maxandersen/see-context-
dependency-injection-from-java-ee-6-in-action
¡ Pete Muir REFERENCES
§ “CDI in Action”
¡ Andrew Lee Rubinger
§ “The Death of Slow”
§ http://www.slideshare.net/ALRubinger/devoxx-2011-
jboss-as7-death-of-the-slow
¡ B ert Ertman
§ EJB 3.1
§ http://www.slideshare.net/stephanj/ejb-31-by-bert-
ertman
¡ Antonio Goncalves
§ “To inject or not to inject: CDI is the question”
§ http://www.slideshare.net/agoncal/to-inject-or-not-to-inject-cdi-is-the-
question