16
S Java EE 7 The new features of the upcoming Enterprise Edition

Java EE 7 The new features of the upcoming Enterprise Edition

Embed Size (px)

Citation preview

Page 1: Java EE 7 The new features of the upcoming Enterprise Edition

S

Java EE 7The new features of the upcoming Enterprise Edition

Page 2: Java EE 7 The new features of the upcoming Enterprise Edition

Hello, I‘m Marcus

Diploma in Computer Science 2002University of Tuebingen

Freelancing Software Architectspecialized in Java EE

worked for serveral large companiesin Germany like Daimler (Mercedes), Commerzbank and Deutsche Bahn

Page 3: Java EE 7 The new features of the upcoming Enterprise Edition

Our Agenda

• Overview of the new features• Example application• Dig into the code

Page 4: Java EE 7 The new features of the upcoming Enterprise Edition

Damn it, we need a new main theme!

Originally: PaaS (Cloud and multi-tenancy)

No Cloud

No Multi-tenancy

But Productivity and HTML5

Due date: Q2 2013

Page 5: Java EE 7 The new features of the upcoming Enterprise Edition

JSF 2.2

renders HTML5

<h:inputText value="#{bean.value}" > <f:passThroughAttribute name="placeholder" value="Enter text" /> </h:inputText>

CDI ViewScope / Managed Beans deprecated

Faces Flow

How to use the new features: http://www.marcusschiesser.de/2013/01/how-to-use-jsf-2-2-with-jboss-7-1

Page 6: Java EE 7 The new features of the upcoming Enterprise Edition

CDI 1.1, EJB 3.2 & JPA 2.1

@Transactional-Annotation

But: Still no annotations for EJB Security

CDI: Priority ordering of Interceptors and Decorators

JPA: Stored Procedures and DB-Functions in JPQL

Page 7: Java EE 7 The new features of the upcoming Enterprise Edition

Method level validation

Part of Bean Validation 1.1

@NotNullpublic MyObject createMyObject(

@Size(min=5, max=40) String name, @DecimalMin(value="1.00") Double

value, @Pattern(regexp="\\d{8}") String code)

{...

Page 8: Java EE 7 The new features of the upcoming Enterprise Edition

JMS 2.0

@Inject@JMSConnectionFactory("jms/connectionFactory")private JMSContext context;

@Resource(mappedName = "jms/inboundQueue")private Queue inboundQueue; 

public void sendMessage(String payload) {context.send(inboundQueue, payload);

}

Page 9: Java EE 7 The new features of the upcoming Enterprise Edition

Some new APIs

Java API for JSON Processing (JSR 353)

Batch Applications (JSR 352)

Page 10: Java EE 7 The new features of the upcoming Enterprise Edition

Things we‘ll cover

Java API for WebSockets (JSR 356) Bidirectional communication Directly over TCP No HTTP, only for Handshake via HTTP Upgrade

JAX-RS 2.0 finally a REST-Client

Page 11: Java EE 7 The new features of the upcoming Enterprise Edition

Sample app „MyAktion“

Our sample application allows organizers of nonprofit campaigns to create online fundraising forms for their projects. The organizer can embed these forms into their own website. This allows the organizer to raise money for his campaign. Each organizer can create forms for multiple campaigns.The application takes care of the generation of the forms and the management of the campaigns and donations.

Page 12: Java EE 7 The new features of the upcoming Enterprise Edition

Domain classes

class Fachklassen

Organisator

- E-Mail :String- Nachname :String- Passwort :String- Vorname :String

Aktion

- Name :String- Spendenbetrag :double- Spendenziel :double

Spende

- Betrag :double- Quittung erwünscht :boolean- Spendername :String

«enum»- Status :Status = IN_BEARBEITUNG

«enumeration»Status

UEBERWIESEN {readOnly} IN_BEARBEITUNG {readOnly}

Konto

- BLZ :String- Konto-Nr :String- Name :String- Name der Bank :String

1

sendet Geld von

1

1

empfängt Geld auf

1

1

gespendet wurde

*1

betreibt

*

Page 13: Java EE 7 The new features of the upcoming Enterprise Edition

Let‘s see...

Page 14: Java EE 7 The new features of the upcoming Enterprise Edition

But now some JEE 7 please…

Page 15: Java EE 7 The new features of the upcoming Enterprise Edition

Communication diagram

sd Kommunikationsarchitektur

Websocket-fähiger Browser

Glassfish Java EE 7 my-aktion-monitor

JBoss Java EE 6 my-aktion

Browser oder REST-Client REST

SOAPREST

Websocket

1: Aktion wählen()

1.1: Spenden einer Aktion abfragen()

1.2: Spenden der Aktion übertragen()

2: Geld spenden()

2.1: Neue Spende übertragen()

2.2: Neue Spende übertragen()

Page 16: Java EE 7 The new features of the upcoming Enterprise Edition

Questions?

Please ask and don‘t hesitate to contact me

Name: Marcus Schiesser

Blog: www.marcusschiesser.de

Email: [email protected]

Code: www.bitbucket.org/mschiesser/my-aktion