Not able to understand todo in module 6

please explain these todos

1)// TODO: CRIO_TASK_MODULE_ADDITIONAL_REFACTOR
// Implement the method in such a way that it will return new Instance of PortfolioManager
// using RestTemplate and provider name.
// As a first step, Create appropriate instance of StoockQuoteService using
// StockQuoteServiceFactory and then use the same instance of StockQuoteService to create the
// instance of PortfolioManager.
// Mark the earlier constructor of PortfolioManager as @Deprecated.
// Test your changes using gradle command and make sur all of the tests pass.
// ./gradlew test --tests PortfolioManagerFactory

  1. // TODO: CRIO_TASK_MODULE_ADDITIONAL_REFACTOR
    // Modify the function #getStockQuote and start delegating to calls to
    // stockQuoteService provided via newly added constructor of the class.
    // You also have a liberty to completely get rid of that function itself, however, make sure
    // that you do not delete the #getStockQuote function.

3)// TODO: CRIO_TASK_MODULE_ADDITIONAL_REFACTOR
// Inplement the StockQuoteService interface as per the contracts.
// The implementation of this functions will be doing following tasks
// 1. Build the appropriate url to communicate with thirdparty.
// The url should consider startDate and endDate if it is supported by the provider.
// 2. Perform thirdparty communication with the Url prepared in step#1
// 3. Map the response and convert the same to List
// 4. If the provider does not support startDate and endDate, then the implementation
// should also filter the dates based on startDate and endDate.
// Make sure that result contains the records for for startDate and endDate after filtering.
// 5. return a sorted List sorted ascending based on Candle#getDate
// Call alphavantage service to fetch daily adjusted data for last 20 years. Refer to
// documentation here - https://www.alphavantage.co/documentation/
// Make sure you use {RestTemplate#getForObject(URI, String)} else the test will fail.
// Run the tests using command below and make sure it passes
// ./gradlew test --tests AlphavantageServiceTest

Hey @sudhanshu, Have an eagle eye on the following class diagram. This will reveal many many mysteries.

Reply if sky not clears!

Hey @sudhanshu i think flow diagram provided by @imbipulkumar will clear your doubts to an extent but for more clarification

these instructions are for todo 1

  • Create a instance of StockQuoteService using or by calling StockQuoteServiceFactory INSTANCE under getPortfolioManager function
  • and then use the same INSTANCE of StockQuoteService which you have created earlier to return the INSTANCE of PortfolioManager.

in todo no. 3 you have to modify create function getStockQuote() like you have defined in tiingoservice.java same to do in alphavantageservice.java so first read alphavantage api and then think about how you can write logic for which it will return list of candles.

1 Like

Closing this topic as there is no response since last 12 hours. Please feel free to create a new topic and post this question as a reference link in the description of the new topic.