OK, interesuje me sledeca stvar. Da li koristiti intefejse u .NET kao u COM-u? Znaci, da bi ocuvali backward compatibility, deklarisati svaki put novi interfejs kada se pojavi potreba za novom funkcionalnoscu
Primer
Pa tako nikad direktno ne koristiti klase nego interfejse u kodu gde je potrebna ta funckionalnost, recimo assembly1
assembly2
Ili jednostavno deklarisati novu metodu u klasi
Primer
Code:
interface IMyClass
{
void Foo()
...
}
interface IMyClass2
{
void Foo()
...
}
...
interface IMyClass
{
void Foo()
...
}
interface IMyClass2
{
void Foo()
...
}
...
Pa tako nikad direktno ne koristiti klase nego interfejse u kodu gde je potrebna ta funckionalnost, recimo assembly1
Code:
...
IMyClass = MyClassFactory.GetMyClass()
...
IMyClass = MyClassFactory.GetMyClass()
assembly2
Code:
...
IMyClass2 = MyClassFactory.GetMyClass2()
...
IMyClass2 = MyClassFactory.GetMyClass2()
Ili jednostavno deklarisati novu metodu u klasi
Code:
class MyClass
{
void foo();
void Foo2()
}
class MyClass
{
void foo();
void Foo2()
}