سؤال

is this a valid use case?

For example to access a calendar from multiple sources, such as facebook or google. Whereby each of these have their own strategies to call the underlying specific APIs?

Due to the use of APIs and not a lower level algorithm would this be more suited towards a DI approach?

Thanks

هل كانت مفيدة؟

المحلول

I think that's a reasonable approach to take. You basically abstract away the underlying implementation with your interface and can either grab your implementation through an abstract factory, DI, or just a basic map of strategies.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top