What to Extract and What to Leave

For each of the collection, model, and view classes from Chapter 6, Project: MVC in Dart, we are now faced with the question of what to extract.

Collections: Everything but the Hard Stuff

As we did in Chapter 6, Project: MVC in Dart, we start with the core of the client-side MVC library: the collection. Since collections are loose code mappings to a REST-like back end, we ought to be able to extract much of ComicsCollection into a HipsterCollection superclass. Anything that is specific to comics books, such as the /comics URL, can stay in ComicsCollection. The rest (ideally) can move out to be reused with other REST-like back ends.

With everything else in HipsterCollection, ComicsCollection can be expressed ...

Get Dart 1 for Everyone now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.