Java Projections in SDO 3.0 First Draft Ron Barack.

Slides:



Advertisements
Similar presentations
Modeling Elements of Web Service State in WSDL May 12, 2003 Global Grid Forum.
Advertisements

Apache Struts Technology
CS0007: Introduction to Computer Programming Introduction to Classes and Objects.
Containment and XML Projections in SDO 3.0 Ron Barack - SAP …
.NET Database Technologies: Open-Source Frameworks.
SDO 3.0 Virtual F2F – Helper Contexts (Issue 96) Blaise Doughan Team Lead, Oracle TopLink OXM, JAXB, & SDO Team Lead, EPS(EclipseLink) MOXy & SDO.
SDO 3.0 – Enhancing the API Blaise Doughan Team Lead, Oracle TopLink OXM/SDO/JAXB Team Lead, Eclipse Persistence Services (EclipseLink) OXM/SDO/JAXB.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
JAXB Java Architecture for XML Bindings. What is JAXB? JAXB defines the behavior of a standard set of tools and interfaces that automatically generate.
Generic Subroutines and Exceptions CS351 – Programming Paradigms.
IBM Software Group © 2005 IBM Corporation University of Nantes Eclipse dayMarch 2005 The Eclipse Modeling Framework and the IBM Model Transformation Framework.
Web Services with Apache CXF Part 2: JAXB and WSDL to Java Robert Thornton.
On a Device Information Model for devices in oneM2M
Object-Oriented Analysis and Design
Apache Chemistry face-to-face meeting April 2010.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
A Simplified Approach to Web Service Development Peter Kelly Paul Coddington Andrew Wendelborn.
Mapping Data Models to VOTable The specification Published version dml/doc/MappingDMtoVOTable-v pdf.
® IBM Software Group © 2004 IBM Corporation Using Rational Software Architect to Drive Application Integration Message Definition from Information Models.
JAXB Java API for XML Binding. The Objective JAXB is concerned with the translation process between Java objects and XML documents You have a Java object.
UML2 Package Merge Usage scenarios and their effect on XMI and Java API interoperability Bran Selic, Jim Amsden, Kenn Hussey Oct, 2003.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 10: Service Component Architecture.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
Object Oriented Programming Elhanan Borenstein Lecture #4.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 10 Use Case Design.
Tu sca ny 1 Extending The Tuscany Java SCA Runtime 21 August 2006.
Component frameworks Roy Kensmil. Historical trens in software development. ABSTRACT INTERACTIONS COMPONENT BUS COMPONENT GLUE THIRD-PARTY BINDING.
Web Services with Apache CXF Part 2: JAXB and WSDL to Java Robert Thornton.
Java Projections in SDO 3.0 Ron Barack - SAP …. Agenda n Pain Points n Frameworks and Data Representations n Proposals l Annotations l Projections between.
Slide 1 Extending Tuscany Raymond Feng Apache Tuscany committer.
Systems Analysis and Design in a Changing World, 3rd Edition
Inheritance - Polymorphism ITI 1121 Nour El Kadri.
Tuscany: a SOA framework Jeffrey Guo Accelrys, Inc.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
ChangeSummary / DAS Requirements (SDO 3.0 Virtual F2F) Christophe Boutard François Huaulmé
ModelPedia Model Driven Engineering Graphical User Interfaces for Web 2.0 Sites Centro de Informática – CIn/UFPe ORCAS Group Eclipse GMF Fábio M. Pereira.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
Web Services with Apache CXF Part 2: JAXB and WSDL to Java Robert Thornton.
CS0007: Introduction to Computer Programming Classes: Documentation, Method Overloading, Scope, Packages, and “Finding the Classes”
Preliminary Ocean Project Page 1 WGISS SG May 15, C. Caspar G. Tandurella P. Goncalves G. Fallourd I. Petiteville Preliminary Ocean Project Phase.
OSLC PLM Reference model April Summary of the OSLC PLM Reference Model V0.4 April 4th 2011 Gray Bachelor Mike Loeffler OSLC PLM Workgroup.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
C++ Inheritance Data Structures & OO Development I 1 Computer Science Dept Va Tech June 2007 © McQuain Generalization versus Abstraction Abstraction:simplify.
ODS – Introduction to Web Services and BPEL Vakgroep Informatietechnologie Web Services & BPEL Design of Distributed Software.
问题 Code scattering Blocks of duplicated code Blocks of complementary code, and different modules implementing complementary parts of the concern Code.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
D. Duellmann - IT/DB LCG - POOL Project1 The LCG Dictionary and POOL Dirk Duellmann.
 Static  Example for Static Field  Example for Static Method  Math class methods  Casting  Scope of Declaration  Method Overloading  Constructor.
