+ All Categories
Home > Documents > Comp 260

Comp 260

Date post: 03-Jun-2018
Category:
Upload: koizak
View: 219 times
Download: 0 times
Share this document with a friend
44
8/12/2019 Comp 260 http://slidepdf.com/reader/full/comp-260 1/44
Transcript
Page 1: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 1/44

Page 2: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 2/44

Page 3: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 3/44

1. Enterprise Services2. Java EE 53. SAP NetWeaver Composition Environment4. Summary

Agenda

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 3

Page 4: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 4/44

© SAP 2008 / Page 4

The Approach: Service Oriented ArchitectureSOA is essential but missing business semantics

WEB SERVICES - SOA

Chaos

Manually builtNot guaranteed to workNo governance

Updatedatabase

Updateinventory

Check

ShipmentUpdateInvoicing

SendNotification

AdjustPlanning

NotifyS

uppliers

ENTERPRISE SOA

Integrity

Business semanticsProductizedUnified repository

UpdateOrder

UpdateOrder

Page 5: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 5/44

The Idea of Composition and Reusability

Consider the following three

food service processes:

PayTraditional Restaurant

Order Eat Pay

Fast Food Eat

Buffet

Sit Down Buffet Eat

Home Food Party Pay

Reusable business processes allow the same 3 processes,

assembled differently to support 6 different business models

Soup kitchen

Eat

Pay

Eat

Order

Order

Order

Order

Pay

Pay

Eat

Eat

© SAP 2008 / Page 5

Page 6: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 6/44

Page 7: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 7/44

The one and only defining platform forenterprise applications in the Java space

Java Enterprise Edition – What Is It?

A collection of technologies backedby an evolving standard

An umbrella on top of severalimportant individual standards

A programming model

A common mindset and adeveloper community

A standards body with governance

EJB, JPA, JAX-WS, JSF , …

Java EE blueprints and design patterns

Large, established eco system

J2EE 1.2, 1.3, 1.4, Java EE 5, …

JSR 58, JSR 151, JSR 244, …

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 7

Page 8: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 8/44

incremental enhancements

Releases of the Java Enterprise Edition

Sep 2001 Nov 2003 May 2006

J2EE 1.3JSP 1.2, EJB 2.0,

JCA 1.0, JMS 1.0.2,e.a.

J2EE 1.4JSP 2.0, EJB 2.1,JCA 1.5, JMS 1.1,

e.a.

Java EE 5JSP 2.1 / JSF 1.2,

EJB 3.0 / JPA,e.a.

EJB 3.0• object-persistence API• defined by annotations• simplified prog. model

JavaServer Faces• separating UI and code• reusable UI components• data binding / validation

supported inSAP NetWeaver ’04 and

SAP NetWeaver 7.0

supported in SAP NetWeaver Composition Environment 7.1

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 8

Specfinal:

Page 9: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 9/44

User InterfacesWeb Services XML

Updates in Java EE 5

JSTL 1.2Web ServicesMetadata

for the JavaPlatform

JSF 1.2

JSP 2.1

Debugging supportfor other languages

Common Annotations for the Java Platform

Servlet 2.5

JAXB 2.0

JAX-WS 2.0

SAAJ 1.3

StAX 1.0

Business Logic Database Access

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 9

EJB 3.0 Java Persistence API 1.0

Page 10: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 10/44

Page 11: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 11/44

Annotations: Standard feature of the Java language since J2SE 5.0

Dependency Injection: Programming pattern to hide the creation and lookup ofresources from the application‘s code

@EJB public ShoppingCart myCartBean;

@Resource protected UserTransaction ut;

@Resource private DataSource hrDB;

@PersistenceContext(unitName= “order”) EntityManager em;

@Resource public void setSessionContext (SessionContext ctx){this.ctx = ctx;

}

No more JNDIlookups!

No more XMLdescriptors!

Annotations and Dependency Injection

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 11

Page 12: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 12/44

Java EE 5: Simplification Example

J2EE 1.4: JNDI call, object creation, XML

try {

Context ctx = new InitialContext();MyBeanHome home = (MyBeanHome)ctx.lookup

(“ java:comp/env/ejb/myBean ”); MyBean myBean = home.create();

myBean.method(); } catch () {

...}...

<ejb-local-ref><ejb-ref-name>ejb/myBean</ejb-ref-name><ejb-ref-type>Session</ejb-ref-type><local-home>test.MyBeanHome</local-home><local>test.MyBean</local>

</ejb-local-ref>...

@EJB private MyBean myBean;...myBean.method();

...

web.xml

myServlet.java

myServlet.java

Example: Access to session bean from a servlet

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 12

