impossible right? Other than breaking Foo apart in...
# android-architecture
u
impossible right? Other than breaking Foo apart into composition of the 3 object which provide a(), b(), c(); and then when using ComposedFoo just include those as well and stick my method where I need. Which is annoying since lets say a, b, c are few lines, not worth extracting like that; and not even sure what the names would be, annoying...
w
I’d probably make a(), b(), and c() parameters of bar rather than constant values. That way, if you want to replace b() with d(), you call bar(b = d() ) and a and c are laid out as expected, but d replaces b
that felt extremely confusing to read. 🙂
u
not sure if such things should be public api for callers to tinker with possibly
w
you could also put an optional d, that goes between b and c? It’s tough to say without knowing more specificity. On our team, we’ve made the tenant that anything that isn’t mandatory for the Composable to work correctly should be an optional parameter. If you don’t want it to be a part of your interface, you could have foo be a private class, and make public fooStandard() and fooWithD()