Search code examples
model-view-controllermodelscoupling

MVC coupling between models


Can a model depend on another model? Say I have a log model that other models want to access.


Solution

  • If it's between models that model the same part of the domain but are intended for different purposes (you mentioned logging, others would be reporting) there should be as little coupling as possible. Not to say that there should be none.

    If the models model different parts of the domain coupling should be fine. If you notice your models are overlapping you should refine your context-/model- boundaries.