Advertisement
Arham-4

Liskov's Substitution Principle

Apr 24th, 2020
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1. final Supplier<Map<String, FlightNode>> flightNodesSupplier = new TextFlightNodesSupplier(flightNodesFileName, delimiterPattern); // What if I don't want to read from a file? Okay, we can use SQLFlightNodesSupplier instead of TextFlightNodesSupplier.
  2.  
  3. final Supplier<List<FlightQuery>> flightQueriesSupplier = new TextFlightQueriesSupplier(pathsToCalculateFileName, delimiterPattern); // What if I don't want to read from a file? Okay, we can use SQLFlightQueriesSupplier instead of TextFlightQueriesSupplier.
  4.  
  5. final PathOutputter pathOutputter = new InOrderPathOutputter(); // What if I don't want to print out Source -> Destination, but instead want Destination -> Source? Okay, just use ReverseOrderPathOutputter instead of this.
  6.  
  7. final OutputterType outputterType = new FileOutputterType(outputFileName); // What if I don't want to write the output to the file and instead to the Console? Okay, just do ConsoleOutputterType instead.
  8.  
  9. final Project3 project3 = new Project3(flightNodesSupplier, flightQueriesSupplier, pathOutputter, outputterType);
  10.  
  11. project3.execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement