Chapter 11Project: Varying Behavior

Those of us coming from a dynamic language background expect to be able to perform all manner of crazy hackery at runtime. Not satisfied with changing a response based on state, we like to change implementation.

In JavaScript, for instance, it is possible to replace the method on an object’s prototype at any time. In Ruby, we can replace a function with a lambda. We revel in metaprogramming and cry foul when newbies look at it as magic.

In Dart, there are far fewer opportunities for magic. But it is still possible. To explore this topic, we again return to our comic book catalog application. This time, we will replace the Ajax back-end calls with in-browser storage.

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.