摘要
界面逻辑和业务逻辑的功能是比较独立的,在某些情况下应该将其分离,降低耦合度。分离的方法很多,本文将充分利用虚函数或纯虚函数的特性,隔离具体的业务处理细节,减少两者间的交互。下面将结合模拟MessageBox的实现介绍界面逻辑与业务逻辑分离的具体作法。
The interface logic and business logic function is relatively independent, and in some cases, it should be separated to reduce coupling. There are many ways of separation, the paper would make full use of the characteristics of virtual function or pure virtual function, isolates the details of specific business processes, and reduces their interaction. The following introduces the separation of interface logic and business logic of the specific approach with the realization of analog MessageBox.
出处
《电脑学习》
2010年第1期108-110,共3页
Computer Study