万本电子书0元读

万本电子书0元读

顶部广告

Learning Dart - Second Edition电子书

售       价:¥

6人正在读 | 0人评论 9.8

作       者:Ivo Balbaert

出  版  社:Packt Publishing

出版时间:2015-09-25

字       数:272.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Learn to develop high performance applications with Dart 1.10 About This Book Develop apps for the modern web using Dart and HTML5 Clarify and shorten your Dart code using enums Build a complex UI for business applications with Dart's Polymer framework, based on web components Who This Book Is For If you want to become a developer for the modern web, or wish to add Dart to your tool belt, then this book is for you. The book assumes you have basic HTML experience and know how web applications work. Some previous programming experience, preferably in a modern language like C#, Java, Python, Ruby or JavaScript, will give you a head start. You can work with Dart on your preferred platform, be it Linux, Mac OS X or Windows. What You Will Learn Structure your code using functions, classes, generics, packages and libraries Use the power of modern browsers to process and store data Make games by drawing, and using audio and video in the browser Develop an application with a model-driven and spiral-paced approach Discover the Observatory tools for profiling memory and CPU usage of Dart programs Store your app's data in MySQL and MongoDB through Dart Build powerful HTML5 forms, validate and store data in local storage, and use web components to build your own user interface Run your Dart server on an App Engine Managed VM In Detail Dart is an open source programming language for the web, developed at Google, with a steadily growing community. It is a single language for both client and server, appropriate for the full range of devices on the web – including phones, tablets, laptops, and servers. It encompasses the lessons of the last two decades of web programming. This book will give you a thorough overview of Dart, taking you through its ecosystem, syntax, and development principles. With this book, you will build web games using HTML5, audio, and video, and also dive into processing and displaying data in HTML5 forms with Dart. You will also learn how web components fit together with HTML5, and how to apply them in business web applications of the future. You will discover how to store data on the client, communicate data between client and server with JSON, and store JSON data with MongoDB and MySQL. Stop solving new challenges with the same old tools – let Dart show you a whole new way. Style and approach This book provides you a project-based approach, with everything you need to start or enhance your career in the future of web development with Dart. It follows the spiral approach: each project builds up in successive spirals, adding new features in each step.
目录展开

Learning Dart Second Edition

Table of Contents

Learning Dart Second Edition

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

The spiral approach

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Dart – A Modern Web Programming Language

What is Dart?

Dart is a perfect fit for HTML5

A very short history of web programming

Dart empowers the web client

JavaScript is not the way to go

Google, GWT, and Dart

Advantages of Dart

Getting started with Dart

Installing the Dart Editor

Other options for working with Dart code

Your first Dart program

Getting a view on the Dart tool chain

The Dart execution model

A bird's eye view on Dart

Example 1 – raising rabbits

Extracting a function

A web version

Example 2: banking

Making a to-do list with Dart

Summary

2. Getting to Work with Dart

Variables – to type or not to type

Built-in types and their methods

Conversions

Operators

Some useful String methods

Dates and times

List

Maps

Documenting your programs

Changing the execution flow of a program

Using functions in Dart

Return types

Parameters

First class functions

Using enums

Recognizing and catching errors and exceptions

A debugging exercise

Summary

3. Structuring Code with Classes and Libraries

A touch of class – how to use classes and objects

Visibility – getters and setters

Types of constructors

Named constructors

Factory constructors

The const constructors

Inheritance

Abstract classes and methods

The interface of a class – implementing interfaces

Polymorphism and the dynamic nature of Dart

Collection types and generics

Typing collections and generics

The collection hierarchy and its functional nature

Structuring your code using libraries

Using a library in an app

Resolving name conflicts

Visibility of objects outside a library

Managing library dependencies with pub

Unit testing in Dart

Asynchronous programming with async and await

Project – word frequency

The Observatory tool

Summary

4. Modeling Web Applications with Model Concepts and Dartlero

A short introduction to Git and GitHub

Creating a repository on GitHub and a local version

Collaborating on a GitHub project

What is a model and why we need it in programming

Model Concepts – a graphical design tool for our models

Working with model concepts

Explaining the model

Drawing the model

Exporting the model

What is JSON?

Dartlero – a simple domain model framework

An example of using Dartlero

The categories and links application

Summary

5. Handling DOM in a New Way

Finding elements and changing their attributes

Finding elements

Changing the attributes of elements

Creating and removing elements

Handling events

Manipulating the style of page elements

Animating a game

Ping Pong using style(s)

How to draw on a canvas – Ping Pong revisited

Spiral 1 – drawing a circle and a rectangle

Spiral 2 – colored circles and rectangles

Spiral 3 – moving a ball

Spiral 4 – reorganizing the code

Spiral 5 – a bouncing ball

Spiral 6 – displaying the racket

Spiral 7 – moving the racket using keys

Spiral 8 – moving the racket using the mouse

Spiral 9 – a real game

Spiral 10 – title and replay

Spiral 11 and the master version

Summary

6. Combining HTML5 Forms with Dart

Spiral 1 – the power of HTML5 forms

Spiral 2 – how to validate data with Dart

Validation in the model

Spiral 3 – how to store data in a local storage

Spiral 4 – reading and showing data

Spiral 5 – changing and updating data

Spiral 6 – working with a list of bank accounts

Summary

7. Building Games with HTML5 and Dart

The model for the memory game

Spiral 1 – drawing the board

Spiral 2 – drawing cells

Spiral 3 – coloring the cells

Spiral 4 – implementing the rules

Spiral 5 – game logic (bringing in the time element)

Spiral 6 – some finishing touches

Spiral 7 – using images

Adding audio to a web page

The Collision Clones game

Adding video to a web page

Summary

8. Developing Business Applications with Polymer Web Components

How web components change web development

Web components with Polymer.dart

Declaring and instantiating a web component

Two-way data binding in Polymer.dart

Creating the web_links project

Spiral s01

Spiral s02

Spiral s04

Spiral s05

Spiral s06

Using Polymer for the category links project

Adding local storage

Applying web components to the project tasks app

The Add and Remove task propagations

Summary

9. Modeling More Complex Applications with dartling

The dartling domain modeling framework

Design of the Travel Impressions model in spirals

Generating the Travel Impressions code from the model

Initializing the Travel Impressions model with data

Testing the Travel Impressions model

Defining and using the MVC pattern

The TodoMVC app

Spiral 0 – generating a class model

Spiral 1 – adding todo tasks

Spiral 2 – showing how many todo tasks are left

Spiral 3 – removing a single task and completed tasks

Spiral 4 – saving in the local storage

Spiral 5 – displaying completed todos

Spiral 6 – editing a task and testing the model

Summary

10. Local Data and Client-Server Communication

The options for browser storage

Asynchronous calls and Future objects

Using IndexedDB with Dart

Spiral s00

Spiral s01

Spiral s02

Spiral s03

Spiral s04

Spiral s05

Using Lawndart

A Dart web server

Using JSON web services

Spiral s07

Summary

11. Data-Driven Web Applications with MySQL and MongoDB

Database drivers for Dart

Storing todo data in MySQL

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

The JSON storage

MySQL storage

MongoDB – a NoSQL database

Using the mongo_dart driver to store the todo data in MongoDB

Running a Dart server on an App Engine Managed VM

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部