|
-
Oct 22nd, 2007, 11:44 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [2005] Interface question
Hello,
I have never created my own interface before. I am pretty confident that I understand it pretty good, but I have two issues that I am hoping that someone can help me out with.
I have created a transactions interface that will be implemented by classes such as contact, or any other that I choose to add it to. It will provide the methods used to add a contact or another record to a database through a webservice (a third party).
My first issue is what data type of parameter should I use. In my add method I could be adding a contact, or some other type. These are my own custom types (classes). Should I use System.Type as the parameter data type? Also, in my search method I want to pass a list of my own custom types. I use my own List(of Customer) for this one, but how can I make it so that it will accept a list of any types?
The second issue is about my search method as well. I want to pass back a list of results that are custom types as well. In the one I am working on right now, it is a customer type, but it could be another type. How can I make this interface abstract enough to allow my method to return a list of any types?
I hope I have made my questions clear. If not, just ask and I will clarify anything. Thank you for your help.
BTW, I am using customer and contact interchangeably here.
Ben
Using Visual Basic 2005/2008
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
|