MVC in Dart

images/mvc/get_with_fetch.jpg

The foundation of our Hipster MVC library (of course that’s the name) will be collections of objects, not the objects themselves. The collection maps nicely onto REST-like web services, resulting in a clean API for adding, deleting, and updating records.

Hearkening back to the first chapter, our comics collection can be retrieved via an HTTP GET of /comics. In Hipster MVC parlance, we will call that a fetch.

With REST-like resources, we can also refer to /comics as the URL root because it serves as the root for all operations on the collection of individual records. This is shown in the following sketches.

Adding a new comic ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.