-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathmvc.ats
65 lines (54 loc) · 1.38 KB
/
mvc.ats
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { Logger } from '../logger';
export class Student {
get Number():string {
return this.rollNo;
}
get Name():string {
return this.studentName;
}
set Name(name:string) {
this.studentName = name;
}
set Number(number:string) {
this.rollNo = number;
}
}
export class StudentView {
constructor() {
this.logger = new Logger();
}
printStudentDetails(name:string, number:string) {
this.logger.log("Student:");
this.logger.log("Name:" + name);
this.logger.log("Roll no:" + number);
}
}
export class StudentController {
constructor(model:Student, view:StudentView) {
this.studentModel = model;
this.studentView = view;
}
get StudentName():string {
return this.studentModel.Name;
}
get StudentNumber():string {
return this.studentModel.Number;
}
set StudentName(name:string) {
this.studentModel.Name = name;
}
set StudentNumber(number:string) {
this.studentModel.Number = number;
}
updateView() {
this.studentView.printStudentDetails(this.studentModel.Name, this.studentModel.Number);
}
}
export class DBManager{
retriveStudentFromDatabase():Student{
var student = new Student();
student.Name = "Robert";
student.Number = "10";
return student;
}
}