O'Reilly logo

Dart 1 for Everyone by Chris Strom

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required