所有公共方法是否都符合商业逻辑?
- if yes, how to deal with situation in which two objects need to communicate at lower design layer, and thus need some non-business methods to be public? (or is this antipattern?)
- if no, how to clearly distinguish between public and business public methods?
以下是我所知道的选择:
- create business logic interfaces (as Attila and ArjunShankar suggest)
#define BUSINESS
(in C++) and then use asBUSINESS void myMethod()
- not sure if it is good idea
还有别的可能吗?