java ee - fhws 2014 - 1 spec

47
Java EE Full Stack for Business Applications Die Spec 2014-10- 17

Upload: matthias-reining

Post on 26-Jun-2015

133 views

Category:

Technology


0 download

DESCRIPTION

Java EE - FHWS 2014 - 1 spec

TRANSCRIPT

Page 1: Java EE - FHWS 2014 - 1 spec

Java EEFull Stack for Business

Applications

Die Spec

2014-10-17

Page 2: Java EE - FHWS 2014 - 1 spec

Referent: MATTHIAS REINING

Technical Manager Insurance at RGI Deutschland GmbH

blog: http://blog.matthias-reining.com

twitter: https://twitter.com/MatthiasReining

about.me: http://about.me/matthiasreining

2014-10-17

Page 3: Java EE - FHWS 2014 - 1 spec

Die Spec

2014-10-17

Page 4: Java EE - FHWS 2014 - 1 spec

DAS PROGRAMM

Die Spec Idee, Historie

Der App Server Containerkonzept Paketierung (JAR, WAR, EAR) Marktüberblick

Das Projekt Entwicklung eines Beispielprojektes IDE Settings, Oberflächen (Servlets, JSF),

Business Logic (EJB), Persistence (JPA), Java EE Patterns (CDI), Web Services (JAX-RS)

Die Produktion Buildmanagement (maven, Jenkins) Deployment einer Java EE Anwendung in

der Cloud bei einem PaaS Anbieter

2014-10-17

Page 5: Java EE - FHWS 2014 - 1 spec

Die Plattformen der Programmiersprache Java

Java Platform, Standard Edition (Java SE)

Java Platform, Enterprise Edition (Java EE)

Java Platform, Micro Edition (Java ME)

Java FX

2014-10-17

Page 6: Java EE - FHWS 2014 - 1 spec

Definition(en)

2014-10-17

Page 7: Java EE - FHWS 2014 - 1 spec

Java EE

The Java EE platform is built on top of the Java SE platform. The Java EE platform provides an API and runtime environment for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications.

