0 votes
in Design Patterns by
Consider a scenario where you are writing classes for providing market data and we have the flexibility to switch to different vendors or we can be directed to the Direct Exchange Feed. How will you approach this problem to design the system?

1 Answer

0 votes
by

We can do this by having an interface called “MarketData” which will consist of the methods required by the Client. The MarketData should have the MarketDataProvider as the dependency by employing Dependency Injection. This ensures that even if the provider changes, the market data will not be impacted.

The implementation of this problem is left as an exercise to the reader.

Related questions

+1 vote
asked Sep 20, 2022 in Business Skills Track by john ganales
0 votes
asked Nov 11, 2022 in Power System by Robin
...