Discussion of article "MVC design pattern and its application (Part 2): Diagram of interaction between the three components"

 

New article MVC design pattern and its application (Part 2): Diagram of interaction between the three components has been published:

This article is a continuation and completion of the topic discussed in the previous article: the MVC pattern in MQL programs. In this article, we will consider a diagram of possible interaction between the three components of the pattern.

The resulting Controller method which is called in the OnChartEvent handler of the main indicator file looks as follows:

void CController::ChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam) {

      switch (id) {
         case CHARTEVENT_OBJECT_CLICK:
            if (StringCompare(sparam, pBtn.GetName()) == 0) {
               if (pView.GetViewType() == LINE)
                  pView.SetNewViewType(HISTO);
               else pView.SetNewViewType(LINE);   
            }
            break;      
        default:
            break;    
      }//switch (id)
}


The method checks whether the mouse was clicked on the right object, and then it switched the display mode in the View:

It was quite easy and quick to add the relevant changes. If we had to perform similar changes a year later, it wouldn't take much longer. The developer remembers the structure of the script and what is done in each of the components. So, the project is easy to maintain even if documentation is lost or if you forget the project principles.

Author: Andrei Novichkov

 

There's a lack of inferior bar on the horizontal visualization of Metatrader 5 for cell phone. The bar whose shows "Quotes,/Charts/Trade/History/Messages" doesn't is accessible from the horizontal view of screen. The utilizer needs to turn up the smartphone 📲 in order to access the "Quotes/Chart/Trade/History/Messages" bar.

The video can specify what I'm saying.


Reason: