singlepageappbook.com
11. Implementing associations: hasOne, hasMany
http://singlepageappbook.com/collections5.html
Single page apps in depth. Aka Mixu's single page app book. 11 Implementing associations: hasOne, hasMany. Associations / relationships are sugar on top of the basic data source implementation. The idea is that you can predefine the associations between models, for example, that a post hasMany comments. This might be described as:. Definition = { tags: Tags, comments: Comments }; }. Dbtag(post.comment ids, function. Dont pretend to have a blocking API. Comments = post.get( 'comments'. Id much rather opt ...
singlepageappbook.com
12. Views - Templating
http://singlepageappbook.com/views1.html
Single page apps in depth. Aka Mixu's single page app book. 12 Views - Templating. Whats in a template? I would classify templating systems not based on their input, but based on their output:. As functions and metadata. As objects with lifecycles. The simplest systems make string interpolation and array iteration more convenient. More complicated ones generate metadata that can be used as an input for other systems. The simplest templating system. Basetext, ' /div '. Sadly, in the real world very few te...
singlepageappbook.com
3.Getting to maintainable
http://singlepageappbook.com/maintainability2.html
Single page apps in depth. Aka Mixu's single page app book. In this chapter, Ill look at how the ideas introduced in the previous chapter can be applied to real-world code, both new and legacy. Ill also talk about distributing code by setting up a private NPM server. Lets start with a some big-picture principles, then talk about legacy - and finally some special considerations for new code. Todays new code is tomorrows legacy code, so try to avoid falling into bad habits. Next, have a look at your archit...
singlepageappbook.com
10. Implementing a data cache
http://singlepageappbook.com/collections4.html
Single page apps in depth. Aka Mixu's single page app book. 10 Implementing a data cache. There are three reasons why we want a data store:. To have a central mechanism for saving data. To retrieve cached models quickly. To prevent duplicate instances of the same model being created. The first two are obvious: we need to handle saving, and when possible, use caching to make unambiguous retrievals fast. The only clearly unambigous type of retrieval is fetching a model by id. Serializing models into JSON.
book.mixu.net
Distributed systems for fun and profit
http://book.mixu.net/distsys
For fun and profit. I wanted a text that would bring together the ideas behind many of the more recent distributed systems - systems such as Amazons Dynamo, Googles BigTable and MapReduce, Apaches Hadoop and so on. In this text Ive tried to provide a more accessible introduction to distributed systems. To me, that means two things: introducing the key concepts that you will need in order to have a good time. That information travels at the speed of light. That independent things fail independently*.
book.mixu.net
Distributed systems for fun and profit
http://book.mixu.net/distsys/abstractions.html
For fun and profit. 2 Up and down the level of abstraction. In this chapter, well travel up and down the level of abstraction, look at some impossibility results (CAP and FLP), and then travel back down for the sake of performance. Is a good example of this. Distributed programming is, Id assert, in large part dealing with consequences of distribution (duh! What do we mean when say X is more abstract than Y? First, that X does not introduce anything new or fundamentally different from Y. In fact, X m...
singlepageappbook.com
7. Implementing a data source
http://singlepageappbook.com/collections1.html
Single page apps in depth. Aka Mixu's single page app book. 7 Implementing a data source. In this chapter, I will look at implementing a data source. Defining a REST-based, chainable API for the data source. Lets start off by writing some tests in order to specify what we want from the data source we will build. Its much easier to understand the code once we have an idea of what the end result should look like. Given the following fixture:. Var fixture = [ { name:. Var db.user = new. User); done(); }); },.
singlepageappbook.com
4. Testing
http://singlepageappbook.com/maintainability3.html
Single page apps in depth. Aka Mixu's single page app book. The best way to make code testable is to start by writing the tests first - TDD style. Essentially, TDD. TDD is a set of rules for writing code: you write a failing test (red), then add just enough code to make it pass (green) and finally refactor where necessary (refactor). And perhaps Michael Feathers book. Before you write code. In most cases, you dont completely understand the system when you start writing it. Writing something once prod...
singlepageappbook.com
5. What's in a View? A look at the alternatives
http://singlepageappbook.com/detail1.html
Single page apps in depth. Aka Mixu's single page app book. 5 Whats in a View? A look at the alternatives. In this chapter, I will look at the concepts and differences of opinion between various frameworks when implementing views. I actually started writing this chapter with a code comparison (based on TodoMVC. But decided to remove it - the code you write is mostly very similar, while the underlying mechanisms and abstractions used are different. Views have several tasks to care of:. In this chapter, I ...
book.mixu.net
Table of Contents - Mixu's Node book
http://book.mixu.net/node
A book about using Node.js. 2 What is Node.js? 3 Simple messaging application. 4 V8 and Javascript gotchas. 5 Arrays, Objects, Functions and JSON. 6 Javascript OOP by example. Nodejs libraries and patterns. 8 An overview of Node, Modules and npm. 9 Fundamentals: Timers, EventEmitters, Streams and Buffers. 10 HTTP and HTTPS. 12 Comet and Socket.io. Learn CSS Layout the pedantic way. Distributed systems: for fun and profit. Single page apps in depth. Written by Mikito Takada. Blog comments powered by Disqus.
SOCIAL ENGAGEMENT