Arasu5201 / android-xmlrpc

Automatically exported from code.google.com/p/android-xmlrpc
0 stars 0 forks source link

Overuse of 'private' modifier makes extension very difficult #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm working on an Android client for a legacy XMLRPC system. I cannot 
change the server, and consequently cannot change the format of the XML the 
server sends.

In particular it sends

  <member>
    <name>lastName</name>
    <value>Brooke</value>
  </member>

rather than

  <member>
    <name>lastName</name>
    <value>
      <string>
        Brooke
      </string>
    </value>
  </member>

The output also contains members like this:

  <member>
    <name>lastName</name>
    <value></value>
  </member>

Obviously your XMLRPCClient should not need to be able to parse legacy, 
badly formed data. But I should be able to subclass it to write something 
that can.

However, XMLRPCClient is not designed to be subclassed; too many of its 
members are 'private' when they could perfectly safely be 'protected'. 

Furthermore the serializer class XMLRPCSerializer is not marked 'public', 
so that any specialisation which needs to access the serializer (which I 
do) has to be in the same package, which isn't good engineering.

Once I've worked out what I need to get working I'll submit a patch.

Original issue reported on code.google.com by still...@googlemail.com on 27 Jan 2009 at 3:36

GoogleCodeExporter commented 8 years ago
hi, i think that in your case i could add method setSerializer and then you 
could 
write your own that handles your legacy server. Subclassing XMLRPCClient 
wouldn't 
help much since it's serializer that needs to be changed.

Original comment by psk...@gmail.com on 30 Jan 2009 at 3:27

GoogleCodeExporter commented 8 years ago

Original comment by psk...@gmail.com on 18 Mar 2009 at 3:47