OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sdo message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [sdo] ISSUE 66: Moving Data Between Contexts: 1st proposal


Hi Ron,

Thanks for writing this up. Here are some initial thoughts.

You say that an implementation may loosen the compatibility requirements, 
for example, to allow T1's properties to be a subset of T2's. First of 
all, I think this will be a very common scenario, so it should be 
described as clearly compatible. Also, to allow roundtripping in this 
case:

    o1 = c1.getDataHelper().project(o2);
    o2 = c2.getDataHelper().project(o1);

it would also need to allow T1's properties to be superset of T2's. I 
don't think that's really a problem, assuming that the underlying 
structure actually includes all the necessary data - which I think is the 
real definition of compatibility. That is, the target type needs to be 
compatible with the underlying data of the DataObject, not necessarily 
it's current type.

You didn't actually show the intended signature of the project() method. 
I'm assuing:

    DataObject project(Object sourceObject);

I wonder if we should instead, or also, have a project() method that looks 
like this:

    <T> T project(Class<T> targetClass, Object sourceObject);

With it, one could also convert to a POJO view:

    HelperContext myHelperContext = ...
    DataObject myDO = ...
    Customer cust = 
myHelperContext.getDataHelper().project(Customer.class, myDO);

To go back to the DataObject view:

    myDO = myHelperContext.getDataHelper().project(DataObject.class, 
cust);
 
 And, of course, we can go to another compatible context's view:

    HelperContext context2 = ...
    DataObject ccontext2DO = 
context2.getDataHelper().project(DataObject.class, myDO);

I'm also wondering if it might be useful to add a convience project() 
method on DataObject:

    /**
     * Projects the current object as an instanceof the specified class.
     * Same as calling helperContext.getDataHelper().project(targetClass, 
this),
     * where helperContext is the HelperContext of this DataObject.
     */
    <T> T project(Class<T> targetClass);

Maybe we could even use this as a replacement for getSequence(), since 
Sequence is also just another view of the underlying data. For exmple:

    Sequence sequence = myDO.project(Sequence.class);

Anyway, that's it for now.

Frank.




"Barack, Ron" <ron.barack@sap.com> 
03/13/2008 11:01 AM

To
<sdo@lists.oasis-open.org>
cc

Subject
[sdo] ISSUE 66: Moving Data Between Contexts:  1st proposal






<<Dok1.doc>> 
Hi, 
Here is a first pass at a concrete proposal regarding the compatibility 
and the project() method.  Comments (and re-writes) very much welcome. The 
section numbers are based on the current working draft:  
http://www.oasis-open.org/apps/org/workgroup/sdo/download.php/26863/OASIS%20SDO%20For%20Java%20Spec.doc
Ron [attachment "Dok1.doc" deleted by Frank Budinsky/Toronto/IBM] 
---------------------------------------------------------------------
To unsubscribe from this mail list, you must leave the OASIS TC that
generates this mail.  You may a link to this group and all your TCs in 
OASIS
at:
https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]