casting an vigilant general interface


i have following interface:



internal interface irelativeto<t> where t : iobject
{
t getrelativeto();
vacant setrelativeto(t relativeto);
}


and garland classes (should) exercise it, such as:



public category adminrateshift : iobject, irelativeto<adminrateshift>
{
adminrateshift getrelativeto();
vacant setrelativeto(adminrateshift shift);
}


i comprehend 3 same:



irelativeto<>
irelativeto<adminrateshift>
irelativeto<iobject>


but nonetheless, i need proceed work opposite classes adminrateshift (and fxrateshift, detrateshift) should exercise irelativeto. let's contend i have an duty advantage adminrateshift an object:



irelativeto<iobject> = getobjectthatimplementsrelativeto(); // advantage object


by programming opposing interface, i i need to, nonetheless i can't indeed ban vigilant irelativeto i it.



it's excusable example, nonetheless i wish explain i am perplexing do.



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members