Manidle / Final-BackEnd

0 stars 2 forks source link

[BackEnd] 한 service 클래스에 여러가지 repository가 있는 것이 부자연스럽습니다 #4

Open soulchicken opened 2 years ago

soulchicken commented 2 years ago

지금 작성한 StayLikeService 클래스의 경우

@Service
public class StayLikeService {
    @Autowired
    private StayLikeRepository stayLikeRepository;

    @Autowired
    private StayRepository stayRepository;

    @Autowired
    private UserRepository userRepository;

한 클래스에 다른 여러 repository 객체를 가져오게 됩니다. 차라리 다른 service에 요청을 해서 결과를 가져오면 어떨까 합니다.

95Glory commented 2 years ago

차주 예정되어있던 Code Refactoring 시간에 해당 안건에 대해서 적용해보면 좋을것 같습니다.

soulchicken commented 2 years ago

객체의 순환참조가 있어서 일단은 이대로 가야할 것 같습니다. 우선순위에 밀리는 일이기 때문에 추후에 여유있을 때 작업 들어가면 될 것 같습니다.