Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. interface Question
  2. {
  3. ...
  4. }
  5.  
  6. interface Questions
  7. {
  8. int size();
  9. Question operator[](int index);
  10. }
  11.  
  12. interface Repository
  13. {
  14. //returns a random selection of up to total questions.
  15. Questions SelectRandomQuestions(int total);
  16.  
  17. //returns a Question object that represents the question in the database.
  18. Question AddQuestion(Question newQuestion);
  19.  
  20. //whatever other operations.
  21. ...
  22. }
  23.  
  24. class SQLiteManager : Repository
  25. {
  26. ...
  27. }
  28.  
  29. main()
  30. {
  31. var config = getConfigSomehow();
  32.  
  33. var repository = new SQLiteManager(config.sqliteconfig);
  34. var quizManager = new QuizManager(repository);
  35.  
  36. ...
  37. }
  38.  
  39. class APIRepository : Repository
  40. {
  41. ...
  42. }
  43.  
  44. main()
  45. {
  46. var config = getConfigSomehow();
  47.  
  48. var repository = new APIRepository(config.apidetails);
  49. var quizManager = new QuizManager(repository);
  50.  
  51. ...
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement