My background is C++. I'm not familiar with declaring methods with the
base class name followed by a dot, and the method name.
the dotted notation is only to avoid naming conflicts .. you can define an
interface at file scope or class-nested, and you can use the visibility
modifiers
So my guess is that you are saying that IHttpModule implements a
pure-virtual method Displose(), which the derived class must implement
(even if the implementation does nothing). But I would have thought that
could be accomplished without prefixing the method name with base class
name.
IHttpModule implements nothing; it declares the method signatures and says,
if you use this interface, **you** must implement the methods, properties
and events in the interface
Doesn't it implement IHttpModule using inheritance? So I don't get why
it's not possible to provide some sort of access to base class methods
that were previously protected. Apparently, that's not happening here but
I don't see what your statement "there were no methods to expose" is based
on.
because, in effect, there is nothing to inherit other than the method
signatures ... if you looked at the source for IHttpModule, you'd see
something like:
interface IHttpModule
{
void Dispose();
void Init(HttpApplication context);
}
that's it .. so what kind of "access to base class methods" is meaningful in
any way?
In C++, it seemed like an interface was just a logical construct and was
really no different from a virtual class. Obviously, C# is different.
Looks like I don't get how. Yes, I understood the "I" prefix denoted an
interface.
interfaces and abstract classes share common ground, although a method in an
abstract class can have implementation; often you can take your choice of
which to use
interfaces are easy to understand in formal terms; in functional and
conceptual terms it takes a fair amount of work/time to fully grasp why they
exist and the ways they're useful ... I'm not fully there yet but I know you
have to get there if you're going to lay claim to anything resembling
"expertise" .. they're important, period.
I would recommend something to read but frankly I have seen nothing yet
which does a really good job covering the topic ... best bet I think would
be Jeff Richter's "CLR via C#" ... which is something you should own and
read in any case ... that said, there is of course a ton of material
available
Coming from C# you might also go to
http://www.charlespetzold.com and look
for the link to his free PDF book written just for people coming from C++