In the last video we wrote a RESTful api to interface with a MongoDB database. In this video we will learn how to refactor our solution into a PersonController
class responsible to facilitating communication with our data resource.
Classes are usually the common way of encapsulating related logic in your software. They are useful for modularising the logic you write and Dart amkes this a breeze. I hope to demonstrate this a lot more in future articles.
At the end of this video you will be comfortable writing classes to handle HTTP requests and return the appropriate responses. This is a common pattern used by frameworks like Aqueduct and Angel.
Further reading
- Dart and MongoDB Tutorial #2: Implement a RESTful api to interface with our database
- Build a chat application in Dart (Part 2)
- Learn Dart #5: Read and write files in under 30 seconds
Sharing is caring 
If you enjoyed reading this post, please share this through the various social buttons hovering on the left/top side of the screen . Also, check out and subscribe to my YouTube channel (hit the bell icon too) for videos on Dart.
Subscribe to the newsletter for my free 35-page Get started with Dart eBook and to be notified when new content is released.
Like, share and follow me for more content on Dart.