-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
38 lines (32 loc) · 1.05 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using mvp_in_csharp.data;
using mvp_in_csharp.messages;
namespace mvp_in_csharp
{
class Program
{
const string SAVING_FILE_PATH = "./messages.json";
// Because users only interact with view, so only it should be declared as a global variable
IMessagesView view;
static void Main(string[] args)
{
Console.WriteLine("=== MESSAGE MANAGER ====");
Program program = new Program();
program.SetUp();
IMessagesView view = program.view;
// Users ask to open menu screen
view.OnRequestedToShowMenu();
}
void SetUp()
{
// Model
InFileSavingHelper fileSaveHelper = new InFileSavingHelper(new FileParser(), SAVING_FILE_PATH);
LocalMessageDataSource localDataSource = new LocalMessageDataSource(fileSaveHelper);
MessageRepository repository = new MessageRepository(localDataSource);
// View
view = new MessagesView();
// Presenter
IMessagesPresenter presenter = new MessagesPresenter(repository, view);
}
}
}