I got one thought, but not able to figure it out how to implement this.
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
}
In above scenario, easily I can define all generic methods in base class and can use in all my domain classes by using generics. But My problem here is I want to design a mechanisim by which developer's have to define only properties in a domain class(without getters/setters) however somehow BaseDomain should provide getters/setters dynamically to each domain.
Any suggestion greatly appreciated!