public class User {
private final String firstName;
private final String lastName;
private final LocalDate dateOfBirth;
}
public class UserService {
private final UserRepository userRepository;
public UserSerivce(UserRepository userRepository) {
this.userRepository = userRepository;
}
}
UserService depends on UserRespository and i would call UserRepository a dependency of UserService. in the User class i would never call the fields dependencies. why would you say class X is a dependency in one class, but other classes you might not call things dependencies. is it the purpose & functionality of the classes?