Learning Dart
上QQ阅读APP看书,第一时间看更新

What this book covers

Learning Dart has 12 chapters. It begins with basic elements of Dart and it ends with a client/server application that uses MongoDB (http://www.mongodb.org/) for data persistence on the server side.

Chapter 1, Dart – A Modern Web Programming Language, helps you understand what Dart is all about. Dart is presented as a major step forward in the web programming arena.

Chapter 2, Getting to Work with Dart, lets you get a firm grasp on how to program in Dart. The code and data structures in Dart, and its functional principles, are explained by exploring practical examples.

Chapter 3, Structuring Code with Classes and Libraries, lets you understand how to use Dart classes to organize code. Dart libraries are introduced to show how complex software may be packaged.

Chapter 4, Modeling Web Applications with Model Concepts and Dartlero, enables you to design a small model graphically in the Model Concepts tool, which is developed in Dart. A model is then represented in Dart as several classes that inherit some data and operations from classes of the Dartlero model framework, also developed in Dart.

Chapter 5, Handling the DOM in a New Way, helps you to learn how to access HTML elements in Dart. Some elements will even be created in Dart and placed properly in the Document Object Model (DOM) of a web page. Dart will also handle user events, such as a click on a button. Finally, you will be able to create a simple game in Dart.

Chapter 6, Combining HTML Forms with Dart, lets you enter data in a form that will be validated by HTML5 and Dart. Then, the valid data will be saved in the local storage of a browser.

Chapter 7, Building Games with HTML5 and Dart, lets you create, step-by-step, a well-known memory game based on what you have learned already. Each step will be a new spiral represented as a complete project in Dart Editor. The first spiral will draw only a rectangle, while the last spiral will be a game that you may show to your friends.

Chapter 8, Developing Business Applications with Polymer Web Components, helps you to create several web components by using Polymer.dart. Those web components will be used in different sections of a single-page application. Three different projects with web components will be presented in this chapter.

Chapter 9, Modeling More Complex Applications with Dartling, explains how a graphical model can be transformed into a JSON document and then used to generate a complete model in Dart, by using the Dartling domain model framework together with its tools. Dartling follows the Model View Controller (MVC) pattern to separate a model from its views.

Chapter 10, MVC Web and UI Frameworks in Dart – An Overview, introduces you to different frameworks already developed in Dart. Because Dart is a brand new language, those frameworks are at early stages of their useful life.

Chapter 11, Local Data and Client-Server Communication, explains how you can store application data in a local database named IndexedDB, which will then be sent as a JSON document to a Dart server. Asynchronous programming with futures will also be covered in this chapter.

Chapter 12, Data-driven Web Applications with MySQL and MongoDB, explains how you can use database drivers to save (and load) data to (and from) a relational database and a NoSQL database. Data sent from a browser as a JSON document will easily be saved in MongoDB in the same JSON form. Two clients will exchange data with the server so that both of them will be up-to-date.