We need to add additional methods to those generated classes starting with repositories and services. To do so, we create additional classes for a better migration in the future JHipster release. For example,
@Entity
public Foo {...}
@Repository
public interface FooExtendedRepository extends FooRepository {...}
@Service
public FooExtendedService extends FooService {...}
where FooExtendedService definitely needs to use FooExtendedService. There are two approaches to have it. One approach is to have FooExtendedRepository in the FooExtendedService. The other approach is to change the FooRepository attribute to FooExtendedService in the FooService class and remove the @Repository annotation from the FooRepository. The first approach is straightforward with minimum code changes, but that will double the number of instances in the system. Which approach shall we use?