[ 
https://issues.apache.org/jira/browse/TUSCANY-1317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508696
 ] 

Fuhwei Lwo commented on TUSCANY-1317:
-------------------------------------

After reviewing 1317.patch, here is my comment.

1. The patch seems to allow the users to specify load/save options at the 
HelperProvider level. I don't think we want to go that far. Setting options at 
the HelperContext level should be sufficient in my opinion. This means all the 
changes like the one below in HelperProvider implementation should not be 
needed.

HelperProviderImpl.createDefaultHelpers(Map options) is not needed.

2. I think in order for XMLHelper and XMLStreamHelper to access options in the 
HelperContext, we should change the relationship between HelperContext and 
helper implementations first so all the helpers have a way to access the 
options stored in the HelperContext. I know only XMLHelper and XMLStreamHelper 
needs to access the HelperContext's options but I think it's consistent to let 
all helpers have reference to the HelperContext.

Current relationship:

HelperContext ---1:1---> TypeHelper ---1:1---> ExtendedMetaData
                           ---1:1---> XMLHelper  ---1:1---> ExtendedMetaData
                                                        
XMLStreamHelper ---1:1---> TypeHelper

Proposed relationship:

HelperContext ---1:1---> ExtendedMetaData
                           ---1:1---> Map (:defaultOption)
                           <---1:1---> TypeHelper
                           <---1:1---> XMLHelper
                           <---1:1---> XMLStreamHelper
                           <---1:1---> XSDHelper
                           <---1:1---> DataFactory

- Move ExtendedMetaData var in TypeHelper and XMLHelper to become 
HelperContextImpl's protected var
- New the instance of XMLStreamHelper in the contructor of HelperContext - this 
will create the association between     HelperContext and XMLStreamHelper
- Change HelperContextImpl constructor to pass HelperContext instance to the 
contructor of TypeHelper, XMLHelper, XMLStreamHelper, XSDHelper, and 
DataFactory so they have reference back to HelperContext for accessing the 
load/save options at the HelperContext level

Let me know whether this makes sense. Thanks.

> Provide a way to set default XML load options to be used during Java 
> deserialization
> ------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1317
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1317
>             Project: Tuscany
>          Issue Type: New Feature
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-beta1, Java-SDO-1.0
>            Reporter: Daniel Peter
>             Fix For: Java-SDO-1.0
>
>         Attachments: 1317.patch, JIRA1317Design.txt, JIRA_1317_June21.txt, 
> JIRA_1317_June25_Amita.txt
>
>
> XML load options can be passed when calling the XMLHelper.load(...) methods. 
> But there is currently no way to pass such load options to be used during 
> Java deserialization.
> Thus a way to set default load options should be provided, e.g. 
> SDOUtil.setDefaultXMLOptions(HelperContext, Object options)
> These default options could then be picked up during Java deserialization, 
> i.e. in the method readDataObject in class HelperProviderImpl.ResolvableImpl.
> Additionally the XMLResource.OPTION_RECORD_UNKNOWN_FEATURE option could be 
> exposed in Tuscany SDO.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to