I wouldn't say this is better, especially in an environment like .NET.
Because you only have single inheritance, using a base class means that you
force the implementer to burn the base, which isn't exactly good design.
When requiring an implementation of a contract from external sources, I
would say you should always take an interface. You can provide an abstract
base class which implements the interface to make things easier, but an
interface should always be preferred.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Pop Catalin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> There might be a better way, from the versioning and upgradability's
> point of view, wich is to use an abstract base class instead of an
> interface if this is posible. Using an abstract class instead of an
> interface allows ading new members (but not abstract, only virt or non
> virt) without beaking posible implentations of the class wich you might
> not now about(it there will ever be the case).
>
> Firefly wrote:
>> Hi,
>>
>> I have a C++ background and am new to C#.
>> At the moment I'm working on a project where I want to define a contract
>> for
>> users of my library. I have done this by creating a interface dll project
>> containing the contract for the clients. To implement the interface I
>> created
>> a second dll project that contains the implementation. The interface has
>> an
>> assync design. It also has a factory that, based on configuration data,
>> can
>> load different implementation assemblies. This is transparent for the
>> client
>> and the reason for doing so is that the implementation is very
>> computational
>> heavy and might need to be done on a separate machine e.g. with .NET
>> remoting. Having the contract defined in this manner means I can easily
>> replace the implementation without the client knowing.
>>
>> Is there a better way of doing this in C#?
>>
>> Filip
>