DDD (Domain-Driven Design) : 특정 엔티티 서비스 내에서 다른 엔티티의 저장소를 참조 할 수 있습니까?특정 엔티티 서비스 내의 다른 엔티티 저장소를 참조 할 수 있습니까?
예를 들어 (I은 예 문맥 약간의 경우 미안 해요) :
학생 및 StudentAddress 기관
public class StudentService : ServiceBase<Student>, IStudentService {
private readonly IStudentAddressRepository _studentAddressRepository; // Is this reference valid?
private readonly IStudentRepository _studentRepository;
public StudentService(IStudentRepository repository, IStudentAddressRepository studentAddressRepository) : base(repository)
{
//... IoC
}
}
이 있다는 것을 알고는이 기준인가 StudentAddressRepository 또는 심지어 StudentAddress 엔티티에 대해서 유효합니까?
서비스는 무엇을하고 있습니까? – tomliversidge
'StudentService'는 "학생 저장소 * 및 *"에 "학생 저장소"가 있다는 것이 이상하게 보입니다. 나는 그것이 저장소가되어야한다고 생각하지 않는다. 그러나이 질문은 오히려 의견에 근거한 것입니다. –
죄송합니다. 제가 실수를. 정말 ServiceBase입니다. –