You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Geir Egil Hansen (JIRA)" <ax...@ws.apache.org> on 2004/10/26 13:16:43 UTC

[jira] Created: (AXISCPP-228) getter and setter methods should be generated as the Java version do

getter and setter methods should be generated as the Java version do
--------------------------------------------------------------------

         Key: AXISCPP-228
         URL: http://issues.apache.org/jira/browse/AXISCPP-228
     Project: Axis-C++
        Type: Wish
    Reporter: Geir Egil Hansen
    Priority: Minor


data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54715 ]
     
Samisa Abeysinghe commented on AXISCPP-228:
-------------------------------------------

At the moment all the data members in the generated code C++ have public access. This violates encapsulation. I guess Geir wants them to be private and provide set/get methods. Java generated code has private data members and get/set methods.

However, doing this would require major changes to the Deserializer.

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_58552 ]
     
Adrian Dick commented on AXISCPP-228:
-------------------------------------

Fixing this issue could provide a (simpler) mechanism to support xsd:choice and validating minOccurs and MaxOccurs, it may also provide a neater solution for handling nillable elements.

Current Jira Issues in this area include: AXISCPP-250 and AXISCPP-257.

To support xsd:choice
- An enum is created containing all possible choices.
- The generated class contains a union of the elements available within the choice, and a tag for the enum.
- set<...> methods are provided for all possible choices, each will set the approiate element, and update tag for the given choice.
- get<...> methods are provided for all possible choices, and a getChoiceType method, returning the tag, allowing customer code to use correct get<...> method.

eg:
typedef enum { CHOICE1=1, CHOICE2=1} availableChoices;
class ChoiceWrapper
{
public:
 void setChoice1(... value)
 {
  choice1 = value;
  choice = CHOICE1;
 };
 void setChoice2(... value);
 ... getChoice1();
 ... getChoice2()
 { return choice2; };
 availableChoices getChoice()
 { return choice; };
private:
 availableChoices choice = 0;
 union
 {
  ... choice1;
  ... choice2;
 } choices;
}

To support minOccurs and MaxOccurs:
- If maxOccurs > 1, provide an add<...> method, which when called will update a count of occurances of elements.
- If maxOccurs = 1, can do as above, or alternatively, provide a set<...> method, again updating a count of elements.
- Provide a <...>Occurances method, to allow customers to determine how many element they have.

eg:
class OccurancesWrapper
{
public:
 addValue(... addValue)
 {
  if (valueOccurances != valueMaxOccurs)
  {
   value[valueOccurances] = addValue;
   valueOccurances++;
  }
  else
    throw new AxisException(EXCEEDING_MAX_OCCURS);
 };
 int getValueOccurances()
 { return valueOccurances; };
 ... getValue(int occurance)
 { return value[occurance]; };
private:
 ... value[valueMaxOccurances];
 int valueOccurances = 0;
 const int valueMaxOccurs = 2;
 const int valueMinOccurs = 0;
}
Axis_Serialize_OccurancesWrapper()
{
 // ...
 if ( valueOccurances < valueMinOccurs)
   throw new AxisException(LESS_THAN_MIN_OCCURS);
 if (valueOccurances != 0)
   pSZ->serialize....();
 // ...
}

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Samisa Abeysinghe
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54730 ]
     
Samisa Abeysinghe commented on AXISCPP-228:
-------------------------------------------

I think we could do this as part of 1.4 requiremets "pure C++ engine" and "refactor WSDL2Ws tool".

However, I am not sure if this would overload those who are working on these items, in which case we could try to achieve this with 1.5.

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Geir Egil Hansen (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54664 ]
     
Geir Egil Hansen commented on AXISCPP-228:
------------------------------------------

Well, no I don't think too much is exposed.
It's more a matter of principle. And the principle is about data hiding and the like/dislike of using methods rather than data members in general.

Actually this problem was raised by a customer of mine after I mentioned he could use Axis C++. He wanted to use something else than Visual Studio .NET which does NOT generate/use methods. And he did not like it.
And I agree with him to some extent.

Another problem is when making my documentation: Giving some examples in Java using methods will be rather different than examples in C++ because it does NOT use methods. It would make it easier to see the resemblance between the two if both had methods.

But, anyway, it is just a suggestion/wish.  


> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Geir Egil Hansen (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54729 ]
     
Geir Egil Hansen commented on AXISCPP-228:
------------------------------------------

You're right that is exactly what I mean. I can't see why Axis C++ should generate the code differently than Java. 
Plain C code is quite a different case. I have no comments on the generated code there. But if it requires a bigger rework to the deserializer I realize that I might have to keep it on the "wish list for the future" for quite some time ....


> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_58376 ]
     
John Hawkins commented on AXISCPP-228:
--------------------------------------

This was not done during rework of 1.5 and is too big for this late in the project (code freeze of alpha). This could be done in 1.6 as a code clean up operation.

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Samisa Abeysinghe
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=all ]
     
Dushshantha Chandradasa closed AXISCPP-228:
-------------------------------------------


Getter and setter methods are now autogenerated by the wsdl2ws tool. 

Still the attributes of the partucular generated class are defined as public variables in the header file. I didn't change this in to private variables. to do that change i have to make major modifications in code generation. I think it should be addressed as a seperate issue.  

For elements which belong to wsdl construct 'choice', setters automatically set other choice elements to NULL.

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing - RPC
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

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


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54662 ]
     
John Hawkins commented on AXISCPP-228:
--------------------------------------

get/sets are being created when people have seen usage requirements to do so.

This appears to have been more along the lines of when not enough function is being exposed rather than too much.

Are there are specific areas where you think we are exposing too much or are you looking for more information to be exposed?

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Mark Whitlock (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_54734 ]
     
Mark Whitlock commented on AXISCPP-228:
---------------------------------------

I can investigate this as part of the rework of the external
C and C++ interface.

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=history ]

Samisa Abeysinghe updated AXISCPP-228:
--------------------------------------

      Version: 1.5 Alpha
    Component: WSDL processing

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Samisa Abeysinghe
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=all ]

Dushshantha Chandradasa reassigned AXISCPP-228:
-----------------------------------------------

    Assign To: Dushshantha Chandradasa  (was: Samisa Abeysinghe)

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing - RPC
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

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


[jira] Assigned: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=history ]

Samisa Abeysinghe reassigned AXISCPP-228:
-----------------------------------------

    Assign To: Samisa Abeysinghe

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Samisa Abeysinghe
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=all ]
     
Dushshantha Chandradasa resolved AXISCPP-228:
---------------------------------------------

    Resolution: Fixed

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing - RPC
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

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


[jira] Commented: (AXISCPP-228) getter and setter methods should be generated as the Java version do

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-228?page=comments#action_58310 ]
     
Samisa Abeysinghe commented on AXISCPP-228:
-------------------------------------------

My gut feel is that I would be able to add this for C++ stubs.
Do we feel taht this should be done for 1.5 or should postpone for 1.6?

> getter and setter methods should be generated as the Java version do
> --------------------------------------------------------------------
>
>          Key: AXISCPP-228
>          URL: http://issues.apache.org/jira/browse/AXISCPP-228
>      Project: Axis-C++
>         Type: Wish
>   Components: WSDL processing
>     Versions: 1.5 Alpha
>     Reporter: Geir Egil Hansen
>     Priority: Minor

>
> data hiding is of importance in C++ as well as in Java. So I should wish Axis C++ can generate getter and setter methods for the data members the same way as the Java version does

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira