1つの考えがありましたが、これを実装する方法を理解できませんでした。
public class BaseDomain<T>{
//Generic methods goes here
}
public class Domain1 extends BaseDomain<Domain1>{
private int id;
private String name;
//only properties should be present here
}
public class Domain2 extends BaseDomain<Domain2>{
private int id;
private String name;
//only properties should be present here
}
上記のシナリオでは、基本クラスですべてのジェネリック メソッドを簡単に定義でき、ジェネリックを使用してすべてのドメイン クラスで使用できます。しかし、ここでの私の問題は、開発者がドメインクラスのプロパティのみを定義する必要があるメカニズムを設計したいことです(ゲッター/セッターなし)。
どんな提案でも大歓迎です!