796 reputation
47
bio website linkedin.com/in/eriksperling
location Beijing, China
age 43
visits member for 4 years, 3 months
seen Mar 2 at 7:54

Addicted to programming since my nice parents got me a C64 in '83. Running a small consulting company with a friend, doing programming work for hire. Primarily working with C++ and Java, on Windows, OS X and Linux.

https://www.linkedin.com/in/eriksperling


Feb
18
awarded  Nice Answer
Feb
18
answered What have you learned from the bugs you helped discover and fix?
Feb
18
awarded  Supporter
Feb
18
answered Was Java originally designed for a toaster?
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris: I completely agree on the indication of wrong abstraction, and I wouldn't choose this as a design. My answer is more focused on the "redesign" context, where my primary goal would be to make an existing design extensible without breaking anything or requiring large amounts of changes. I think we're basically agreeing on how this can/should be solved, but answer based on different primary goals.
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris: On the topic of shared state, this is IMO an acceptable tradeoff, as it is both easy to detect when the expected state is not provided to the P4 class, and there's a single rarely changing point (the primary loop) where you need to ensure that the state is passed to PBase subclasses.
Feb
15
comment designing classes with similar goal but widely different decisional core
@Steven Jeuris:Making such functions pure virtual would require changing all PBase subclasses, which I'd want to avoid. Sure, for 4 concrete classes, who cares, but for a more complex scenario with e.g. a few hundred subclasses, avoiding changes to all classes due to the requirements of one new subclass would be preferable. The "Context" mechanism mentioned below and the method I describe allow changing requirements with minimum modification of existing code.
Feb
15
awarded  Teacher
Feb
15
answered designing classes with similar goal but widely different decisional core