28.03.2008pfh-technologie-forum-2008 01 technologie - forum 28. märz 2008

37
28.03.2008 PFH-Technologie-Forum- 2008 01 TECHNOLOGIE - FORUM 28. März 2008

Upload: wigburg-radatz

Post on 06-Apr-2015

105 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

TECHNOLOGIE - FORUM

28. März 2008

Page 2: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

AGENDA– JBoss World 2008

– JBoss Seam

– JBoss SOA Platform

– Jboss Developer Studio/Tools

– Portal

– Hibernate Search

Page 3: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss– 1999: EJBoss (EJB Open Source Server) -> JBoss

– Gegründet von Marc Fleury (F)

– JBoss Enterprise Middleware Suite (JEMS)

– Finanzierung durch:– Consulting– Schulungen und Zertifizierung– Support

Page 4: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss 2006: Übernahme duch Red Hat um USD 420Mio

Folge:• „JBoss a Division of Red Hat“• DJ Marc Fleury

Produktauswahl:• JBoss Application Server

• Apache Tomcat

• JBoss jBPM

• JBoss Cache

• JBoss Developer Studio/JBoss Tools

• JBoss Portal

• JBoss Drools

• Hibernate

Page 5: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Jboss World Findet Jährlich statt

Produktpräsentationen und Best-Practice Beispiele

Ca. 800 Teilnehmer 2008

Stark getrieben von Red Hat

Page 6: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Red Hat Inc. Gründung 1993

Vertreibt die bekannte Linux Distribution

Durch die Akquisition von Jboss ist Red Hat in der Lage eine

durchgänge Enterprise Plattform vom Betriebssystem bis zur

Middleware anzubieten

Open Source ist auch in Zukunft Basis

Page 7: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Vorteile von JSF/JPA gegenüber Struts/EJB 2

– Fewer, finer grained artifacts• keine DTOs mehr notwendig• saubere MVC

– Weniger Overhead• keine Struts/EJB 2.x Vorlagen• Keine direkten Aufrufe von HttpSession oder HttpRequest

– Einfacher ORM• Noch einfacher als das Hibernate API!

Page 8: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Vorteile von JSF/JPA gegenüber Struts/EJB 2

• JSF ist einfach und erweiterbar• Eigene UI widget suites• Gute AJAX Unterstützung

• JPA• Mächtiges object/relational mapping, mehr als EJB

• Alle Komponenten sind POJOs, d.h. einfach mit TestNG oder Junit zu testen

Page 9: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Trotzdem bleiben einige Probleme:

JSF Backend Bean verbindet Schichten Refactoring bleibt schwierig Keine Unterstützung für den Business Layer Validierung setzt DRY (Don´t repeat yourself) nicht um XML zu wortreich

Wie wird der Business Layer erstellt? EJB3? - kann nicht direkt von JSF verwendet werden EJB3? - keine Scope Konzept

Page 10: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Und noch einige Dinge zu erledigen:

Workflow Ad-hoc Back Buttons werden nicht unterstützt Keine Stateful Navigation Langandauernde Business Prozesse?

Keine Multi-tab/window Unterstützung Alle Operationen werden in der Session ausgeführt –

mögliches Speicherleck Kein Support für einen “Conversation Context“ Memory leak – Objekte werden nicht schnell genug aus dem

Speicher entfernt

Page 11: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Einfaches JSF mit Seam – Entitäten werden direkt referenziert:

<h:form>Item: <h:outputText value="#{itemEditor.id} />Name: <h:inputText value="#{itemEditor.item.name}">

<f:validateLength maximum="255" /></h:inputText>

Price (EUR): <h:inputText value="#{itemEditor.item.price}"/><f:convertNumber type="currency"

pattern="$###.##" /></h:inputText>

<h:messages /><h:commandButton value="Save" action="#{itemEditor.save}" />

</h:form>

Page 12: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Backend Bean:

