Mam taki value object:
public final class TaskDescription {
private final String text;
private TaskDescription(String text) {
this.text = text;
}
public static TaskDescription create(String text, DescriptionLengthValidator textLengthDescriptionLengthValidator) {
var length= text.length();
var result = textLengthDescriptionLengthValidator.isCorrect(length);
if (result) {
return new TaskDescription(text);
}
throw new IllegalArgumentException("Wrong text length: " + length);
}
}
Czym według DDD jest ten DescriptionLengthValidator? Moim zdaniem to jest domain service. Kolejne pytanie, w jakim pakiecie powinienem trzymać ten intefejs i jego implementację? Czy ten intefejs to nie jest taki wewnętrzny port a jego implementacja wewnętrzny adapter?
99xmarcin99xmarcin99xmarcinteraz
, więc domyślnie chodzi o najnowszą wersję. To tak jak w obrazie dockerowym nie podajemy wersji, to by default bierzelatest
:P