Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Question
- {
- ...
- }
- interface Questions
- {
- int size();
- Question operator[](int index);
- }
- interface Repository
- {
- //returns a random selection of up to total questions.
- Questions SelectRandomQuestions(int total);
- //returns a Question object that represents the question in the database.
- Question AddQuestion(Question newQuestion);
- //whatever other operations.
- ...
- }
- class SQLiteManager : Repository
- {
- ...
- }
- main()
- {
- var config = getConfigSomehow();
- var repository = new SQLiteManager(config.sqliteconfig);
- var quizManager = new QuizManager(repository);
- ...
- }
- class APIRepository : Repository
- {
- ...
- }
- main()
- {
- var config = getConfigSomehow();
- var repository = new APIRepository(config.apidetails);
- var quizManager = new QuizManager(repository);
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement