Topic: "Multiple Inheritance" (mixins) and WebServices
My team has finally hammered out a web service API for our current project. Looking at the API needs it appears to me that a multiple inheritance model is appropriate and it will really help us divide-and-conquer as we actually implement the API.
In broad terms (damn NDA) we want to provide a generic version of our webservice that can be used to accomplish every task that connecting systems will need to do. We also know that we will see some performance improvements if we extend that base service with a version for each connecting system to offer some convienience classes. No problems there, that is a matter of single inheritance which is supported.
Where we would see an improvement with multiple inheritance is in creating, for example, a User Authentication webservice and a User Modification webservice and then having our Base webservice inhert from each of those. That would allow one member of the dev team to work on a smaller webservice, keep things modular, and make maintenance easier. Psuedo-code for .NET/Java would look kind of like this:
MyGenricWebService inherits from MyUserAuthWebService, MyUserModWebService
MySpecificWebService inherits from MyGenericWebservice
one_call_new_email(login, pass, newemailaddr)
I understand that Ruby provides something similar to multiple inheritance via mixin modules. I have looked at examples and it appears that if I define a method in a module and then mix it in, my class then exposes the constants and methods in that module as its own. Is this correct?
If I create methods in a module and then include that module in a WebService based class will those module methods also be exposed as WebService methods? As SOAP methods able to generate a proper WSDL?
Pseudo-code for what I want from rails
class MyGenericWebservice < ActionWebService::Base
class MySpecificWebService < MyGenericWebService
Would I be able to make SOAP calls to MySpecificWebService.my_generic_method as well as MySpecificWebService.some_method_in_user_auth_mixin?
Thanks for your help! I'm coming from a Java/.NET/PHP background and I'm still being retrained to trust the RoR framework to do the right thing!