J
Jack Addington
Can 2 objects that are quite different but share a common interface be
casted to one another? I would like to have some generic code have a
ValidatorInstance and I would like a specific BusinessObject to also have
that instance. At some point when I decide that the generic object is going
to have the BO validations I want to sub the BO in as the validator?
ie)
Class A : AncA, ISomething, ISomethingElse, ICommon
Class B: AncB, IDifferent, ICommon
Class C
{
A ObjA = null;
}
Class D
{
B ObjB = new B( );
C ObjC = new C( );
someMethod( ){
objB.SomeAction;
objC.A = (A)objB; *** Is this legit?
objC.A.ICommonMethod( )
}
}
casted to one another? I would like to have some generic code have a
ValidatorInstance and I would like a specific BusinessObject to also have
that instance. At some point when I decide that the generic object is going
to have the BO validations I want to sub the BO in as the validator?
ie)
Class A : AncA, ISomething, ISomethingElse, ICommon
Class B: AncB, IDifferent, ICommon
Class C
{
A ObjA = null;
}
Class D
{
B ObjB = new B( );
C ObjC = new C( );
someMethod( ){
objB.SomeAction;
objC.A = (A)objB; *** Is this legit?
objC.A.ICommonMethod( )
}
}