Java EE 5

Page 13: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 13/44

EJB 3.0: Overview

EJB 3.0 Core JPA 1.0

Session and Message-Driven BeansTransactions

SecurityBusiness InterfacesInterceptors

Dependency Injection…

POJO PersistenceEntity Manager API

O/R MappingQuery Language (JPQL)Third-Party Persistence Providers

Java SE and EE…

Non-persistence material

improvements +simplification

package javax.ejb

Persistence

completely new

package javax.persistence

loosely coupled

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 13

EJB 3.0

Page 14: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 14/44

@Stateless public class HelloWorldBean implements HelloWorld {

public String sayHello(String name) {return "Hello " + name;

}

}

EJB 3.0: Simplified Bean Structure

POJI Business Interface – no need to extend EJB(Local)Object

POJO Bean Class – no need to implement SessionBean

No Home Interfaces anymore!

@Local public interface HelloWorld {

public String sayHello(String name);

}

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 14

Page 15: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 15/44

EJB 3.0: Interceptors

Intercept business method calls

Common logic for all / part of the business methods

@Stateless public class HelloWorldBean implements HelloWord {

public String sayHello(String name) {return "Hello " + name;

}

@AroundInvokepublic void profile(InvocationContext ctx) {

long begin = System.currentTimeMillis();try {

ctx.proceed();} finally {

long time = System.currentTimeMillis() – begin;

log(“Executed for ” + time + “ ms”); }

}

}

Delegates to the nextinterceptor or to the

bean method

Life cycle callback methods are interceptors too!

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 15

Page 16: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 16/44

EJB 3.0: Configuration by Exception

Configuration by exception is the main motto of EJB 3.0!

@Stateless public class SalesManagerBean implements SalesManager {

public String createCustomer(String name) {…

}

}

Assumed default values:EJB name: SalesManagerBean

Business interface: SalesManager

Transaction management type: Container

Transaction attribute: Required

Security permissions: PermitAll

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 16

Page 17: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 17/44

JPA – The New Java Persistence API

POJO persistence

Standardized object-relational mapping Unified object persistence for Java

JPA

JDBC DatabaseSAP NetWeaver CE 7.1

JDO

TopLinkHibernate

“JPA fills the gap”

EJBCMP

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 17

Open SQL for Java infrastructure

Page 18: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 18/44

Page 19: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 19/44

JPA: How Applications Control the State ofEntities

EntityManager Life cycle methods (persist, find, update, remove, merge, … )

Factory for QueriesIntegrated with EJB 3.0 Container-managed entity managers

@Stateless public class HRSessionBean {@PersistenceContext(unitName =“HR”) EntityManager em;

public void createEmployee(String name, Long id) {Employee employee = new Employee(name, id);em.persist(employee);

}}

Injection of acontainer-managed

entity manager

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 19

Page 20: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 20/44

Page 21: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 21/44

Web Services: Overview

Web-based applications

Computer-to-computer interactions in heterogeneous environments

Open XML-based standards and transport protocols

Java EE 5:

Simplified development of Web services and clients

Integrated Web services stack: JAXB 2.0 , JAX-WS 2.0 , …

Proxy

Web Service

UDDI

SOAP/XML

Search

WSDLClient

1

3

4

2

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 21

Page 22: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 22/44

Web Services: JAXB 2.0

JAXB = J ava Architecture for XML Binding

Makes XML processing easy for Java applications

XML world (schema, document) Java world (classes, instances)

JAXB mapped

classesSchema

ObjectsDocument

follows instances of

bind

unmarshal

marshal

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 22

Page 23: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 23/44

Page 24: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 24/44

Web Services: JAX-WS 2.0

JAX-WS = J ava API for XML-based Web S ervices

Makes Web services in Java easy to develop and use

Uses JAXB 2.0 for all data binding

Hides the complexity of SOAP messages

Server side: Web service operation = Java interface/class method

Client: invokes methods on a proxy object

Web Service

JAX-WS Runtime

Client

JAX-WS Runtime SOAP Message

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 24

Page 25: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 25/44

Page 26: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 26/44

1. Enterprise Services2. Java EE 53. SAP NetWeaver Composition Environment4. Summary

Agenda

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 26

Page 27: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 27/44

Process Components

SAP Applications

OrderMgmt. ...

Platform Components

SAP NetWeaver

Service & EventEnablement

Enterprise SOAProvisioning

Service-enabledApplications MDM BI …

Service & EventComposition

Enterprise SOAConsumption

UI Composition

InformationComposition

Enterprise SOA Technology withSAP NetWeaver

Business Process Composition &Management (BPM)

User

