問題描述
抽象 ViewModel 在被繼承時是否被視為模型? (Is an abstract ViewModel considered a Model when it is inherited?)
If I have an abstract ViewModel (VM‑A), which is inherited by child ViewModels (VM‑B,C,D), is that ViewModel (VM‑A) considered a model of ViewModels?
Example: VM‑A is a "Shape" class contains x number of common properties, with abstract Calculate() method.
VM‑B is a "Circle" class, inheriting VM‑A, and the overrides Calculate to perform its own calculations using the common properties.
Is VM‑A considered a Model at that point?
‑‑‑‑‑
參考解法
方法 1:
No, it is considered a base ViewModel. The concept Model refers to either a domain model which represents the real state content (an object‑oriented approach), or the data access layer that represents that content (a data‑centric approach).
(by Bob.、Andrii Startsev)