I was looking at the mvc architecture used in the Zimbra client. Very nice, by the way, that the architecture can also be used for client side javascript, I hadn't thought about that. I noticest that the model objects generate their own parameter xml-structure for the soap requests that are send to the server. I was thinking that it must take a lot of development time to create those methods and a lot of maintenance time to change it when something changes in the model. This isn't a problem for one model but if you use multiple models this could get anoying .

I had the idea to create a parent Model class. Al classes that are inherited from this class must represent the models (or structs) that are send to the server via the SOAP request. Or they must at least be capable to give back an object structure that can represent the models that you send with SOAP requests. The parent Model class would have the methods to accomplish this. The only thing that needs to be defined in the child models is the structure definition and this could be a simple array.

The models must not give back the xml structure them selves. They would become to dependend on the way that is communicated. We would use a factory pattern to solve this problem. A 'Communication' factory could create an object that can read the structure definition of a model class. This object would take or get al the values from the model and create an xml (or what you need) structure so that it can be send to the server. This way you could implement SOAP1.1, SOAP1.2, XML-RPC and other communication protocols without changing anything on the server. Also the development time on the models will be a lot shorter because you don't have to write so much code all the time.

But maybe my idea sucks because it would take javascript to much time to communicatie with the server .

What do you guys think about my idea? (Maybe you already thought about it and it has to much negative effects. But then I would be glad if you would share them with rest and me).

Soon I am going to try to implement a prototype version of the idea, to see if it works.