PM

PMは、PresentationModelという表示などに特化したModelが、ViewとModelの間に入るような手法。

MVCモデルの問題点を解決するPMモデルとMVPモデル - GeekなNooblog

1と2を渡して実行した場合は、足した結果が0以上なので数式を囲む記号としては"()"が使われる。
しかし、1と-2では、0未満なので記号"<>"が使われるという処理が、PresentationModelに入ってる。

class_custom_view::notify()
class_view::notify()
class_custom_controller::changed()
class_custom_model::func(1, 2)
class_model::notify()
class_custom_presentation_model::changed()
()
class_presentation_model::changed()
class_presentation_model::notify()
class_custom_view::changed()
(1 + 2 = 3)
class_view::changed()
custom_view_ptr->result_ = 3
class_custom_view::notify()
class_view::notify()
class_custom_controller::changed()
class_custom_model::func(1, -2)
class_model::notify()
class_custom_presentation_model::changed()
<>
class_presentation_model::changed()
class_presentation_model::notify()
class_custom_view::changed()
<1 + -2 = -1>
class_view::changed()
custom_view_ptr->result_ = -1

記号が変わった。

Sample/designpattern/pm/pm/src/pm at master · bg1bgst333/Sample · GitHub