I would appreciate any advice on how to proceed in the following scenario. Let's see if I can explain this (English is not my native language, so everything can get confused, sorry).
Suppose I have the following interfaces:
internal interface IBlah
{
int Frob();
}
internal interface IBlahOnSteroids: IBlah
{
double Duh();
}
Now we have a Foo class with a 'has' relation to an IBlah object:
public class Foo
{
IBlah blah;
internal Foo(IBlah blah)
{
this.blah = blah;
}
public int Frob()
{
....
return this.blah.Frob();
}
}
Now we also need the FooOnSteroids class, which has a "has" relationship to the IBlahOnSteroids object. The question is, knowing that part of IBlahOnSteroids is already implemented in Foo, what happens if we create FooOnSteroids that inherits from Foo?
We would get something like this:
public class FooOnSteroids: Foo
{
IBlahOnSteroids blah;
internal FooOnSteroids(IBlahOnSteroids blah)
:base(blah)
{
this.blah = blah;
}
public double Duh()
{
return this.blah.Duh();
}
}
? "", ""
"" . , , BlahBase ,
IBlah , IBlah, BlahOnSteroids.
? Foo FooOnSteroids ( )? , , - . ?
, , , , , , , .NET 1.x.
BlahOnSteroids , , , , -
IBlahOnSteroids. .
!