MVC和条件格式 - 实施策略 [英] MVC and conditional formatting - strategies for implementation
问题描述
现在我正在编写一个模拟程序,该输出是根据某些因素进行格式化的。问题是在MVC架构中,条件格式在哪里发生?实现此功能的一些策略是什么?
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,我使用的平台在其GUI /前端执行中是相当赤裸裸的。要更改颜色和格式,需要更改格式化状态(非常像OpenGL)。
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).
推荐答案
问题是在MVC架构中,
哪里有条件格式化到
?
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.
示例:Exchange TIME和SALES ...我是其中的一个...
Example: Exchange TIME AND SALES... I ahve one of those...
该模型有一个条目,其中有一个flasgs字段,指示销售是否处于高,低,出价或询价等。
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.
这篇关于MVC和条件格式 - 实施策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!