On 2012-12-03 11:20, Paulo Pinto wrote:

When coding against interfaces, it is always a good decision not to try
to get back the object.

The main idea about using interfaces in first place is to have behavior
independent of whatever class might implement it. If someone is trying
to get back the implementation of a given interface, it is because the
design is not sound in first place.

Well, one would might think that this would work:

interface I {}

class A : I {}

void main ()
{
    I i = new A;
    Object o = i;
}

But it doesn't.

--
/Jacob Carlborg

Reply via email to