[Quelle: http://docs.oracle.com/javaee/7/firstcup/doc/java-ee001.htm#GKHOY ]

2014-10-17

Page 8: Java EE - FHWS 2014 - 1 spec

Java Platform, Enterprise Edition, abgekürzt Java EE oder früher J2EE, ist die die Spezifikation einer Softwarearchitektur für die transaktionsbasierte Ausführung von in Java programmierten Anwendungen und insbesondere Web-Anwendungen. Sie ist eine der großen Plattformen, die um den Middleware-Markt kämpfen. Größter Konkurrent ist dabei die .NET-Plattform von Microsoft.

[Quelle: http://de.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition]

2014-10-17

Page 9: Java EE - FHWS 2014 - 1 spec

The Java EE application model defines an architecture for implementing services as multitier applications that deliver the scalability, accessibility, and manageability needed by enterprise-level applications. This model partitions the work needed to implement a multitier service into the following parts:

The business and presentation logic to be implemented by the developer

The standard system services provided by the Java EE platform

[Quelle: http://docs.oracle.com/javaee/7/tutorial/doc/overview002.htm]

2014-10-17

Page 10: Java EE - FHWS 2014 - 1 spec

Die Java Enterprise Edition ist angetreten um einen

Full Stack for Business Applications zu definieren.

2014-10-17

Page 11: Java EE - FHWS 2014 - 1 spec

Definieren?

Die Java EE ist „nur“ eine Spezifikation

Die Implementierung dieser Spezifikation wird von Herstellern der Application Servern übernommen.

2014-10-17

Page 12: Java EE - FHWS 2014 - 1 spec

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 13: Java EE - FHWS 2014 - 1 spec

EXKURS: BUSINESS APPLICATIONS?

Geschäftsanwendungen:

Funktionalität steht im Vordergrund

Investitionsschutz für Unternehmen

Langfristiger Support

Verwendung von Standards

Ergänzend: Das UI bei Geschäftsanwendungen wurde in der Vergangenheit oft vernachlässigt. „Sexy“ geht anders! Ändert sich langsam…

2014-10-17

Page 14: Java EE - FHWS 2014 - 1 spec

Wer bestimmt eigentlich was mit Java und Java EE passiert?

2014-10-17

Page 15: Java EE - FHWS 2014 - 1 spec

JCP & JSR

2014-10-17

Page 16: Java EE - FHWS 2014 - 1 spec

JCP – Java Community Process

https://jcp.org definiert Java Specification Requests.

JSR Definition: http://de.wikipedia.org/wiki/Java_Specification_Request

Beispiel: JSR 342, Java Platform, Enterprise Edition 7 Final ReleaseJSR 338, Java Persistence 2.1JSR 310, Date and Time API

Aus der Praxis: http://jaxenter.de/news/java-ee-8-konfiguration-175990

2014-10-17

Page 17: Java EE - FHWS 2014 - 1 spec

JSR – Java Specification Request

Beispiele für einen neuen JSR:

http://www.oracle.com/technetwork/java/javaee/overview/index.html

JSR 371: Model-View-Controller (MVC 1.0) Specificationhttps://jcp.org/en/jsr/detail?id=371

2014-10-17

Page 18: Java EE - FHWS 2014 - 1 spec

Wie alles begann…

2014-10-17

Page 19: Java EE - FHWS 2014 - 1 spec

Die Geschichte der Java Enterprise Edition

• JPE (May 1998) Announcement of the JPE (Java Professional Edition) project at Sun.

• J2EE 1.2 (Dezember 12, 1999)• J2EE 1.3 (September 24, 2001)• J2EE 1.4 (November 11, 2003)

• Java EE 5 (May 11, 2006)• Java EE 6 (Dec 10, 2009)• Java EE 7 (May, 2013)

2014-10-17

Page 20: Java EE - FHWS 2014 - 1 spec

Problem…

langen Releasezyklen.

Neue, innovative Techniken sind nur sehr langsam in die Spezifikation eingeflossen.

2014-10-17

Page 21: Java EE - FHWS 2014 - 1 spec

Problem…

vor Java EE 5 war alles sehr, sehr „umständlich“

Home Interfaces & XML „Schlachten“ (xdoclets)

Andere Frameworks:

Spring

Struts & Co

oder gleich .NET (aber auch in .NET wurden viele Fehler gemacht)

2014-10-17

Page 22: Java EE - FHWS 2014 - 1 spec

Aber trotzdem…

Abwärtskompatibel

„Garantierter“ Support von verschiedenen Herstellern

Standardisiert ( hier gab es auch andere Meinungen von der „Spring Fraktion“)

Allgemein

Ab Java EE 5 „leichtgewichtig“

Java EE

2014-10-17

Page 23: Java EE - FHWS 2014 - 1 spec

Der App Server

2014-10-17

Page 24: Java EE - FHWS 2014 - 1 spec

DAS PROGRAMM

Die Spec Idee, Historie

Der App Server Containerkonzept Paketierung (JAR, WAR, EAR) Marktüberblick

Das Projekt Entwicklung eines Beispielprojektes IDE Settings, Oberflächen (Servlets, JSF),

Business Logic (EJB), Persistence (JPA), Java EE Patterns (CDI), Web Services (JAX-RS)

Die Produktion Buildmanagement (maven, Jenkins) Deployment einer Java EE Anwendung in

der Cloud bei einem PaaS Anbieter

2014-10-17

Page 25: Java EE - FHWS 2014 - 1 spec

Application Server implementieren die Java EE

Spezifikation

2014-10-17

Page 26: Java EE - FHWS 2014 - 1 spec

Mit Fertigstellung der Spec liefert Oracle eine Referenzimplementierung aus: der Glassfish Application Server

2014-10-17

Page 27: Java EE - FHWS 2014 - 1 spec

Der verbreiteste Open Source Application Server kommt aus dem Hause RedHat: JBoss AS / Wildfly

2014-10-17

Page 28: Java EE - FHWS 2014 - 1 spec

DAS PROGRAMM

Die Spec Idee, Historie

Der App Server Containerkonzept Paketierung (JAR, WAR, EAR) Marktüberblick

Das Projekt Entwicklung eines Beispielprojektes IDE Settings, Oberflächen (Servlets, JSF),

Business Logic (EJB), Persistence (JPA), Java EE Patterns (CDI), Web Services (JAX-RS)

Die Produktion Buildmanagement (maven, Jenkins) Deployment einer Java EE Anwendung in

der Cloud bei einem PaaS Anbieter

2014-10-17

Page 29: Java EE - FHWS 2014 - 1 spec

Populäre Application Server

Open Source JBoss AS – Redhat Wildfly – Redhat Glassfish – Oracle Geronimo - Apache

Kommerziell Websphere – IBM Oracle WebLogic - Oracle Oracle AS – Oracle BEA Weblogic – BEA SAP NetWeaver Application Server – SAP

2014-10-17

Page 30: Java EE - FHWS 2014 - 1 spec

Keine (Java) Application Server

Apache HTTP Server Tomcat Jetty Node.js Internet Information Server (IIS) Grails / Rails

2014-10-17

Page 31: Java EE - FHWS 2014 - 1 spec

DAS PROGRAMM

Die Spec Idee, Historie

Der App Server Containerkonzept Paketierung (JAR, WAR, EAR) Marktüberblick

Das Projekt Entwicklung eines Beispielprojektes IDE Settings, Oberflächen (Servlets, JSF),

Business Logic (EJB), Persistence (JPA), Java EE Patterns (CDI), Web Services (JAX-RS)

Die Produktion Buildmanagement (maven, Jenkins) Deployment einer Java EE Anwendung in

der Cloud bei einem PaaS Anbieter

2014-10-17

Page 32: Java EE - FHWS 2014 - 1 spec

Java Archive Analoger Aufbau zu jar-Files in Java SE Java SE jar-Files werden analog behandelt (= weitere Klassen im

Classpath) Es gibt aber auch EJB-JARs. Diese beinhalten beispielsweise Session

Beans die nur auf einem App-Server lauffähig sind

2014-10-17

Page 33: Java EE - FHWS 2014 - 1 spec

Web Archive Inhalt

Servlets JSP Pages Utility Classes Static documents (HTML, images, sounds, etc.) Client side Java applets, beans, and classes Descriptive meta information that ties all of the above elements together

Verzeichnisstruktur:

Beschreibung: http://download.oracle.com/otndocs/jcp/servlet-3_1-fr-eval-spec/index.html10.5 Directory Structure

Deployment Descriptor / Annotations steuern das Verhalten

Enterprise Beans „funktionieren“ auch direkt im WAR Files seit Java EE 6

Beispiel:/index.html /howto.jsp/images/logo.png /WEB-INF/web.xml /WEB-INF/lib/util.jar /WEB-INF/lib/catalog.jar!/META-INF/resources/catalog/moreOffers/book.html/WEB-INF/classes/org/wikipedia/MyUtil.class /WEB-INF/classes/org/wikipedia/MyServlet.class

2014-10-17

Page 34: Java EE - FHWS 2014 - 1 spec

Enterprise Archive Klammern jar, ejb-jar und war Files Deployment Descriptor beschreiben das Verhalten (Classloader, …) Waren bis zu Java EE 5/6 notwendig um mit Session Beans zu arbeiten Seit Java EE 6 können die meisten Funktionalitäten des ear-Archives

auch mit einem „einfacheren“ war-Archiv verwendet werden können. war-file bevorzugen! Macht die Entwicklung einfacher ;-)

2014-10-17

Page 35: Java EE - FHWS 2014 - 1 spec

DAS PROGRAMM

Die Spec Idee, Historie

Der App Server Containerkonzept Paketierung (JAR, WAR, EAR) Marktüberblick

Das Projekt Entwicklung eines Beispielprojektes IDE Settings, Oberflächen (Servlets, JSF),

Business Logic (EJB), Persistence (JPA), Java EE Patterns (CDI), Web Services (JAX-RS)

Die Produktion Buildmanagement (maven, Jenkins) Deployment einer Java EE Anwendung in

der Cloud bei einem PaaS Anbieter

2014-10-17

Page 36: Java EE - FHWS 2014 - 1 spec

SERVERParallelität – Sessions – Skalierbarkeit

2014-10-17

Page 37: Java EE - FHWS 2014 - 1 spec

HOLLYWOOD PRINZIPDon‘t call us, we‘ll call you!

2014-10-17

Page 38: Java EE - FHWS 2014 - 1 spec

Inversion of controlDesign pattern

(http://en.wikipedia.org/wiki/Inversion_of_control)

2014-10-17

Page 39: Java EE - FHWS 2014 - 1 spec

The Java EE application model defines an architecture for implementing services as multitier applications that deliver the scalability, accessibility, and manageability needed by enterprise-level applications. This model partitions the work needed to implement a multitier service into the following parts:

The business and presentation logic to be implemented by the developer

The standard system services provided by the Java EE platform

[Quelle: http://docs.oracle.com/javaee/7/tutorial/doc/overview002.htm]

2014-10-17

Page 40: Java EE - FHWS 2014 - 1 spec

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 41: Java EE - FHWS 2014 - 1 spec

Java EE APIs in the Web Container

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 42: Java EE - FHWS 2014 - 1 spec

Java EE APIs in the Web Container

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 43: Java EE - FHWS 2014 - 1 spec

Java EE APIs in the EJB Container

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 44: Java EE - FHWS 2014 - 1 spec

Java EE APIs in the EJB Container

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 45: Java EE - FHWS 2014 - 1 spec

Java EE APIs in the Application Client Container

http://docs.oracle.com/javaee/7/tutorial/doc/overview007.htm

2014-10-17

Page 46: Java EE - FHWS 2014 - 1 spec

Middleware

2014-10-17

Page 47: Java EE - FHWS 2014 - 1 spec

Middleware is the infrastructure which facilitates creation of business applications, and provides core services like concurrency, transactions, threading, messaging, and the SCA framework for service-oriented architecture (SOA) applications. It also provides security and enables high availability functionality to the enterprise.

Middleware includes Web servers, application servers, content management systems, and similar tools that support application development and delivery. It is especially integral to information technology based on Extensible Markup Language (XML), Simple Object Access Protocol (SOAP), Web services, SOA, Web 2.0 infrastructure, and Light weight directory access protocol(LDAP)

[Quelle: http://en.wikipedia.org/wiki/Middleware]

2014-10-17