Changes between Version 46 and Version 47 of mvc


Ignore:
Timestamp:
02/19/24 17:12:41 (9 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • mvc

    v46 v47  
    148148Usually the base objects are immutable, while the model that edits the objects is by definition mutable.
    149149One approach would be to create an adapter that takes the base model and maps an adapter around it. But for more complex base objects, the adapter tends to become unreadable very quick.
     150
    150151Instead we recommend to make a XModel for every base object X. The XModel then contains a set of YModels for all Y that are in X. Also the XModel attaches listeners to these YModels so that it can notify its listeners about changes in submodels. This way, XModel can deliver the proper YModel for contained objects without extra adapter code. XModel can also contain a getX() that returns a base object X from the current settings in the XModel.