[
http://issues.apache.org/jira/browse/TUSCANY-773?page=comments#action_12439875
]
Raymond Feng commented on TUSCANY-773:
--------------------------------------
> Hi Raymond,
>
> I have gone thro this and here are some questions / concerns: -
>
> 1) There is an assumption that the java type for the property is known which
> may not be true. All that might be known is the xml type. This will work
> if the componenttype loading is done thro introspection because the
> introspection processors set the JavaType of the property. But if you are
> loading thro the componentType file, the SimplePropertyObjectFactory could
> have problems. right?
>
Really, we shouldn't have dependencies on the JavaType which is just one of the
databindings we support. I think "DataType" is more appropriate. The
"SimplePropertyObjectFactory" simply does XML string to java simple types and
it should be replaced by the generic-purpose PropertyObjectFactory which is
based on the databinding framework. SimplePropertyObjectFactory can be used ror
system components (I'm not sure if we have a chicken-egg problem to have
component loader depend on databinding system services).
> 2) Talking about the componentType side file brings me to a 'blocker' that I
> experience. I have already mentioned about this earlier. It is about not
> being able to use the component type side file for java components. I have
> tried it several times and I end up with
>
> org.apache.tuscany.spi.loader.UnrecognizedElementException:
> {http://www.osoa.org/xmlns/sca/1.0}componentType
> {http://www.osoa.org/xmlns/sca/1.0}componentType]
>
> I want to know if this is a problem that I am alone experiencing. Should I
> raise a JIRA for this?
>
Can you post a test case? I checked the code and I found
"ComponentTypeElementLoader" is registered and it should be able to load the
componentType.
> 3) I see that the value object factory gets created for the PropertyValue in
> the ComponentLoader itself. Over here we transform the value xml to java
> objects. Having this function in the ComponentLoader will mean that this
> will be done for all implementations (java, javascript, rubyscript, groovy).
>
> Now for the scripts, where is the JavaType for the property available? All
> that might get mentioned is just about the xml type in the componentType
> file. This is again where the SimplePropertyObjectFactory could have
> problems (just about the same as what I have said above in point 1).
>
Again, I would assume the differences among different containers should be the
databindings. We need to establish a contract so that the containers can
nominate databindings for a property value. The PropertyValue is a neutual
representation of the XML value of the property and it's subject to
transformation.
> That is why I had put the function of converting the propertyvalues xml to
> java objects in the JavaComponentBuilder. This way the implementation
> builders just about get the xml document and it is upto them how they
> transform it to suit the underlying implementation (java, javascript,
> ruby,groovy). So in our Java Implementation, the builder simply transforms
> this to Java objects. Similarly I would expect the JS Builder to convert
> this xml data to JS objects (dono how do this though :)). Isn't this
> approach right - am I missing some point ?
I want to extract the commonalities. The builders should not be forced to do
data transformation, but instead they should express what they want.
>
> 4) Is there something that you are doing about transforming complex xml
> content to java objects ? Can we not have the JavaPropertyFactory that I
> proposed, in place atleast upto the point when this is ready from the
> databinding framework ?
>
I suggest that you contribute a JavaBean databinding and some transformers
which can deal with XML/JavaBeans. This way, we can use JavaBeans as
properties. :-)
> Fix Property Value Loading from Component Definitions
> -----------------------------------------------------
>
> Key: TUSCANY-773
> URL: http://issues.apache.org/jira/browse/TUSCANY-773
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core
> Affects Versions: Java-M2
> Reporter: Venkatakrishnan
> Assigned To: Raymond Feng
> Attachments: rfeng.patch, Tuscany-kernel-core-02-Oct.diff,
> Tuscany-kernel-spi-02-Oct.diff, Tuscany-sca-kernel-core-03-Oct.diff,
> Tuscany-sca-kernel-spi-03-Oct.diff, Tuscany-spec-sca-02-Oct.diff,
> Tuscany-spec-sca-03-Oct.diff
>
>
> Currently property loading for application components does not work. There
> is NPE exception thrown when creating a property instance factory based on
> the property value defined in the Component Defn.
> Also the property loading works only for simply types whose values can be
> represented as a simple xml text content.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]