MVC and conditional formatting - strategies for im

2019-08-24 02:59发布

Right now I am writing a simulation program which output is formatted according to certain factors. The question is in a MVC architecture, where is the conditional formatting to be taken place? What are some strategies for implement this feature?

FYI, The platform I am using is rather bare-bone in its GUI/front-end execution. To change color and formatting, it requires a change to the formatting state (much like OpenGL).

1条回答
Deceive 欺骗
2楼-- · 2019-08-24 03:29

The question is in a MVC architecture, where is the conditional formatting to be taken place?

In the view. It is toally a view element. It may decide to do so based on some additional information in the model.

Example: Exchange TIME AND SALES... I ahve one of those...

The Model has an entry that has a flasgs field indicating whether the sale was at the high, low, at bid or ask etc.

The view uses this flags field to decide on additional coloring.

查看更多
登录 后发表回答