|
-
Sep 21st, 2011, 09:11 PM
#1
Thread Starter
Frenzied Member
need help with object oriented programming
I'm having a hard time trying to code my application using OOP. Basically, I have two webservices that i'd like to use OOP. As an example, I have one soap webservice that returns Name and Age. I also have an xml webservice that returns EyeColor and HairColor. Now, I figured I'd create a class called WebServiceClass, then I'd create a SoapWebServiceClass (that inherits from WebServiceClass) and a XmlWebServiceClass (that inherits from WebServiceClass). But the problem is, I don't know what would be the members (properties and methods) inside WebServiceClass. I figure there would be an abstract SendRequest() method, which I would implement in the SoapWebSErviceClass and XmlWebServiceClass since each would have a different way of sending a request. Any ideas on how to do OOP on this?
-
Sep 22nd, 2011, 09:16 AM
#2
Addicted Member
Re: need help with object oriented programming
If you're only using the webservice class as a metaclass of the other two, it doesn't necessarily need members (although there wouldn't be much of a point to inherit two classes from one that doesn't have any members). You could also do what you said about doing the abstract SendRequest() method, I don't see anything wrong about it.
The one thing I do see as kind of odd is that you're using one class to return name and age and one to return hair and hair color... Unless the two are unrelated to their entities, I don't see why you'd use separate services for them. Perhaps you can explain the reason?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|