mercredi 14 novembre 2018

Best practices and/or patterns to keep model up-to-date? [on hold]

I would appreciate if you tell me whether there are any best practices and/or patterns that can help us to keep our view models up-to-date.

Consider some domain model:

public class Genre {
    private String name;
    //...
}

public class Author {
    private String name;
    private List<Genre> genres;
    //...
}

public class Article {
    private String name;
    private Genre genre;
    private Author author;
    //...
}

Suppose that user opens an AuthorDetailsView, let's avoid a view model and look at model:

public class AuthorDetailsModel {
    private Author author;
    private List<Article> articles;
    //...
}

After that another user changed a name of some Genre that related to the author and some articles from the list. Are there any best practices / patterns that I can use to keep the model up-to-date in that case?

Aucun commentaire:

Enregistrer un commentaire