Interface Forms Portal Dashboards SAP GUI MobileBusinessClient

Duet

Connectivity &Integration

Non SAP &Legacy

Customer & PartnerApplications

B u s

i n e s s

P a r t n e r

Service Bus

SOA DesignGovernance

SOA Management

EnterpriseServices

SOA Middleware

© SAP 2008 / Page 27

Page 28: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 28/44

Java ApplicationServer

Robust, enterprise-class Java EE 5

application server

Eclipse DevelopmentEnvironment

SAP NetWeaverDeveloper Studio : Eclipse

based development andmodeling environment

SAP NetWeaver Composition Environment 7.1

P r o c e s s e s

Event FlowRole

Guided procedures(GP) for collaborativeprocessesSAP NetWeaverBPM

V i e w s

Portal and Web FormsMobile

and Voice Analytics

SAP NetWeaver VisualComposer for model-driven UI development

(incl. analytics and voice) Web Dynpro Java SAP Interactive Formsby Adobe Federated PortalNetwork

Enterprise ServicesRepository and Registry(ESR) Software lifecyclemanagement and

logistics (NWDI)

B u s

Dataor File

Web Services / EnterpriseServices Connectivity

S e r v

i c e s Service

façadeNew

service

DataserviceEnterprise

serviceBasicservice

SAP CompositeApplicationFramework (CAF)business objectmodeling and servicecomposition

© SAP 2008 / Page 28

Page 29: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 29/44

Enterprise Services Repository is ...

“… the central repository where service interfaces

and enterprise services are modeled and their metadata is stored. ”

Services Registry - UDDI V3compliant registry that supportspublishing, classifying anddiscovering services

Services Registry

ES Repository - The metadatarepository of all service objects forenterprise SOA

© SAP 2008 / Page 29

Page 30: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 30/44

Enterprise Services Repository and Registry

tbd

CONSUMERTOOLS

(SAP NetWeaverCompositionEnvironment)

DISCOVER

CONSUMERAPPLICATION

CONSUMER

PUBLISH

SERVICESREGISTRY

SERVICE MODELPUBLICATIONS

SERVICE ENDPOINTPUBLICATIONS

SERVICEIMPLEMENTATION

PROVIDER

GENERATE

ROUTINGMAPPINGMEDIATED

INVOCATION

Process integrationSERVICE

ENDPOINT

DIRECT CONNECTION

© SAP 2008 / Page 30

Page 31: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 31/44

© SAP 2008 / SAP TechEd 08 / COMP278 Page 31

EXERCISE 1

Page 32: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 32/44

Page 33: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 33/44

Page 34: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 34/44

© SAP 2008 / SAP TechEd 08 / COMP278 Page 34

EXERCISE 2

Page 35: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 35/44

Exercise 2 – Real World ProjectsHow do I Validate User Input and Return Errors?

© SAP 2008 / SAP TechEd 08 / <Session ID> Page 35

Page 36: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 36/44

Page 37: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 37/44

Summary

Enterprise Services are standardized both in terms of technology andsemantics.

Java EE 5 is THE enterprise application standard for Java. It incorporatesmajor changes and thus boosts developer productivity.

SAP NetWeaver Composition Environment supports you in leveragingEnterprise Services with Java EE 5 technologies.

Besides Java EE 5, SAP NetWeaver Composition Environment providesmodel-driven tools to ease your developments.

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 37

Page 38: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 38/44

R d d R di

Page 39: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 39/44

Recommended Reading

Jan Rauscher, Volker Stiehl

The Developer’s Guide to the

SAP NetWeaver CompositionEnvironment

http://www.sap-press.de/1671

ISBN 978-1-59229-171-7

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 39

Page 40: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 40/44

Page 41: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 41/44

F th I f ti

Page 42: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 42/44

Further Information

Related Workshops/Lectures at SAP TechEd 2008COMP160, Consuming Enterprise Services in Java EE 5 Applicationswith SAP NetWeaver CE, 2 Hr. Hands-on

Related SAP Education and Certification Opportunities

http://www.sap.com/education/

SAP Public Web:

SAP Developer Network (SDN): www.sdn.sap.com Java EE 5 Homepage: www.sdn.sap.com/irj/sdn/javaee5 Java EE 5 Forum: www.sdn.sap.com/irj/sdn/forum?forumID=229

© SAP 2008 / SAP TechEd 08 / COMP160 – Page 42

Page 43: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 43/44

Page 44: Comp 260

8/12/2019 Comp 260

http://slidepdf.com/reader/full/comp-260 44/44

Please complete your session evaluation.

Be courteous — deposit your trash,and do not take the handouts for the following session.

Thank You

Feedback


Recommended