EEL 5937 The Bond Agent System (1) EEL 5937 Multi Agent Systems Lecture 8, Jan 30, 2003 Lotzi Bölöni.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
CSCE 240 – Intro to Software Engineering Lecture 3.
Static SDO Proposal Main Points/ Next Steps. Goals of specification Not about the algorithm to generate Static SDOs Instead, about how Static SDOs map.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
XML Schema for WIRED XML Detector Description Workshop
Java Beans Sagun Dhakhwa.
Introduction to J2EE Architecture
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Containment in SDO 3 XML Projections
Creating and Using Classes
Abstract Classes and Interfaces
Developing and testing enterprise Java applications
Presentation transcript:

Java Projections in SDO 3.0 First Draft Ron Barack

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Agenda Pain Points Proposal API

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Pain Point: SCA cross application wiring SCA Cross-Application Wiring SCA allows calls between co-located applications (i.e., EAR). Each application will have ist own class loader. Static SDOs may be used in method signatures. Problem Statement The static SDOs may be packaged differently in each application. Even if the packaging is identical, unless the classes are placed in a common (system) library, the static SDOs will be loaded in different classloaders, and therefore we will not be able to cast from one to the other. SDO is Service Data Objects, and must support data transfer between applications (without requiring conversion to XML).

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Use-Case from SCA RDB DAS EJB On this side, a static SDO is used. JBPM BPEL On this side, a DOM Element is generated. The SDO type is generated from the XSD. No static SDO is needed or desireable. SCA Wiring SCA Wiring appies the projection, adding the static SDO like a facade to the SDO Data Object. Late Binding of static class to SDO type

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Pain Point: Harmonizing SDO with Frameworks Frameworks such as JAX-B and JPA use POJO classes as data objects. –These POJO classes may be generated or hand written. –The frameworks introspect the POJO classes, and typically use injection to load values into the fields. –Injection may be setter or field-based. JAX-B and JPA are intended to be used throughout the application, not just near the data source (a la EntityBeans). Framework POJOs typically do not interoperate – eg, you can‘t use your JAX-B classes as JPAs. Applications involve multiple frameworks, eg, read data from JPA and use it in a WebService response. It is impractical to generate separate static SDO in cases where such POJOs aready exist. –Domain models tend to be big… this would effectively double the number of classes. –Seems to require a copy step SDO should be the glue for bridging frameworks

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Framework Imposed Programming Models Frameworks impose Programming Models data type definition language/methodology interface description language/methodology interface implementation requirements framework behavior Examples: Session Bean with DTOs JPA with persistent classes JAX-WS bean with JAXB BPEL with XSD+WSDL SDO DAS with SDOs (just another framework) If SDO wants acceptance, it must Simplify transition between domains. Interoperate with existing frameworks

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Integration in SDO 2.1: SDO-Java/XML XSD as leading description of domain types Java interface derived from schema (may require tooling) SDO type preserves XSD nature +: prepared for cross-technology use- cases (anything java/wsdl) +: fully supported today -: Other frameworks are hidden behind the DAS. Not useful for integrating existing applications, and assumes that we can impose the SDO framework on the rest of the world. open! use sdo: attributes to provide additional meta- data (e.g. interface association)

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT SDO Annotations: SDO-Java/XML SDO type derived from Java Interface. XML schema generated as needed. +: prepared for cross-technology use- cases (anything java/wsdl) -: currently SAP-only. Proposed for SDO : simple scale-out from Java scenario to XML-based technologies -: Other frameworks are hidden behind the DAS. Not useful for integrating existing applications, and assumes that we can impose the SDO framework on the rest of the world. open! use sdo annotation (proprietary) to provide additional meta-data (e.g. for XML schema)

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Proposal: SDO integrates with existing frameworks The JPA programming model is used. The cast operation converts from the persistent object to SDO, not (necessarily) a java cast. Additional metainformation can be provided as annotations, or the cast operation can be used with an additional Type parameter. Of course, everything is nicer if the objects returned from JPA already implement DataObject! use sdo annotations to provide additional meta- data (e.g. for XML schema)

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Proposal: SDO Glues Frameworks Together Pojo.java. IService.java sdo u s e DB JPA t y p e s i n t e r f a c e s i m p l e m e n t a t i o n service impl p a s s f r a m e w o r k JaxB.java. IService.java u s e JAX-WS service impl p a s s cast project The JPA & JAX-WS programming models are used side-by-side. The project operation creates a POJO, in fact, an entire graph of POJOs. The DataObject.cast operation creates a facade (proxy) object, that extends the target class and implements DataObject. If the target class is a POJO, this may involve a copy step, since the fields will need to be filled. Navigating from the projection returns objects that are themselves projections, i.e., implement DataObject as well as extending the target class.

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Proposal: SDO Projections into static Java In SDO 2.1, XML specific information (eg, containment) is associated with the SDO type in a 1:0..1 fashion: each type has at most one set of associated XML data. In the discussion of containment in SDO 3.0, projections describe the late coupling of SDO metadata with the additional data necessary for XML fidelity, creating a „view“ of the data. The same SDO type can be „projected“ onto any number of XSDs. In SDO 2.1, the information specific to a static SDO is associated with the SDO type in a 1:0..1 fashion: each complex type has at most one „instance class“. In this set of slides, we consider applying the concept of projects to static SDOs, to provide late, potentially temporary coupling of SDO metadata with a specific static SDO. The same SDO type can be „projected“ onto any number of Java classes!

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT A POJO DAS Integrated into SDO The DataFactory.cast and DataObject.project methods constitute effectively a DAS for POJOs. This is not intended as a general mapping framework, only as a data binding. This functionality is separate from static SDO‘s. Static SDOs inplement both DataObject and the static interface. The result of a DataObject.project operation does not implement DataObject. The result of a DataFactory.cast operation does not implement (or extend) the POJO class. Question: Do we need JavaHelper?

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT DataObject.cast creates static SDOs Static SDOs Provide type-safe and programmer friendly access to SDO data. Maintain ChangeSummary and other SDO properties. Can be casted (the Java op) to DataObject. Target classes may be interfaces or POJOs Casting to an interface constructs a proxy object…no copy step is involved. Casting to a POJO necessarily involves a copy step, since the fields of the newly created object must be filled...but my be done lazilly. For all properties in the SDO the corresponding setter is called in the constructed POJO The SDO runtime assures data consistency of all projections.

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Special Case: Converting to/ from a JAX-B object The mapping between the methods defined on the target interface and the properties in the DataType is not necessarily „standard“ mapping defined in Chapter 5 of the SDO 2.1 spec. This wrapping could take into account annotations as well as method signatures (eg, JAXB annotations). The logic that does the mapping would also be responsible for any type conversions that are part of the projections, for example, it could wrap values in JAXBElement. A marker could have to be used to signify which mapping applies. The extended class could be annotated

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT API: DataFactory.cast DataObject DataFactory.cast(Object arg) DataObject DataFactory.cast(Object arg, Type type) These methods „cast“ a POJO object, returning an SDO DataObject. The SDO Type of the returnValue is either derived through introspection of the class, or given as a parameter. If arg is already castable to DataObject, the same instance will be returned. In any case, the values of arg ‘s properties are available in the returnValue. Setters called on returnValue also change the value of arg ‘s properties. Setters called on arg directly change the value of returnValue‘s properties, but these changes will not affect the ChangeSummary, the value of isSet, etc. Effectively, the entire transitive closure reachable from arg is casted, but implementations may create objects lazily.

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT API: DataObject.cast T dataObject.cast(Class targetClass) This method „casts“ a DataObject into a static POJO class (or interface), returning a static SDO where both targetClass.isInstance(returnValue) and returnValue instanceof DataObject return true. The values of dataObject ‘s properties are available in the returnValue. Setters called on returnValue also change the value of dataObject ‘s properties. Navigating from returnValue returns objects that are casted, ie, implement DataObject and extend/implement a POJO class/interface. Effectively, the transitive closure is casted, although this may be done lazilly. Question: How is polymorphism handled? How do we know what the projected class should be if reflection doesn‘t tell us?

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT API: DataObject.project T dataObject.project(Class targetClass) This method „projects“ a DataObject into a static POJO class, returning an instance of the targetClass. The state of the created object reflects the current values of dataObject ‘s properties. DataObject.cast provides an additional view of the same underlying data. DataObject.project creates an additional, „detached“ copy of the data. Changes to the DataObject are not reflected in the projected object, or vice-versa. The transitive closure is projected. Question: How is polymorphism handled? How do we know what the projected class should be if reflection doesn‘t tell us?

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT API: DataFactory.create T dataObject.create(Class targetClass) This method is not new, but it is included since it shows how an SDO-enabled JPA or JAX-B implementierung could create an instance of a static SDO where targetClass.isInstance(returnValue) and returnValue instanceof DataObject return true.

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Type.instanceClass For backwards compatibility, Type still has instanceClass When a call is made to a method that returns a DataObject(eg, getRootObject(), getContainer()) instanceClass defines the „default projection“: the return object is castable to the instance class. But results can still be casted to any appropriate static SDO. Use of „project“ and „cast“ should be prefered over java casts. SDO 2.1 RootObjectType d = (RootObjectType)xmlDocument.getRootObject(); SDO 3.0 RootObjectType d = xmlDocument.getRootObject().project(RootObjectType.class); Calling a getter on a static SDO naturally returns a properly typed object. For set(Object)/ get(Object) where object is a projection, this pattern could be awkward. You set a static SDO, and get back a DataObject that must be projected to the static class. Especially awkward for Lists…every element needs to be casted.

 SAP AG 2007, Containment in SDO 3.0 / Ron Barack / First Draft DRAFT Other ideas regarding projections. For casting to or from POJOs, annotations can be either on methods or on fields. Current proposal is that the runtime keeps all casts in sync. Is this really necessary? Should we detach them? The main reason not to is that interface projections do not require a copy step, they can really refer to the same data, so in this case it would be very inefficient to require a copy step.