ASP.NET AJAX Client Library Question And Answer Series – Question 1
I recently received an email from a person who had viewed my ASP.NET AJAX Client Library series. The email contained 22 questions centered around our AJAX Client Libraries. As these were excellent questions, most requiring more than one line responses, I decided to do a blog entry for 1 or 2 questions daily until I have completed the list. If you would like me to answer your questions, please add them to the list by emailing me. So today, I am going to start the process:
Question 1: Can interfaces inherit from other interfaces?
So, now that we have illustrated to you that interfaces exist and how to create a simple interface, lets get back to the question. In C#, interfaces can inherit from other interfaces. The implementing class must adhere to the contacts of the complete transitive closure of the explicit base interfaces. Is this possible in ASP.NET AJAX Client Libraries? The answer is no. We can validate this by looking at the registerInterface signature here:
As you can see, there is no means to pass a base interface type. However, you are free to implement as many interfaces as you would like within a class.