다른 api (facebook, google ...)에서 데이터를 가져 오는 API를 개발 중입니다. 내 생각은 모든 API에 대해 서로 다른 저장소를 만드는 것입니다. exampl의 경우 :다른 api에서 데이터 가져 오기
Interface ReaderRepositoryInterface
{
getEvents();
getComents()
}
class FacebookReaderRepository implements ReaderRepositoryInterface
{
getEvents()
{
//call the api facebook method
}
getComments()
{
//call the api facebook method
}
}
GoogleReaderRepository ...
모든 클래스 (FacebookReaderRepository, GoogleReaderRepository ...) 인프라하고 ReaderRepositoryInterface가 가지고있는 메소드를 구현합니다. 따라서 아이디어는 응용 프로그램 서비스가 특정 저장소에서 데이터를 가져 와서 얻은 정보로 엔티티를 생성하는 것입니다.
제대로 적용하고 있는지 알고 싶습니까?
이 언어를 사용하는 언어는 무엇입니까? –