You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Keith Hatton <kh...@axiomsystems.com> on 2004/01/14 17:59:47 UTC

Immutable Objects?

This is not an Axis-specific question, but I hope others on the list may have encountered similar issues.

I have a number of value objects defined in the <types> section of my WSDL. Generally these have been designed to be immutable - i.e. all their properties are set in the constructor and the original Java code only provides getXXX methods, there are no setXXX methods. Of course WSDL2Java (and I guess, most other WSDL compilers) generates code for writable properties from my WSDL.

It seems surprising to me that there is no way to mark these elements as 'read only' in some sense - for example CORBA IDL allows you to define readonly attributes in a struct. Am I missing something or is it just that I have discovered what the 'Simple' in SOAP means?

Thanks
Keith