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

Yang ZHONG commented on TUSCANY-1110:
-------------------------------------

One of the possible ways to get around the scope/HelperContext issue, is to use 
QName, like the SDO 3 annotation, and leave the QName scope/HelperContext 
interpretation to TypeHlper/DataFactory.

So the setInstanceClassName approach can be adjusted as:
    static Map<String,Collection<String[]>> class2Types; 
    public void ClassImpl/DataTypeImpl#setInstanceClassName(String 
instanceClassName) 
    { 
        super.setInstanceClassName( instanceClassName); 
        class2Types.get( instanceClassName).add( new String[]{ getURI(), 
getName()}); 
    } 
    Type TypeHelperImpl#getType(Class c)
    {
        String[] qName = class2Types.get( c.getName()).iterator().next();
        return getType( qName[0], qName[1]);
    }

And the CodeGen approach can be adjusted as:
    step 3) ... generate a static method that returns the type *QName*... 
    Type TypeHelperImpl#getType(Class c)
    {
        Method method = ...
        String[] qName = method.invoke(null,null);
        return getType( qName[0], qName[1]);
    }

> Improve the performance of TypeHelperImpl.getType(Class)
> --------------------------------------------------------
>
>                 Key: TUSCANY-1110
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1110
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-Mx
>            Reporter: Raymond Feng
>             Fix For: Java-SDO-Mx
>
>
> In the SDO databinding for SCA, we need to introspect a java class/interface 
> to figure out the corresponding SDO type. Looking into the code, there is a 
> TODO comment:
> //TODO more efficient implementation ... this is a really bad one!
> Do you plan to provide a more efficient impl :-)?
> Thanks,
> Raymond

-- 
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