Composite Applications with SOA, BPEL and Java EE


Published on

Published in: Technology
1 Comment
1 Like
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Composite Applications with SOA, BPEL and Java EE

  1. 1. Building CompositeApplications with SOA, BPELand Java EE Dmitri Shiryaev, Ph.D. Sun Microsystems
  2. 2. • Part 1 : :55 Min Approx • Part 2 : 50 Min• Intro to Applications / Services 2 min • Intro Service composition: 3 min• Intro SOA : 2 Min • CompApp/CAPS :2• Java 5 & Java EE Services: 2 min • Service Assembly/CASA : 2• Why NetBeans & Ent Pack : 2 Min • Binding components :2• BPEL :2 • services engines :2• Benefits using SOA : 2 Min • IEP :2• Summary : 2 Min • Gavotte/Hula features : 5 Min• Intro to BPEL designer : 2 • CASA Demo : 15 Min• XML editor :2 • Do not forget to mention about BPEL HOL.• WSDL editor :2 • Q&A : 7 Min• Runtime :3 • CASA demo : 25 Min• StockQuote Demo : 15 Min• Do not forget to mention about BPEL HOL.• Q&A : 7 Min (optional)
  3. 3. Goal Visualizing and developing Composite Applications using SOA and Java EE
  4. 4. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  5. 5. Applications• Developers need to build end-to-end applications > Front-end user interfaces > Middle-tier business logic > Back-end resources• With the right approach, developers can... > Reuse existing parts > Build new parts > Glue old and new parts together• With the wrong approach, developers must... > Reimplement functionality existing elsewhere > Spend massive effort to evolve applications
  6. 6. Applications• Real-world applications are... > Web applications > Java EE applications > Swing forms > Web services > BPEL processes > SOA > JBI > RDBMSs > (your favorite technology)• Real-world applications use many or all of these
  7. 7. Applications• Traditional model of application development > Point technologies, products, and APIs > For example: EJB, Spring, Hibernate, JSF, Servlets, Struts, etc. > Lots of glue written by developers > Requires a great deal of expertise & time > Inflexible
  8. 8. This is a complex world ! ChannelsPartners Customers Internal Users Suppliers • Inflexibility of IT Infrastructure • Complexity of Integration Projects $ $ $ • Integration Costs $ $$ $ $ • Time to Market $ $ $ $ • Limited Partnering Flexibility • Limitations of EDI $ $ $ $ $Inventory Provisioning Legacy CRM Billing Information Assets
  9. 9. Composite Applications• A way to compose applications from reusable parts• Comprised of heterogeneous parts > Some existing parts > Some new parts > Some glue to connect these parts• Composite applications are Applications! > Composite applications != SOA• Composite applications employ SOA principles > Features exposed as Web services > Standards-based interaction between services > Are themselves composable
  10. 10. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  11. 11. Service Oriented Architecture (SOA)• An architectural principle for structuring systems into coarse-grained services• Technology-neutral best practice• Emphasizes the loose coupling of services• New services are created from existing ones in a synergistic fashion• Strong service definitions are critical• Services can be re-composed when business requirements change
  12. 12. • Creating an IT environment to for SOA Business-IT Context support continuous business optimization• Structures your IT applications in line with your business processes – Speeds business change – Facilitates business connections – Enchances business control• Heavy focus on flexible interconnections with carefully managed qualities of service (QoS)
  13. 13. SOA and Web Services• Web services are most peoples first and only exposure to SOA• Only one manner of service access – Message-oriented middleware (MOM) – CORBA, RMI, DCOM, raw sockets, Email etc.• SOA architectures tend to be best implemented using web services as the middleware technology
  14. 14. Why Services?• SOA = an architectural principle for structuring systems• SOA emphasizes the de-coupling of system components• New services are created from existing ones in a synergistic fashion• Strong service definitions are critical• Services can be subsequently re-composed in response to changing business requirements
  15. 15. What Are Services?• Black-box components with well-defined interfaces > Performs some arbitrary function > Can be implemented in myriad ways• Accessed using XML message exchanges > Using well-known message exchange patterns (MEPs)• Services are self-describing• Metadata in the form of WSDL describes... > Abstract interfaces > Concrete endpoints
  16. 16. What Does a Service Do?• Transform data• Route messages• Query databases• Orchestrate conversations• Apply business logic• Apply business policy• Handle business exceptions• Solicit approvals• …
  17. 17. How Are Services Implemented?• Enterprise JavaBeans™ (EJB™) technology• BPEL• XSLT• SQL• Business rules• Mainframe transaction• EDI transform• Humans (yes, really!)• …
  18. 18. Guide to the SOA Galaxy You are here 3. JBI 2. BPEL 4. ESB 1. Intro 5.Java CAPS 6. The Answer To Everything
  19. 19. The 4Ps to achieve SOA People Process The Who? The What? SOA Platform Practice The Where? The How? Sun Microsystems Inc. Proprietary 19
  20. 20. Why SOA?We’re not building new, “green field” applications anymore• We buy applications whenever possible.• And, we leverage these new applications along with our existing inventory of application and data “assets”.• These are Composite Applications A composite application is a collection of existing applications and data stores, as well as new business logic, that is orchestrated together to create a solution to a business problem that none alone can solve.
  21. 21. An SOA can deliver the benefits of Functional DecompositionFunctional decomposition defines asystem in which each component isdescribed in terms of its own,independent functionality.A side effect is that the interfacesbetween components are well-definedahead of the implementation of thosecomponents.When a system is composed ofcomponents with discrete functionalityand well-defined interfaces, eachspecific implementation of acomponent becomes readilyinterchangeable with otherimplementations of that component.Consider a bicycle. You can buycomponents from different vendorsand these components can all bebolted together to create a bicycle thatfits your unique set of requirementsand preferences.
  22. 22. Benefits of SOA• Flexible (Agile) IT > Adaptable to changing business needs• Faster time to market > Reuse existing code > Minimize new development• Business- and process-driven > Enables new business opportunities• Greater ROI > Leverage existing IT assets
  23. 23. SOA Layers Access Layer Process Layer Service Layer Resource Layer
  24. 24. The “Move” to SOA Non- Integrated Integrated and Shared
  25. 25. The Shift• SOA is a combined effort between IT and the business units er SOA Proc Lay ess e Defi Layer rvic viderSe ro ner P IT Biz Units
  26. 26. Pre-SOA Scenario Credit Card Mortgage Balance Fraud Credit Credit Balance Interest Detection Check Check Check Calc CheckCustomer Back- Partner Partner Back- Customer End Credit Credit End Data Data System Data Data System
  27. 27. SOA-Enabled Scenario Auto Mutual Loans Bill Pay Stocks Funds Credit Card Mortgage Reusable Services Payment Trade Credit Fraud Access Interest Balance Customer Management Execution Check Detection Service Calc Check Data Service Service ServiceInternet Increased Agility Partner Credit Data Back-End System Back-End System Customer Data
  28. 28. SOA Architectural Big Rules Coarse GrainedBusiness Services Document-based Mostly Async Conversational Reliable Secure/Identity Policy Driven Registered and Retrieved WSDL Described BPEL Orchestrated JBI-based
  29. 29. n esig ed SOA Architectural Big Rules D us FocCoarse Grained Business Services XML Document-based Mostly Async Conversational
  30. 30. i es al i t edSOA Architectural Big Rules Qu us Foc Reliable Secure/Identity Policy Driven Registered and Retrieved
  31. 31. ds n dar dSOA Architectural Big Rules Sta cuse Fo WSDL Described BPEL Orchestrated JBI-based
  32. 32. Example: Purchase Service Bid Bid Request Request Lowest Bid Bid Buyer Purchase Supplier Service Accept/ Accept/ Reject Reject Ship Ship Notice Notice
  33. 33. Purchase Service Functions Buyer Supplier Endpoint Endpoint Buyer Supplier Conversation Conversation Transaction Fees Supplier Routing Supplier Selection Product Conversion Buyer Credit
  34. 34. Purchase Service Functions WS WS DL/ Buyer DL/ Supplier Soa Endpointp Soa Endpointp Buyer BPE Supplier BPE L Conversation L Conversation E JB Transaction Fees Rout ing T Supplier Routing abl e XQ Supplier uer y Selection XSL Product T Conversion R Buyerule Credit
  35. 35. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  36. 36. Java Platform, Enterprise Edition (Java EE)• A set of coordinated technologies and practices that enable solutions for developing, deploying, and managing multi-tier, server-centric applications. Building on Java Platform, Standard Edition (Java SE), Java EE adds the capabilities that provide a complete, stable, secure, and fast Java platform for the enterprise. Java EE significantly reduces the cost and complexity of developing and deploying multi-tier solutions, resulting in services that can be rapidly deployed and easily enhanced.
  37. 37. Java EE 5 Overview• Key development features > EJB 3.0 > Annotated “plain old Java object” (POJO) Web services > Powerful Java Persistence API (JPA) for O-R mapping > JAX-WS 2.0 and JAXB 2.0 > Samples and blueprints• Open ESB Starter Kit > Java Business Integration (JBI) runtime > BPEL service engine > SOAP-over-HTTP binding component• Sun Java System Application Server 9 PE (Glassfish)
  38. 38. Java EE Services• Use EJB 3.0 to develop standards-based worker services > Perform business logic > Access JDBC resources > Call other Web services, including BPEL processes > Transactional > Secure• JAX-WS 2.0 and JAXB 2.0 > Full support for XML Schema > Document-centric services• Call these services from BPEL processes
  39. 39. EJB 3.0 Example@Stateless()@WebService()public class LoanProcessor { @WebMethod public String processApplication(..., @WebParam(name="applicantAge") int applicantAge,...) { int MINIMUM_AGE_LIMIT = 18; int MAXIMUM_AGE_LIMIT = 65; String result = "Loan Application APPROVED." if (applicantAge < MINIMUM_AGE_LIMIT) { result = "Loan Application REJECTED - Reason: Under-aged "+applicantAge+". Age needs to be "+ over"+MINIMUM_AGE_LIMIT+" years to qualify."; return result; } ... }}
  40. 40. J2EEby1.4 Web ServiceCode Written Developer / Deployer <?xml version=1.0 encoding=UTF-8 ?> package endpoint; <webservices xmlns= version=1.1> import java.rmi.*; <webservice-description> <webservice-description-name> public class HelloServiceImpl HelloService</webservice-description-name> implements HelloServiceSEI { <wsdl-file> WEB-INF/wsdl/HelloService.wsdl</wsdl-file> public String sayHello(String <jaxrpc-mapping-file> WEB-INF/HelloService-mapping.xml param) throws </jaxrpc-mapping-file> java.rmi.RemoteException { <port-component xmlns:wsdl-port_ns=urn:HelloService/wsdl> <port-component-name>HelloService</port-component-name> return “Hello “ + param; <wsdl-port>wsdl-port_ns:HelloServiceSEIPort</wsdl-port> } <service-endpoint-interface> endpoint.HelloServiceSEI</service-endpoint-interface> } <service-impl-bean> <servlet-link>WSServlet_HelloService</servlet-link> </service-impl-bean> package endpoint; </port-component> import java.rmi.*; </webservice-description> </webservices> public interface HelloServiceSEI extends java.rmi.Remote <?xml version=1.0 encoding=UTF-8 ?> { <configuration xmlns=> <service name=HelloService targetNamespace=urn:HelloService/wsdl public String sayHello(String param) typeNamespace=urn:HelloService/types packageName=endpoint> <interface name=endpoint.HelloServiceSEI throws servantName=endpoint.HelloServiceImpl> java.rmi.RemoteException; </interface> } </service> </configuration>
  41. 41. WebService in Java EE 5.0 import javax.jws.WebService; @WebService public class MySimpleWS { public String sayHello(String s) { return “Hello “ + s; } }
  42. 42. EJB References in Java EE 5Context initial = new InitialContext();Context myEnv = (Context) initial.lookup("java:comp/env");Object objref = myEnv.lookup("ejb/SimpleConverter");ConverterHome home = (ConverterHome) PortableRemoteObject.narrow J2EE 1.4 (objref, ConverterHome.class);Converter currencyConverter = home.create(); Java EE 5@EJB Converter currencyConverter;
  43. 43. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  44. 44. Business Processes• Any technology for implementing real-world business processes needs to... > Coordinate asynchronous communication between services > Correlate message exchanges between partners > Exchange messages in a universal form > Process activities in parallel > Manipulate/transform data between partners > Support long-running business transactions > Handle exceptions > Provide compensation to undo previous actions
  45. 45. What is BPEL?• BPEL = Business Process Execution Language > XML-based language used to specify business processes based on Web services > Orchestrates partner Web services• BPEL processes describe... > Long-running, stateful, transactional conversations• BPEL is one language for implementing a service > A BPEL service is itself a WSDL-described service > Can be used from other services or BPEL processes like any other Web service• BPEL processes are easy to write and change
  46. 46. BPEL: Relationship to Partners WSDL Partner Service Partner ServicePartner Service Orchestrating Process (BPEL) Partner Service
  47. 47. BPEL: Relationship to Partners WSDL Inventory Checker Service Credit checker ServiceCustomer Service Orchestrating Process Another Partner (BPEL) Service
  48. 48. BPEL Document Structure<process> <partners> ... </partners> <variables> ... </variables> <correlationSets> ... </correlationSets> <faultHandlers> ... </faultHandlers> <eventHandlers> ... </eventHandlers> <!-- Business process implementation here --> <receive> ... </receive> <reply> ... </reply> <invoke> ... </invoke></process>
  49. 49. BPEL “Fixes” WSDL• WSDL describes an unordered set of operations > Operations are grouped as interfaces > Operations are individual message exchanges• Semantics of the interface are missing in WSDL > Order of invocation > Concurrency > Choreography with external entities• BPEL can supply these missing semantics
  50. 50. Web Service Orchestration● Visually author BPEL 2.0 business processes with the BPEL Designer ● Step-through debugging support ● Built-in testing capability for unit testing ● “Beyond syntax” validation of Schema, WSDL, and BPEL● BPEL Mapper ● Visually create complex XPath expressions without coding● Deploy to the built-in BPEL engine ● JBI-based BPEL service engine + SOAP/HTTP bindings ● Running within the bundled Sun Java System Application Server
  51. 51. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  52. 52. Recap• SOA enables flexible and agile enterprise application architecture• Services can be created and used using Java EE• BPEL is a service orchestration language for creating composite applications• Services can be re-implemented using other technologies as long as service interfaces are preserved without changing consumers• Tools for BPEL (using BPMN) and services are critical
  53. 53. Agenda • Composite Applications • Services and SOA • Java EE Services • BPEL in the Mix • Recap • Demo
  54. 54. Stock Quote Demo Currency Exchange Service Stock Quote Stock Quote BPEL Logic Client Client Stock Price Service
  55. 55. NetBeans Enterprise Pack 5.5● Support for composite applications● Design BPEL business processes to orchestrate: ● Java EE Web services ● External Web services ● Other BPEL processes● Develop secure, identity-enabled Java EE Web services● Visualize, analyze, and edit real-world XML Schema, WSDL, and XML instance documents● Download:
  56. 56. Agenda : Part 2 • Introduction to Service composition • Composite Applications / CAPS • Java Business Integration • Service Assembly / CASA Tools • IEP, CASA, WSDL Editor Demo
  57. 57. Silos driven Architecture (SdA) Field Order Accounts Service Scheduling Processing Management Check Check Calculate Customer Status Customer Status Shipping Charges Determine Product Determine Product Order Status Availability Availability Monolithic Verify Verify Applications Customer Credit Customer Credit Order Status Data Repository Custom AS400 Legacy Oracle Red Prairie Another ExternalMarketing Sales CRM Finance Warehouse Business Trading System System System System Mgmt. System Unit Partner
  58. 58. Problems with Legacy Apps (SdA)• Difficult to maintain• Expensive to maintain• Interfaces are rigid not flexible• Small changes/ Update will have major impact• Problems in Integration with other systems
  59. 59. Agenda : Part 2 • Introduction to Service composition • Composite Applications / CAPS • Java Business Integration • Service Assembly / CASA Tools • IEP, CASA, WSDL Editor Demo
  60. 60. Composite Applications• A composite application combines existing packaged and legacy applications, information stores, and newly developed services into a single solution. > May look like a new application even though it may be 10% new and 90% an assembly of existing components 
  61. 61. Composite Applications Benefits• Lower cost > Less maintenance on legacy and packaged applications• Business agility > No delay in modification of business parameters by IT• Ease of use > Modern UI for legacy and packaged applications
  62. 62. Composite ApplicationExample: Relevant business logic from legacy and packagedapplications is made accessible to business owners through Modern Web BPM Existing Interface Applications Legacy gic ne s s Lo System Busi Busi ness Logi c SAP System
  63. 63. Composite Application – SOA based Field Order Submit Manage Service Accounts Change Exception Personalized Processing Management Service Scheduling Order Orders Shared Services – Composite Apps – Increased Functionality Check Check Check Create Check Credit Order Status InvoiceCustomer Status Inventory Data Repository Custom AS400 Legacy Oracle Red Prairie Another External Marketing Sales CRM Finance Warehouse Business Trading System System System System Mgmt. System Unit Partner
  64. 64. SOA and Composite Applications Business services are composed into composite applications Composite Applications Field Service Scheduling Order Accounts Management Processing Composed Business Installation Scheduling Process Customer Order View Revenue Bill Service Presentment/Payment Process Elemental Business Services Check Verify Customer Look-up Determine Calculate Customer Product Status Credit Customer Discount Shipping Charges Availability Existing Systems Custom AS400 Sales Siebel CRM Oracle Red Prairie Another ExternalMarketing System System Finance Warehouse Business Trading System System Mgt System Unit Partner Sun Microsystems Inc. Proprietary 64
  65. 65. Moving from Monolithic, closed applications tostandardized service oriented architecture Accidental Rigid Silo-Oriented Layered Extensible Service-Oriented
  66. 66. Java Enterprise System People SOA Process Platform Practice A Complete Business Integration Platform Traditional Client Mobile Client ● Sun Ray, Star/OpenOffice, ● Java ME JDS Secure Global ● Java Card Desktop Data Center Management Java Enterprise System Composite NetBeans Application Platform Management Community Availability Identity Application Platform B2B Web ESB Infrastructure
  67. 67. What is Open ESB ?Suns Open Source Enterprise Service Bus• A standard, distributed integration infrastructure• Highly distributed scalable JBI services• Uses JBI Reference Implementation code• Based on MOM—async XML message exchanges• Centralized management• Standard deployment of composite services• QOS characteristics
  68. 68. Java Business Integration - JSR 208• Foundation for Service Oriented Architecture• Component Standard > Service providers > Service consumers• Components from multiple sources are: > Portable > Manageable > Interoperable
  69. 69. Java Business Integration (JSR 208) XQuery WS WS SoaDL/ SoaDL/ p p Install BPE BPE Rules Process JavaEE L LEJB Deploy Rou NMR Tab ting XQ le uer y XSL Xform Soap Route MOM Rul T e JBI Composite Service
  70. 70. Runtime: Java EE Platformand Java Business Integration• Java Business Integration serves as messaging infrastructure > Java EE web services interact through Java Business Integration > Java Business Integration bindings allow remote consumers and providers > Add other service technologies as Java Business Integration components• Transparent to programmer using Java EE technology > Reuse without re-coding
  71. 71. Agenda : Part 2 • Introduction to Service composition • Composite Applications / CAPS • Java Business Integration • Service Assembly / CASA Tools • IEP, CASA, WSDL Editor Demo
  72. 72. JBI and ESBs
  73. 73. OpenESB Functionality• Current Release: • Under Development: > AS 9 / GlassFish > IEP (BAM) SE > BPEL SE > ETL SE > XSLT SE > SQL SE > JavaEE SE > MQSeries BC > HTTP BC > HL7 BC > JMS BC > SAP BC > File BC > SMTP BC Current release targeted at Developers Sun to freeze a supported version in April 2007 - similar to the Glassfish -> Sun AppServer relationship
  74. 74. OpenESB and Appserver 9• Appserver 9: > Host for administration of the ESB > Host for each node of the ESB > JavaEE Service Engine
  75. 75. Intelligent Event Processor(Business Activity Monitoring) Streamed Stored Register Result Result Query IEPInput streams Archive Scratch Store Stored Data
  76. 76. Secure Service Creation• Secure Java EE Web service development > Message-level security for Web service clients and providers > J2EE 1.4 and Java EE 5 > Support provided by the bundled Sun Java System Access Manager > Easy installation of runtime components• Both WSI-BSP and Liberty token profile support > SAML, X.509, Username/password
  77. 77. Agenda : Part 2 • Introduction to Service composition • Composite Applications / CAPS • Java Business Integration • Service Assembly / CASA Tools • IEP, CASA, WSDL Editor Demo
  78. 78. NetBeans Enterprise Pack 5.5.1 / 6.0• Visual Service Assembly (CASA)• Visual Intelligent Event Processor (IEP/BAM)• Visual Editor for Continuos Query Language (CQL)• Visual Web Service Definition Language (WSDL) Editor• Service engines integrated > BPEL, IPE, SQL and XSLT• Binding components integrated > File, FTP, HTTP, JDBC, JMS, MQ and SMTP
  79. 79. CASA Editor
  80. 80. Intelligent Event Processor (IEP)
  81. 81. WSDL Editor
  82. 82. WSDL Editor – Partner Link Type
  83. 83. Agenda : Part 2 • Introduction to Service composition • Composite Applications / CAPS • Java Business Integration • Service Assembly / CASA Tools • IEP, CASA, WSDL Editor Demo
  84. 84. Demo• IEP Demo• CASA Demo• WSDL Editor Demo
  85. 85. Services for Developers• Sun Developer Forums – Community & Sun. > > alias• Incident support for Java, Developer Tools and Solaris > For as little as $99 get answers to your programming questions• Sun Software Services Plans for Developer Tools > Unlimited incidents, bugs and escalations, telephone support > 5x12 or 7x24 worldwide• Sun Developer Service Plans for Java and Developer Tools > Get how-to incident help, Unlimited bugs/escalation, telephone support and Sun Training credits > 5x12 or 7x24 worldwide
  86. 86. Services for Developers (contd.)• Java MultiPlatform – 7x24 Enterprise Java Support for OpenSolaris, Linux, Windows and MacOS > Get your run-time Java issues addressed in the release you want to use > Comprehensive run time support for your Java deployment environment•• Training and Certification >
  87. 87. Call to Action!• Download NetBeans 5.5.1 Beta•• NetBeans 5.5.1 Release Information• Join Sun Developer Network (SDN) for up-to- date SOA information:
  88. 88. Resources•••••
  89. 89. Blogs• Prakash Narayan:• PCM Reddy:• Chris Webster:• Sherry Barkodar:• Gopalan Raj:
  90. 90. Q&A• Questions?
  91. 91. Thank you !Dmitri Chiriaev