c++ - Replacing a class with static members with something better -
let's have class , b both need use set of utility functions.
, here constraints:
- the instance of can access instance of b, instance of b can't access instance of (so putting functions in wouldn't work since b couldn't access them);
b shouldn't changed @ (it's requirement other team... means can't put functions in b).
.
with said seems we're left 1 option: create new class c contain our set of functions.
is there design pattern implement class c?
i'd prefer not using static functions class c.
any hint?
sounds need facade design pattern, or free standing functions operating on these instances of a , b:
namespace a_b_client_funcs { void foo(a& a, b& b) { } }
Comments
Post a Comment