vendredi 22 avril 2016

Object added to view model inherits from seperate model project does it break MVVM to add reference?

I have (many more than, but restricting focus to) two class libraries for the model, and another library for view models.

One of the libraries is named Condenser, and has a class called WaterCooledCondenser, which inherits from the HeatExchanger class in the Subcomponents project. The condenser is business logic, but it was designed for the view model to interact with (it is part of the Model). When I create a new Condenser in the view model it says that HeatExchanger is not referenced, and to add a reference to Subcomponents... I don't think the view model has any business knowing anything about the classes in that library, they are only meant to provide structure to the Model.

Would adding a reference to the class library violate MVVM? Is there another way around having the view model know anything about the structure of the model?

Aucun commentaire:

Enregistrer un commentaire