@Name("itemEditor")@Scope(CONVERSATION)public class EditItemBean implements EditItem {

@In EntityManager entityManager;Long id;Item item;

// getter and setter pairs

@Begin public String find(Long id) {

item = entityManager.find(Item.class, id);return item == null ? "notFound" : "success";

}

@End public String save(Item item) {

item = entityManager.merge(item);return "success";

}

Seam Komponente im Conversation Scope

Der Scope wird zwischen den Methoden @Begin und @End gehalten

Page 13: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Seam bietet hierarchische, stateful Kontexte:

Page 14: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Bijection

@Name("passwordChanger") public class PasswordChanger {

@In EntityManager entityManager;

@In @Out User currentUser;

public void changePassword() {entityManager.merge(currentUser);

}}

Vor dem Methoden- aufruf wird der User injected, nach dem Methodenaufruf wird der Status wieder im Context gespeichert

Page 15: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SeamJPA Persistence Context

Was ist ein Persistence Context? eine Hashmap mit allen Objekten, die ich geladen oder

gespeichert haben möchte hält maximal ein In-Memory Objekt für jeden

Datenbankeintrag solange der Context aktiv ist ein natürlicher first-level Cache schreibt SQL so spät als nötig (automatisch oder händisch)

Der PC hat einen flexiblen Scope default: gleicher Scope wie die System Transaktion (JTA) extended: PC ist an das Stateful Session Bean gebunden

Page 16: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SeamModel based Verfication

Validierung auf der Benutzeroberfläche? Ja, aber Ergebnisse müssen dem Benutzer

wieder dargestellt werden Aber: normalerweise braucht man dieselbe

Validierung auch im Persistence Layerpublic @Entity class Item {

@Id @GeneratedValue Long id;

String name;

@Length(min=3,max=1000,message="Die Beschreibung muß zwischen 3 und 1000

Zeichen lang sein")String description;

Page 17: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Seam Zukunft

Web Beans (JSR-299) Auch in anderen Containern lauffähig Bookmarkable URLs Identity Management SSO Integration in JBoss Portal (inter-portlet communication)

http://www.seamframework.orghttp://portal.demo.jboss.com/ (Seam Portlet)

Page 18: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA Platform Service orientierte Plattform

Basiert auf JBossESB, Drools, JBossWS, JBossTS, JBoss Messaging and jBPM Läuft Standalone oder deployed im JBoss App Server

JBossESB ist der Verbinder Aufgrund der unterstützten Protokolle und Möglichkeiten ist es mehr ein "Internet Service Bus"

Unterstützt einen schrittweisen Ansatz Man muß am Anfang nicht alles Wissen um von der Architektur zu profitieren Wissen kann Schritt für Schritt aufgebaut werden

Page 19: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA PlatformTypische Aufgaben eines ESB:

Messaging Infrastruktur Process Orchestrattion, z.b. via WS-BPEL Protokoll Umsetzung Adapter Change management (Hot Deployment, Versionierung, Lifecycle Management) Fehlertoleranz Security Steuerung

Page 20: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA Platform

Page 21: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA PlatformServices und Messages

Alles innerhalb eines ESB ist ein Service Services interagieren über Messages

• Messages sind Teil des Contracts zwischen Client und Servcies

Messages sind nicht an spezifische Protokolle gebunden Services sind nicht an spezifische Protokollimplementierungen gebunden

• Email, S-FTP, JMS, File, etc,• Eigene Implementierungen können hinzugefügt werden

Page 22: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA PlatformAufbau einer Message

Page 23: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss SOA PlatformAction Pipeline

Page 24: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools JBoss IDE

• Opensource IDE seit 2001• JBoss AS, Hibernate, JBPM, Drools, FreeMarker und mehr

Exadel Studio• Commercial IDE seit 2004• JSF, Struts, Hibernate and more• Richfaces/Ajax4JSF framework

Red Hat geht im März 2007 Partnerschaft mit Exadel ein um die Produkte auf Opensource Schiene zu bringen

Page 25: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools 9 Monate später...

Page 26: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools Funktionen – Seam

• Seam Wizards• Hot deploy automatically setup• Validation of Seam constructs• EL understanding in java, pages.xml, etc.• Components.xml editor

Page 27: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools Funktionen – JSF Visual Editing

• Supports JSF, Facelets, HTML etc.• Includes and CSS stylings are honored• Rendering by a real browser engine (Mozilla)• EL expression completion incl. Seam components• OpenOn (F3) on expressions

Page 28: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools Funktionen – Hibernate

• Supports both hbm.xml and JPA• HQL/JPA-QL query and Criteria prototyping• Java inline query code completion and query validation• Mapping visualization• Reverse engineering from database schema• Flexible code generation

Page 29: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools Funktionen

• JBPM visual editing• Restart by ”Touch”• Struts 1.x• Project explorer navigation and direct editing

Page 30: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

JBoss Tools – Developer Studio

Page 31: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Portal – Portlet 2.0 Portlet 1.0 Spezifikation:

• Finalisiert im Oktober 2003

• Breite Anwendung (IBM, SAS, Oracle, usw.)

• Im Java EE Stack integriert, aber kein Teil davon

Page 32: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Portal – Portlet 2.0 Portlet 2.0 Spezifikation:

• Gestartet am 29. November 2005

• Leitung bei IBM

• Beteiligung von allen namhaften Portal Herstellern

• Mehr Info unter http://jcp.org/en/jsr/detail?id=286

• Final draft liegt im Moment bei der JCP (Java Community

Process)

Page 33: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Portal – Portlet 2.0 JBoss Portlet Container 2.0

Läuft unter jedem App Server

Public Render Parameter

Resource Serving (z.b. PDF, Office Docs, usw.)

Annotations

Portlet Filter

And many more...

Page 34: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Hibernate Search

“Frankly, search sucks on this project”-- Anonymous’ boss

Page 35: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Hibernate SearchUnder the Hibernate platform LGPL

Built on top of Hibernate Core

Use Apache Lucene(tm) under the hood In top 10 downloaded at Apache Very powerful Somewhat low level easy to use it the “wrong” way

Solve the mismatches

Page 36: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Hibernate Search

Page 37: 28.03.2008PFH-Technologie-Forum-2008 01 TECHNOLOGIE - FORUM 28. März 2008

28.03.2008 PFH-Technologie-Forum-200801

Fragen

?