SlideShare uma empresa Scribd logo
1 de 30
Data Binding Unleashed for Composite Applications Raymond Feng LucianoResende Apache Tuscany committer  Shutterfly Inc.
Agenda Introduction Data binding SCA Composite application Apache Tuscany project Data bindings in a composite application Tuscany data binding framework Extending Tuscany data binding framework
IntroductionUnderstanding the concepts: Data binding and SCA composite application
What’s a data binding? A data binding (in this talk) denotes how business data are represented in memory as Java objects. For example, we can represent a customer as: JavaBean (customer.Customer) JAXB (customer.Customer) SDO (DataObject or customer.Customer) StAXXMLStreamReader DOM Node (org.w3c.dom.Node) XML String/byte[]/InputStream JSON String/byte[]/InputStream org.json.JSONObject … The same information with different representations JAXB JavaBean Customer Id lastName firstName … DOM JSON InputStream
SCA composite application SCA (Service Component Architecture, being standardized at OASIS) Composite (a collection of collaborating components) Component (encapsulation of reusable business logic) Implementation (the code/script) Service (the function it provides) Interface Binding (how is the service exposed) Reference (the function it consumes) Interface Binding (how is the service accessed)
What is Apache Tuscany? Apache Tuscany (http://tuscany.apache.org) implements Service Component Architecture (SCA) standard. With SCA as it's foundation, Tuscany offers solution developers the following advantages:  Provides a model for creating composite applications by defining the services in the fabric and their relationships with one another. The services can be implemented in any technology. Enables service developers to create reusable services that only contain business logic. Protocols are pushed out of business logic and are handled through pluggable bindings. This lowers development cost. Applications can easily adapt to infrastructure changes without recoding since protocols are handled via pluggable bindings and quality of services (transaction, security) are handled declaratively. Existing applications can work with new SCA compositions. This allows for incremental growth towards a more flexible architecture, outsourcing or providing services to others.
Data bindings in a composite applicationModeling, representing and flowing data across components and protocols
A simple scenario Two SCA components: Payment and CreditCardPayment (Payment calls CreditCardPayment to authorize credit card charges) Two developers: Bob and Mary Payment communicates with CreditCardPayment using SOAP/HTTP web service The Payment component will be exposed as a JSON-RPC service
The SCA composite file <composite xmlns=“http://docs.oasis-open.org/ns/opencsa/sca/200912” xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://tuscanyscatours.com/" name=”Store”>     <component name="Payment">         <implementation.java class="com.tuscanyscatours.payment.impl.PaymentImpl" />         <service name="Payment">             <tuscany:binding.jsonrpcuri="http://localhost:8080/Payment" />        </service> 	<reference name="creditCardPayment">             <binding.wsuri="http://localhost:8080/CreditCardPayment" />         </reference> </component>     <component name="CreditCardPayment">         <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CreditCardPaymentImpl" />         <service name="CreditCardPayment"> 	<binding.wsuri="http://localhost:8080/CreditCardPayment" />        </service>     </component> </composite>
Interface and data modeling Bob and Mary first agree on what data needs to be exchanged between the two components The agreement is then described as an interface (which in turn references the data types) The interface becomes the key contract between the SCA reference and service that are wired together The interfaces can be described using different IDLs such as WSDL (w/ XSD) or Java interface Interface compatibility  Things to consider: efficiency, simplicity, remotablity and interoperability.
Sample interfaces JAX-WS w/ JAXB (annotations omitted…): public interface CreditCardPayment { 	String authorize(JAXBCreditCardDetailsTypecreditCard,  float amount); } SDO: public interface CreditCardPayment { 	String authorize(SDOCreditCardDetailsTypecreditCard,  float amount); }
How are data represented in a composite application? Component implementations Business logic needs to consume/produce data in a representation it supports Handling incoming service calls Calling other services Receiving property values Certain implementation containers impose the data representations (such as DOM for Apache ODE BPEL) Protocol stacks behind the bindings Protocol stacks need to marshal/unmarshal data Internal data representation  Wire format (XML, JSON, binary, etc)
Data representations between two components at runtime
The reality check Enforcing one data binding is not flexible or even not feasible Components can be implemented using different technologies which could impose the data binding requirements, for example, a BEPL engine may require DOM Components may choose to use different data bindings to represent the business data (input/output/fault), for example, JAXB vs. SDO for the XML manipulations.  Service providers or consumers are decoupled and it is impossible to have a fixed data binding A service can serve different consumers that can only handle certain data bindings natively The service providers for a given consumer can be replaced The same service can be accessed over different protocols with different data bindings
Data transformation Data transformations are required to get two components talk to each other Having application code to deal with technological data transformation is a nightmare and it will defeat the whole purpose and promise of SCA
Tuscany’s data binding frameworkIntrospect/transform data without application coding
What does the framework need to figure out? Understand the data binding requirements at different places for the data flow Transform the data from one data binding to the other transparently without the interventions from the application developers Separate the data transformation/marshaling/unmarshaling from the business logic
Data type introspection Marker interface commonj.sdo.DataObject, org.w3c.dom.Node Annotations JAXB annotations What information is captured? Java class Java generic type Logic type (XML element/type, Mime types, etc)
The magic behind the scenes
Transformation paths Types of transformations Unmarshal/Deserialize ( InputStream Object ) Marshal/Serialize ( Object OutputStream ) Convert/Transform ( Object  Object) Direct vs. Multi-hops JAXB DOM JAXB  DOM  SDO Weight of a transformation Private vs. Public Some data bindings are not good as intermediaries (data round-trip issues)
The complete data flow Customer data come in JSON from HTTP requests The JSON data is unmarshaled into JAXB for the Payment code to consume Payment passes CreditCard (JAXB) to the reference binding layer which in turn converts JAXB into AXIOM The service binding layer unmarshals the XML data into AXIOM and transform it into SDO for the CreditCardPayment The response path is reverse for the data transformations
Data bindings out of the box DOM JAXB (JavaBeans are treated as JAXB) SDO JSON StAX …
Data bindings for RESTful servicesIntegrating with JAX-RS entity providers
JAX-RS entity providers Entity providers supply mapping services between representations and their associated Java types.  Entity providers come in two flavors:  MessageBodyReader MessageBodyWriter
Tuscany’s generic entity providers based on the data binding framework  JAX-RS runtime (such as Apache Wink) Tuscany data binding framework Entity Providers Entity Providers Message Writer Message Reader Entity (JAXB, SDO, DOM, etc) InputStream OutputStream
Extending the data binding frameworkSupport your favorite data bindings
The DataBinding SPI public interface DataBinding { String getName(); booleanintrospect(DataTypedataType, Operation operation); DataTypeintrospect(Object value, Operation operation); WrapperHandlergetWrapperHandler(); Object copy(Object object, DataTypesourceDataType, DataTypetargetDataType, Operation sourceOperation, Operation targetOperation); XMLTypeHelpergetXMLTypeHelper(); }
The Transformer SPI public interface PullTransformer<S, R> extends Transformer { R transform(S source, TransformationContext context); } public interface PushTransformer<S, R> extends Transformer { void transform(S source, R sink, TransformationContext context); }
Registering your data bindings/transformers META-INF/services/org.apache.tuscany.sca.databinding.DataBinding org.apache.tuscany.sca.databinding.xml.DOMDataBinding;name=org.w3c.dom.Node META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader;source=org.w3c.dom.Node,target=javax.xml.stream.XMLStreamReader,weight=80 META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer org.apache.tuscany.sca.databinding.xml.Node2OutputStream;source=org.w3c.dom.Node,target=java.io.OutputStream,weight=80
Q&AFind more details from:Chapter 9 of Tuscany In SCA Actionhttp://www.manning.com/laws/Save 40% at manning.com.Enter “javaone2010” in the promotional code box at check out.

Mais conteúdo relacionado

Mais procurados

Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technologysanjoysanyal
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIRajkattamuri
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDITUSHAR VARSHNEY
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesIMC Institute
 
How to process Flat Files documents (TXT, CSV …) in BizTalk Server
How to process Flat Files documents (TXT, CSV …) in BizTalk ServerHow to process Flat Files documents (TXT, CSV …) in BizTalk Server
How to process Flat Files documents (TXT, CSV …) in BizTalk ServerSandro Pereira
 
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...Eyal Doron
 
Presentation
PresentationPresentation
PresentationVideoguy
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshSiddhesh Bhobe
 
Cloud computing 20 service modelling
Cloud computing 20 service modellingCloud computing 20 service modelling
Cloud computing 20 service modellingVaibhav Khanna
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comphanleson
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications developmentSynapseindiappsdevelopment
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 

Mais procurados (20)

Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
Web services
Web servicesWeb services
Web services
 
Java web services
Java web servicesJava web services
Java web services
 
Description of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDIDescription of soa and SOAP,WSDL & UDDI
Description of soa and SOAP,WSDL & UDDI
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
WSDL 2.0 and Apache Woden
WSDL 2.0 and Apache WodenWSDL 2.0 and Apache Woden
WSDL 2.0 and Apache Woden
 
How to process Flat Files documents (TXT, CSV …) in BizTalk Server
How to process Flat Files documents (TXT, CSV …) in BizTalk ServerHow to process Flat Files documents (TXT, CSV …) in BizTalk Server
How to process Flat Files documents (TXT, CSV …) in BizTalk Server
 
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...
The importance of Exchange 2013 CAS in Exchange 2013 coexistence | Part 1/2 |...
 
Presentation
PresentationPresentation
Presentation
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
 
BizTalk Server- Schema
BizTalk Server-  SchemaBizTalk Server-  Schema
BizTalk Server- Schema
 
Web services
Web servicesWeb services
Web services
 
Web Services ppt
Web Services pptWeb Services ppt
Web Services ppt
 
Xml schema
Xml schemaXml schema
Xml schema
 
Cloud computing 20 service modelling
Cloud computing 20 service modellingCloud computing 20 service modelling
Cloud computing 20 service modelling
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.com
 
Webservices
WebservicesWebservices
Webservices
 
SynapseIndia dotnet web applications development
SynapseIndia  dotnet web applications developmentSynapseIndia  dotnet web applications development
SynapseIndia dotnet web applications development
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 

Semelhante a Data Binding Unleashed for Composite Applications

The Story of How an Oracle Classic Stronghold successfully embraced SOA
The Story of How an Oracle Classic Stronghold successfully embraced SOAThe Story of How an Oracle Classic Stronghold successfully embraced SOA
The Story of How an Oracle Classic Stronghold successfully embraced SOALucas Jellema
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsLucas Jellema
 
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...Lucas Jellema
 
Automated Syntactic Mediation for Web Service Integration
Automated Syntactic Mediation for Web Service IntegrationAutomated Syntactic Mediation for Web Service Integration
Automated Syntactic Mediation for Web Service IntegrationMartin Szomszor
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Igor Moochnick
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaLucas Jellema
 
jkljklj
jkljkljjkljklj
jkljkljhoefo
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg frameworkYousuf Roushan
 
Building apps with tuscany
Building apps with tuscanyBuilding apps with tuscany
Building apps with tuscanyLuciano Resende
 
Strata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyStrata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyBen Stopford
 
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...confluent
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleEmiliano Pecis
 
Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Ben Stopford
 
The Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and ServicesThe Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and Servicesconfluent
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
Service Oriented Architecture Updated Luqman
Service Oriented Architecture Updated  LuqmanService Oriented Architecture Updated  Luqman
Service Oriented Architecture Updated Luqmanguesteb791b
 
Lecture 16 - Web Services
Lecture 16 - Web ServicesLecture 16 - Web Services
Lecture 16 - Web Servicesphanleson
 

Semelhante a Data Binding Unleashed for Composite Applications (20)

The Story of How an Oracle Classic Stronghold successfully embraced SOA
The Story of How an Oracle Classic Stronghold successfully embraced SOAThe Story of How an Oracle Classic Stronghold successfully embraced SOA
The Story of How an Oracle Classic Stronghold successfully embraced SOA
 
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database ProfessionalsIntroducing SOA and Oracle SOA Suite 11g for Database Professionals
Introducing SOA and Oracle SOA Suite 11g for Database Professionals
 
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
 
Automated Syntactic Mediation for Web Service Integration
Automated Syntactic Mediation for Web Service IntegrationAutomated Syntactic Mediation for Web Service Integration
Automated Syntactic Mediation for Web Service Integration
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
Modern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas JellemaModern Database Development Oow2008 Lucas Jellema
Modern Database Development Oow2008 Lucas Jellema
 
jkljklj
jkljkljjkljklj
jkljklj
 
Overview of atg framework
Overview of atg frameworkOverview of atg framework
Overview of atg framework
 
Web services SOAP Notes
Web services SOAP NotesWeb services SOAP Notes
Web services SOAP Notes
 
Building apps with tuscany
Building apps with tuscanyBuilding apps with tuscany
Building apps with tuscany
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Strata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data DichotomyStrata Software Architecture NY: The Data Dichotomy
Strata Software Architecture NY: The Data Dichotomy
 
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...
Kafka Summit NYC 2017 - The Data Dichotomy: Rethinking Data and Services with...
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy Event Driven Services Part 1: The Data Dichotomy
Event Driven Services Part 1: The Data Dichotomy
 
The Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and ServicesThe Data Dichotomy- Rethinking the Way We Treat Data and Services
The Data Dichotomy- Rethinking the Way We Treat Data and Services
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Service Oriented Architecture Updated Luqman
Service Oriented Architecture Updated  LuqmanService Oriented Architecture Updated  Luqman
Service Oriented Architecture Updated Luqman
 
Lecture 16 - Web Services
Lecture 16 - Web ServicesLecture 16 - Web Services
Lecture 16 - Web Services
 
Json
JsonJson
Json
 

Mais de Raymond Feng

Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack ModelsRaymond Feng
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesRaymond Feng
 
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...Raymond Feng
 
RESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRaymond Feng
 
Apache Tuscany 2.x Extensibility And SPIs
Apache Tuscany 2.x Extensibility And SPIsApache Tuscany 2.x Extensibility And SPIs
Apache Tuscany 2.x Extensibility And SPIsRaymond Feng
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyRaymond Feng
 
OSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyOSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyRaymond Feng
 

Mais de Raymond Feng (7)

Working with LoopBack Models
Working with LoopBack ModelsWorking with LoopBack Models
Working with LoopBack Models
 
Building a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 MinutesBuilding a Node.js API backend with LoopBack in 5 Minutes
Building a Node.js API backend with LoopBack in 5 Minutes
 
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
 
RESTful SCA with Apache Tuscany
RESTful SCA with Apache TuscanyRESTful SCA with Apache Tuscany
RESTful SCA with Apache Tuscany
 
Apache Tuscany 2.x Extensibility And SPIs
Apache Tuscany 2.x Extensibility And SPIsApache Tuscany 2.x Extensibility And SPIs
Apache Tuscany 2.x Extensibility And SPIs
 
OSGi Enablement For Apache Tuscany
OSGi Enablement For Apache TuscanyOSGi Enablement For Apache Tuscany
OSGi Enablement For Apache Tuscany
 
OSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache TuscanyOSGi Remote Services With SCA using Apache Tuscany
OSGi Remote Services With SCA using Apache Tuscany
 

Último

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Último (20)

Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate AgentsRyan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
Ryan Mahoney - Will Artificial Intelligence Replace Real Estate Agents
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Data Binding Unleashed for Composite Applications

  • 1. Data Binding Unleashed for Composite Applications Raymond Feng LucianoResende Apache Tuscany committer Shutterfly Inc.
  • 2. Agenda Introduction Data binding SCA Composite application Apache Tuscany project Data bindings in a composite application Tuscany data binding framework Extending Tuscany data binding framework
  • 3. IntroductionUnderstanding the concepts: Data binding and SCA composite application
  • 4. What’s a data binding? A data binding (in this talk) denotes how business data are represented in memory as Java objects. For example, we can represent a customer as: JavaBean (customer.Customer) JAXB (customer.Customer) SDO (DataObject or customer.Customer) StAXXMLStreamReader DOM Node (org.w3c.dom.Node) XML String/byte[]/InputStream JSON String/byte[]/InputStream org.json.JSONObject … The same information with different representations JAXB JavaBean Customer Id lastName firstName … DOM JSON InputStream
  • 5. SCA composite application SCA (Service Component Architecture, being standardized at OASIS) Composite (a collection of collaborating components) Component (encapsulation of reusable business logic) Implementation (the code/script) Service (the function it provides) Interface Binding (how is the service exposed) Reference (the function it consumes) Interface Binding (how is the service accessed)
  • 6. What is Apache Tuscany? Apache Tuscany (http://tuscany.apache.org) implements Service Component Architecture (SCA) standard. With SCA as it's foundation, Tuscany offers solution developers the following advantages: Provides a model for creating composite applications by defining the services in the fabric and their relationships with one another. The services can be implemented in any technology. Enables service developers to create reusable services that only contain business logic. Protocols are pushed out of business logic and are handled through pluggable bindings. This lowers development cost. Applications can easily adapt to infrastructure changes without recoding since protocols are handled via pluggable bindings and quality of services (transaction, security) are handled declaratively. Existing applications can work with new SCA compositions. This allows for incremental growth towards a more flexible architecture, outsourcing or providing services to others.
  • 7. Data bindings in a composite applicationModeling, representing and flowing data across components and protocols
  • 8. A simple scenario Two SCA components: Payment and CreditCardPayment (Payment calls CreditCardPayment to authorize credit card charges) Two developers: Bob and Mary Payment communicates with CreditCardPayment using SOAP/HTTP web service The Payment component will be exposed as a JSON-RPC service
  • 9. The SCA composite file <composite xmlns=“http://docs.oasis-open.org/ns/opencsa/sca/200912” xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://tuscanyscatours.com/" name=”Store”> <component name="Payment"> <implementation.java class="com.tuscanyscatours.payment.impl.PaymentImpl" /> <service name="Payment"> <tuscany:binding.jsonrpcuri="http://localhost:8080/Payment" /> </service> <reference name="creditCardPayment"> <binding.wsuri="http://localhost:8080/CreditCardPayment" /> </reference> </component> <component name="CreditCardPayment"> <implementation.java class="com.tuscanyscatours.payment.creditcard.impl.CreditCardPaymentImpl" /> <service name="CreditCardPayment"> <binding.wsuri="http://localhost:8080/CreditCardPayment" /> </service> </component> </composite>
  • 10. Interface and data modeling Bob and Mary first agree on what data needs to be exchanged between the two components The agreement is then described as an interface (which in turn references the data types) The interface becomes the key contract between the SCA reference and service that are wired together The interfaces can be described using different IDLs such as WSDL (w/ XSD) or Java interface Interface compatibility Things to consider: efficiency, simplicity, remotablity and interoperability.
  • 11. Sample interfaces JAX-WS w/ JAXB (annotations omitted…): public interface CreditCardPayment { String authorize(JAXBCreditCardDetailsTypecreditCard, float amount); } SDO: public interface CreditCardPayment { String authorize(SDOCreditCardDetailsTypecreditCard, float amount); }
  • 12. How are data represented in a composite application? Component implementations Business logic needs to consume/produce data in a representation it supports Handling incoming service calls Calling other services Receiving property values Certain implementation containers impose the data representations (such as DOM for Apache ODE BPEL) Protocol stacks behind the bindings Protocol stacks need to marshal/unmarshal data Internal data representation Wire format (XML, JSON, binary, etc)
  • 13. Data representations between two components at runtime
  • 14. The reality check Enforcing one data binding is not flexible or even not feasible Components can be implemented using different technologies which could impose the data binding requirements, for example, a BEPL engine may require DOM Components may choose to use different data bindings to represent the business data (input/output/fault), for example, JAXB vs. SDO for the XML manipulations. Service providers or consumers are decoupled and it is impossible to have a fixed data binding A service can serve different consumers that can only handle certain data bindings natively The service providers for a given consumer can be replaced The same service can be accessed over different protocols with different data bindings
  • 15. Data transformation Data transformations are required to get two components talk to each other Having application code to deal with technological data transformation is a nightmare and it will defeat the whole purpose and promise of SCA
  • 16. Tuscany’s data binding frameworkIntrospect/transform data without application coding
  • 17. What does the framework need to figure out? Understand the data binding requirements at different places for the data flow Transform the data from one data binding to the other transparently without the interventions from the application developers Separate the data transformation/marshaling/unmarshaling from the business logic
  • 18. Data type introspection Marker interface commonj.sdo.DataObject, org.w3c.dom.Node Annotations JAXB annotations What information is captured? Java class Java generic type Logic type (XML element/type, Mime types, etc)
  • 19. The magic behind the scenes
  • 20. Transformation paths Types of transformations Unmarshal/Deserialize ( InputStream Object ) Marshal/Serialize ( Object OutputStream ) Convert/Transform ( Object  Object) Direct vs. Multi-hops JAXB DOM JAXB  DOM  SDO Weight of a transformation Private vs. Public Some data bindings are not good as intermediaries (data round-trip issues)
  • 21. The complete data flow Customer data come in JSON from HTTP requests The JSON data is unmarshaled into JAXB for the Payment code to consume Payment passes CreditCard (JAXB) to the reference binding layer which in turn converts JAXB into AXIOM The service binding layer unmarshals the XML data into AXIOM and transform it into SDO for the CreditCardPayment The response path is reverse for the data transformations
  • 22. Data bindings out of the box DOM JAXB (JavaBeans are treated as JAXB) SDO JSON StAX …
  • 23. Data bindings for RESTful servicesIntegrating with JAX-RS entity providers
  • 24. JAX-RS entity providers Entity providers supply mapping services between representations and their associated Java types. Entity providers come in two flavors: MessageBodyReader MessageBodyWriter
  • 25. Tuscany’s generic entity providers based on the data binding framework JAX-RS runtime (such as Apache Wink) Tuscany data binding framework Entity Providers Entity Providers Message Writer Message Reader Entity (JAXB, SDO, DOM, etc) InputStream OutputStream
  • 26. Extending the data binding frameworkSupport your favorite data bindings
  • 27. The DataBinding SPI public interface DataBinding { String getName(); booleanintrospect(DataTypedataType, Operation operation); DataTypeintrospect(Object value, Operation operation); WrapperHandlergetWrapperHandler(); Object copy(Object object, DataTypesourceDataType, DataTypetargetDataType, Operation sourceOperation, Operation targetOperation); XMLTypeHelpergetXMLTypeHelper(); }
  • 28. The Transformer SPI public interface PullTransformer<S, R> extends Transformer { R transform(S source, TransformationContext context); } public interface PushTransformer<S, R> extends Transformer { void transform(S source, R sink, TransformationContext context); }
  • 29. Registering your data bindings/transformers META-INF/services/org.apache.tuscany.sca.databinding.DataBinding org.apache.tuscany.sca.databinding.xml.DOMDataBinding;name=org.w3c.dom.Node META-INF/services/org.apache.tuscany.sca.databinding.PullTransformer org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader;source=org.w3c.dom.Node,target=javax.xml.stream.XMLStreamReader,weight=80 META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer org.apache.tuscany.sca.databinding.xml.Node2OutputStream;source=org.w3c.dom.Node,target=java.io.OutputStream,weight=80
  • 30. Q&AFind more details from:Chapter 9 of Tuscany In SCA Actionhttp://www.manning.com/laws/Save 40% at manning.com.Enter “javaone2010” in the promotional code box at check out.