You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kiechle, Patrick" <p....@cenit.de> on 2009/07/22 15:47:47 UTC

Handling with dynamic number of Properties

Hi! Can somebody tell me how to handle with a dynamic number of
properties?
i want to create a service which has a unknown number of properties, so
i decided for a dynamicly number of properties.
 
but how can i get this?
 


CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.de
Geschaeftsstellen: Berlin, Duesseldorf, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Saarbruecken
Vorstandsmitglieder: Kurt Bengel, Christian Pusch
Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer
Bankverbindungen:
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
BW-Bank (BLZ 600 501 01) Kto. 2 403 313 IBAN : DE17 6005 0101 0002 4033 13 SWIFT-Code : SOLADEST
Registergericht: Amtsgericht Stuttgart
Handelsregister: HRB Nr. 19117
Umsatzsteuer: ID-Nr. DE 147 862 777

Re: Handling with dynamic number of Properties

Posted by Simon Laws <si...@googlemail.com>.
Hi

No problem.

In that case I think you'll have to do as I suggested before (unless
anyone else has a better idea), i.e. create a property that is able to
hold all the possible property values you are likely to need and make
it multi-valued, e.g.

    @Property
    protected Collection<ComplexPropertyBean> complexPropertyFour;

Take a look at the property itest  [1] for more details on how to
define and configure properties.

Regards

Simon

[1] http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/properties/

AW: Handling with dynamic number of Properties

Posted by "Kiechle, Patrick" <p....@cenit.de>.
I mean a component that can have zero or more properties. Sorry my english isn't very well. I hope it's okay.. 

Thank you very much for your help! 

-----Ursprüngliche Nachricht-----
Von: Simon Laws [mailto:simonslaws@googlemail.com] 
Gesendet: Mittwoch, 22. Juli 2009 16:11
An: dev@tuscany.apache.org
Betreff: Re: Handling with dynamic number of Properties

Hi

Can you say something more about what you mean by a dynamic number of properties. Do you mean a component that can have zero or more properties or do you mean a property that can have zero or more values.

If the latter then this is supported using a multi-values property (either an array or collection, e.g. list, in a Java component implementation).

If you mean the former then I'm not sure. I think you would have to pretend by creating a multi-valued property with a type suitable to hold the dynamic list of properties you want to pass to the component.

Regards

Simon



CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.de
Geschaeftsstellen: Berlin, Duesseldorf, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Saarbruecken
Vorstandsmitglieder: Kurt Bengel, Christian Pusch
Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer
Bankverbindungen:
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
BW-Bank (BLZ 600 501 01) Kto. 2 403 313 IBAN : DE17 6005 0101 0002 4033 13 SWIFT-Code : SOLADEST
Registergericht: Amtsgericht Stuttgart
Handelsregister: HRB Nr. 19117
Umsatzsteuer: ID-Nr. DE 147 862 777


Re: Handling with dynamic number of Properties

Posted by Simon Laws <si...@googlemail.com>.
Hi

Can you say something more about what you mean by a dynamic number of
properties. Do you mean a component that can have zero or more
properties or do you mean a property that can have zero or more
values.

If the latter then this is supported using a multi-values property
(either an array or collection, e.g. list, in a Java component
implementation).

If you mean the former then I'm not sure. I think you would have to
pretend by creating a multi-valued property with a type suitable to
hold the dynamic list of properties you want to pass to the component.

Regards

Simon