Challenge: Solution Review
This lesson will explain the solution to the problem from the previous coding challenge.
We'll cover the following...
We'll cover the following...
Solution #
Explanation
The challenge requires you to use the MVP pattern to implement an email sending system. Hence, it has three components, the model, the view, and the presenter. Let’s discuss them one by one.
Model
class Model{
constructor(){
this.senderName = "";
this.receiverName = "";
this.emailTitle = "";
}
setSenderName(senderName){
this.senderName = senderName;
}
getSenderName(){
return this.senderName;
}
setReceiverName(receiverName){
this.receiverName = receiverName;
}
getReceiverName(){
return this.receiverName;
}
setEmailTitle(emailTitle){
this.emailTitle = emailTitle;
}
getEmailTitle(){
return this.emailTitle;
}
}
...