Book Image

Learning Dart

Book Image

Learning Dart

Overview of this book

Table of Contents (19 chapters)
Learning Dart
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Dartlero tasks – a many-to-many model in MySQL


A one-table project is quite unrealistic; let us now revisit the dartlero_project_tasks application in Chapter 8, Developing Business Applications with Polymer Web Components. This has a many-to-many relationship between the concepts Project and Employee, Task being the intermediate concept; data is stored only in the browser's local storage. In the dartlero_tasks project (code can be cloned from https://github.com/dzenanr/dartlero_tasks), we have the same model built on Dartlero, but the data can be stored on the server either in the JSON format or in a MySQL database. The startup script for both the options is bin/dartlero_tasks.dart. The model and the data access layer are defined in library dartlero_tasks lib/model/darlero_tasks.dart.

The JSON storage

If you want to use the JSON file storage, you have to create a command-line launch for the bin/dartlero_tasks.dart script. In Run | Manage Launches of Dart Editor, enter two script arguments...