Is “using active record pattern” a reason to inherit from standard container (eg:vector)?
According to Is it bad practice to use Inheritance to associate methods with a basic container?, I know it is bad to inherit form std containers, mainly because std containers are not designed to be inherited.
Is “using active record pattern” a reason to inherit from standard container (eg:vector)?
According to Is it bad practice to use Inheritance to associate methods with a basic container?, I know it is bad to inherit form std containers, mainly because std containers are not designed to be inherited.
Modeling value object when fields’ existence depends on state of other fields
I am practicing tactical DDD and having trouble as exemplified below. Fundamentally, whether some fields of the value object should be nullable depends on another field of the same value object. Consider the following value object and enum (C#):
Modeling value object when fields’ existence depends on state of other fields
I am practicing tactical DDD and having trouble as exemplified below. Fundamentally, whether some fields of the value object should be nullable depends on another field of the same value object. Consider the following value object and enum (C#):
“use auto” and “declare most abstract type”, which guideline has higher priority?
According to Why define a Java object using interface (e.g. Map) rather than implementation (HashMap), I know I should declare most abstract type when possible, for example, suppose I’m using an UI engine which has BlinkLabel that has a speific method setBlinkTime(), and extends from Label, they used to display some text on the screen:
“use auto” and “declare most abstract type”, which guideline has higher priority?
According to Why define a Java object using interface (e.g. Map) rather than implementation (HashMap), I know I should declare most abstract type when possible, for example, suppose I’m using an UI engine which has BlinkLabel that has a speific method setBlinkTime(), and extends from Label, they used to display some text on the screen:
Is it ok to extend utilities?
Apache Commons has StringUtils
. It’s great, but I wish it had a shuffle()
method or similar
Is it ok to extend utilities?
Apache Commons has StringUtils
. It’s great, but I wish it had a shuffle()
method or similar
Define API for multiple concrete implementations
I try to implement multiple concrete classes, which share the same API. The base functionalities between these classes are the same, but they support different types of configuration (among shared ones). I would like to keep the implementation between these concrete classes as separate as possible.
If class B extends A, can we say that B depends on A?
Let’s say we have 2 (Java) classes: