ViewModel (interface)

Indicates that an object belongs to the UI/application layer, and is intended to be used as a view model.

Objects that are part of the domain object layer should instead implement RecreatableDomainObject .

API

ViewModel.java
interface ViewModel {
  String viewModelMemento()     (1)
  void viewModelInit(String memento)     (2)
}
1 viewModelMemento()

Obtain a memento of the view model.

2 viewModelInit(String)

Used to re-initialize a view model with a memento obtained from #viewModelMemento() .

Members

viewModelMemento()

Obtain a memento of the view model.

Typically this will be the identifier of a backing domain entity, but it could also be an arbitrary string, for example a bunch of JSON.

This method is called by the framework in order that the view model may be recreated subsequently through #viewModelInit(String) .

viewModelInit(String)

Used to re-initialize a view model with a memento obtained from #viewModelMemento() .