组件技术之microsoft COM技术,设计模式,面向对象设计思想,XML技术
已解决问题:
1.接口定义以及作用:接口是为实现一定功能的一组函数定义集合例如
interface IMyInterface
{
void f1();
viud f2(int i); //只是定义,为了实现功能,具体实现由类实现
...
}
2.有了继承,能够使得同样的代码作用于不同的组件,例如
interface IX
{
void fx1();
void fx2();
}
interface IY
{
void fy1();
void fy2();
}
class CA
{
void fy1(){do something here ;}
void fy2(){do something here ;}
void fx1()(){do something here ;}
void fx2(){do something here ;}
}
pCA = new CA();
IX pIX ;
IY pIY;
pIX = pCA;
pIX.fx1();
pIY = pCA;
pIY.fy1();