The scenario i described above was from a real project I was on a few years ago.
The way I handled it (partially) was via the use of AOP. I also made use of dependency injection.
These two approaches combined managed to reduce the boilerplate to near zero.
Of course, in Java AOP means you have to take care to enable it in each part of the toolchain (build system, CDP, IDE ...) but it wasn't too bad.
I'm not sure which gang of 4 patterns I may have been using, and I don't care, but I do know that leaving it simple would have led to chaos, because I'd seen it happen before.
The scenario i described above was from a real project I was on a few years ago.
The way I handled it (partially) was via the use of AOP. I also made use of dependency injection.
These two approaches combined managed to reduce the boilerplate to near zero.
Of course, in Java AOP means you have to take care to enable it in each part of the toolchain (build system, CDP, IDE ...) but it wasn't too bad.
I'm not sure which gang of 4 patterns I may have been using, and I don't care, but I do know that leaving it simple would have led to chaos, because I'd seen it happen before.