History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: WS-9
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Chad Brandon
Reporter: Mark Hofmann
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
WebService Cartridge

Inheritance of ValueObjects is not supported

Created: 20/Feb/06 09:37 PM   Updated: 27/Feb/06 04:42 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File ClassifierFacadeLogicImpl_code.txt (1 kb)
2. Zip Archive UMLMetafacadeModel.xml.zip (317 kb)
3. Zip Archive WebServiceCartridgeTestModel.xml.zip (20 kb)
4. Zip Archive WebServiceCartridgeTestModel.xml.zip (19 kb)
5. Text File WebServiceLogicImpl.patch (8 kb)
6. Text File webservice_inheritance.txt (7 kb)
7. Text File wrapped-wsdl.vsl.patch (1 kb)
8. Text File wrapped-wsdl.vsl_2.patch (0.9 kb)
9. Text File wrapped-wsdl.vsl_3.patch (2 kb)



 Description   
The cartridge should support inheritance for the ValueObject so that it is possible to
- model a method that uses super types as parameters instead of writing extra methods for each specialization of a type
- model a method with specialized types and get all inherited attributes added to the list of the web service parameters


 All   Comments   Change History      Sort Order:
Comment by Mark Hofmann [20/Feb/06 09:41 PM]
Patch for WebServiceLogicImpl.java (loadTypes method) that adds all generalizations and all specializations of a type to the webservices list of known types

Comment by Mark Hofmann [20/Feb/06 09:44 PM]
Test model for the new inheritance feature. This model is from andromda 3.1.

Comment by Chad Brandon [20/Feb/06 10:09 PM]
I'm trying to apply the patch, however eclipse is saying the patch can not be applied (so I'd need to do it manually). Can you create the patch based on the V3_x_HEAD branch? Thanks!

Comment by Mark Hofmann [21/Feb/06 02:55 PM]
F...., just noticed there's a bug in my patch. I'll try to fix it and then submit a new patch for the 3_x_HEAD.
Hey, and thanks for looking into it so fast :-)

Comment by Mark Hofmann [21/Feb/06 10:03 PM]
Patch against 3_x_HEAD

Comment by Mark Hofmann [21/Feb/06 10:12 PM]
After searching for 5 hours for a bug in my code I found out that there wasn't a bug in my code (at least none responsible for the problems I had), but that I had switched to Axis 1.2-RC3 and that doesn't handle arrays properly.
The wsdl2java tool of 1.2-RC3 generates stubs that refer to the "ArrayOfXX" types instead to the "XX[]" types.

So, I hope it works now, good luck Chad!

Comment by Chad Brandon [22/Feb/06 08:56 PM]
Hey Mark,

I'm looking at the patch again (applied fine this time, thanks!). Just ran the tests and of course they fail because I'm using your test model. However I don't see the attributes of super types being propagated to the subtypes. For example, with this "TestSubType" (I copied from the test output), I would expected would have the following attributes listed as well (since they should be inherited from the super types: attributeOfSuperType and attributeOfSubType).

            <xsd:complexType name="TestSubType">
                <xsd:annotation>
                    <xsd:documentation>
                        
                    </xsd:documentation>
                </xsd:annotation>
                <xsd:sequence>
                    <xsd:element name="attributeOfSubType" nillable="false" type="xsd:string">
                        <xsd:annotation>
                            <xsd:documentation>
                                
                            </xsd:documentation>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

Comment by Chad Brandon [22/Feb/06 09:00 PM]
"since they should be inherited from the super types: attributeOfSuperType and attributeOfSubType", sorry I meant: attributeOfSuperType and *attributeOfMainType*.

Comment by Mark Hofmann [22/Feb/06 10:26 PM]
Sure, you're right! I should have added this patch for the wrapped-wsdl.vsl template.

Sorry,

Mark

Comment by Mark Hofmann [22/Feb/06 10:44 PM]
P.S.: I believe that the logic that I added to the template (looping over the attributes of all super types) should go into some class like WebServiceLogicImpl ("getAllAttributes" or something) but I didn't know how to add a method to it, that's why it's in the template.

Comment by Chad Brandon [22/Feb/06 10:48 PM]

Comment by Mark Hofmann [22/Feb/06 11:30 PM]
Ahh, should have know that it's that easy.
Here's the new patch, though I don't think that you really need it.

Comment by Chad Brandon [23/Feb/06 05:38 PM]
Cool,. so attributes are supported of inherited, how about associations?

Comment by Mark Hofmann [23/Feb/06 05:54 PM]
You're right, I haven't implemented that. Forgot that attributes and associations are not the same in this context.
I guess there must be a method like getAllNavigableAssociationEnds or something that can be used for that, but I can't find it. Any ideas?

Comment by Chad Brandon [23/Feb/06 06:01 PM]
Yeah I don't think we have one, we should probably have one like getAttributes(true), called getNavigableAssociationEnds(true). What you can do is implement it in the ClassifierFacade of the UML metafacades and use that in the template (and attach that to the patch).

Comment by Mark Hofmann [23/Feb/06 06:21 PM]
Okay, I'll do that later tonight or tomorrow (CET). Which version do you want me to patch?

Comment by Chad Brandon [23/Feb/06 06:28 PM]
Great. Can you patch the V3_x_HEAD version?

Comment by Mark Hofmann [25/Feb/06 12:19 PM]
Metafacade Model of 3.1 (didn't find a V3_x_HEAD version), added
getNavigableAssociationEnds(boolean)::Collection
to ClassifierFacade

Comment by Mark Hofmann [25/Feb/06 12:22 PM]
Implementation of getNavigableAssociationEnds(boolean)::Collection
Sorry, no patch, since I worked on 3.1 and couldn't find a 3_x_HEAD version of it.

Comment by Mark Hofmann [25/Feb/06 12:25 PM]
Test model with associations on inherited types (also 3.1).

Comment by Mark Hofmann [25/Feb/06 12:27 PM]
Patch on 3_x_HEAD for wrapped-wsdl.vsl
Changed to use new method type.getNavigableAssociationEnds(true)

Comment by Mark Hofmann [25/Feb/06 12:32 PM]
That should have been all patches/changes. Hope that it's ok the way I did it.
I'd really like to look deeper into the code and API of AndroMDA but unfourtunatly don't have the time to at the moment.
But I always like to learn, so feel free to comment ;-)

Comment by Chad Brandon [27/Feb/06 04:42 PM]
Applied, thanks Mark!