Relative Content

Tag Archive for maintainability

Persisting type in Java – should I be using flags?

Is there some specific piece of advice around persist values that indicate type? Specifically I want to know if I should persist a flag/state indicating the type in persistence or not. I get the feeling I’m forgetting/not understanding some core concept of OO or data modelling.

Persisting type in Java – should I be using flags?

Is there some specific piece of advice around persist values that indicate type? Specifically I want to know if I should persist a flag/state indicating the type in persistence or not. I get the feeling I’m forgetting/not understanding some core concept of OO or data modelling.

Is there a good way to communicate the intent that a class only contains referentially transparent methods?

My workplace mostly uses C# for writing code. I’m trying to figure out a good way to indicate that a class with referentially transparent methods is intended to be referentially transparent (i.e., given the same set of arguments, you will always get the same return value) for future maintainers. I’ve considered just using static classes for classes that are intended to only contain referentially transparent methods but received pushback from my colleagues as they prefer an approach to unit testing where all classes depending on are stubbed out which they use constructor DI to accomplish. I don’t see a disadvantage to not stubbing out referentially transparent functions for unit testing since they are almost always in-memory anyway but I’ve been unable to convince my colleagues of that.