TodoMVC using Mojito, Part 2: Common affinity controller

TodoMVC using Mojito - Firebug Console

In Part 1, we got our basic application ready with the following setup:

  • Application and Routing Configuration
  • TodoMVC defined assets
  • Initial UI – HTML markup and CSS stylesheet

In Part 2, we explore configuring all of the CRUD actions and update all associated artifacts – model, controller and binder. Specifically, we explore the following actions – one at a time:

  1. Action – List all TODOs
  2. Action – Add a TODO
  3. Action – Edit a TODO
  4. Action – Mark one or all complete
  5. Action – Delete a TODO

Step 1: Action – List all TODOs

The first thing that we build up is retrieving all TODO items and showing them up. If there are no items in the list, then, as per the specs, the #main element must be hidden.

Let us start with updating the model followed by the controller and binder in that order.

Read more …

TodoMVC using Mojito, Part 1: Common affinity controller

TodoMVC using Mojito

This is first post in the series that describes building a simple Todo application using Mojito. The constraint that we have in our first implementation is that the controller will have common affinity.

As a prerequisite to understanding the implementation, I would assume that you are well versed with JavaScript and are hands on with Mojito. If not, it may be worthwhile to explore my initial posts on getting started with Mojito.

The complete code generated can be structured in the following steps:

  1. Initial code generation using Mojito CLI tools
  2. Application and routes configuration
  3. Initial UI – View and CSS
  4. Model
  5. Controller
  6. Binder
  7. Action – List all TODOs
  8. Action – Add a TODO
  9. Action – Edit a TODO
  10. Action – Mark one or all complete
  11. Action – Delete a TODO

Read more …

Todo MVC using Mojito

TodoMVC is an awesome project by Addy Osmani and Sindre Sorhus. In their own words:

Developers these days are spoiled with choice when it comes to selecting an MV* framework for structuring and organizing their JavaScript web apps.

Backbone, Ember, AngularJS, Spine… the list of new and stable solutions continues to grow, but just how do you decide on which to use in a sea of so many options?

To help solve this problem, we created TodoMVC – a project which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today.

The website now boasts of implementations using over three dozen frameworks. And I decided to pitch in using Mojito by Yahoo!

Read more …

Book: Getting Started with NoSQL

Getting Started with NoSQL

After a few months of authoring, exchanging mails with the publisher on the final content and reviews, and exchanging mails with Satish – lead reviewer, my book – Getting Started with NoSQL (ISBN: 9781849694988) – is finally out in the market.

The book is available on Amazon at:

A bit in detail about the book:

Relational databases have been used for decades, and in the last few years NoSQL has been a growing choice for large-scale web applications. Non-relational databases provide the scale and speed that you may need for your application. To switch you must know the options available, the advantages and drawbacks, and scenarios which it is suited to the most and where it should be avoided at all costs.

Getting Started with NoSQL is a from-the-ground up guide that takes you from the very first steps to a real-world NoSQL application. It provides you with a step-by-step approach to design and implement a NoSQL application that will help you make clear decisions on database choices and database model choices. The book is suited for a developer, an architect, as well as a CTO.

This book is a comprehensive guide to working with NoSQL. You will learn to make key decisions, and to design and implement NoSQL applications. You will learn about NoSQL jargon, data models, and databases on the market. The case studies and comparisons presented will help you to make a decision on whether or not to use NoSQL, and if so which model and product to use. This book is an indispensable resource for you to have in your library. You will learn everything you need to know about understanding and working with NoSQL and how to implement an application with the correct NoSQL for you.

Read more …

Writing Files to GAE Blobstore

FileSystem API was introduced in AppEngine last year. A great feature. I tried using it more than a couple of times and ended up with one problem or the other. Some of the notable issues include:

  • What should be the filename during create and save? The name given during create was only name-part and cannot be used during read. Read must use fullpath.
  • If you use fullpath, you cannot use it to delete the file.

After a bunch of experiments, I concluded that it is best to use BlobKey.

Read more …

Architecture for Multi-device Applications: Part 3 – Consumption Channel

In Part 1, we discussed about the bare-bore design.
In Part 2, we discussed about the high-level implementation structure.

In Part 3, we now explode the box #1 – “Browser or Custom App”. We look at various consumption channels and how they affect the implementation and technology choices.

Read more …

Processing Shortcodes in a post in Minow

Minow with Shortcode processing

Minow can now process short-codes. Well, it started doing so almost a month back… just that I never got time to update my blog.

As of now, the short-code processor has been encapsulated in a simple interface that does the processing of a short-code with attributes. At http://minow-web.appspot.com/, you may notice YouTube videos embedded in the posts. They are not hard-coded HTML but processed using the YouTube short-code processor.

Read more …

Architecture for Multi-device Applications: Part 2 – Implementation

Architecture for Multi-Device (Desktop, Mobile, Tablet, Internet TV) Access

Part 1 of the series on “Architecture for Multi-Device Applications” focussed on the bare-bore design.

In Part 2, we look at high-level implementation structure – a slightly more detailed version of the design discussed in Part 1, before we start opening the individual boxes.

One of the key aspects that we discussed in Part 1 was the separation between the “Application Server” and “Web Server” layer and argued that most of the applications that we come across in real world, daily life, don’t really separate them… or rather we find them difficult to separate because of the choices that we have or we are “taught” in our life.

Read more …

Architecture for Multi-device Applications: Part 1 – Definition

One of the questions that keeps coming to me over and over again is – what is an ideal architecture for multi-device applications or rather applications that cater to multiple devices like desktop, mobiles, tablets, internet-TVs and what not?

This is quite interesting and exciting as more and more frameworks get developed. We started the multi-device world with native apps and soon realized that the model doesn’t scale. There came HTML apps (or what people naively refer to as HTML5). I won’t call them as really HTML5 (HTML5 only) apps… since you can live with HTML4 and CSS2 for most of the purposes unless you want features specific to HTML5 – most common being using audio/video since Flash is unavailable on iOS (iPhone, iPad etc).

Read more …

Minow now has multiple themes

Minow using Shaken-Grid Theme

Yesterday, I tested the Minow framework with another theme that I personally like because of simplicity and card-layout – Shaken Grid. As earlier, I am not the owner or maintainer of the theme, I just ported it to Minow.

I did this experiment to identify theme-requirements early (lean methodology) with minimum efforts and resources.

The result is some changes in the Minow Engine to serve images, CSS and JavaScript content with appropriate content-type from the template folder noting that the actual theme template should not be accessible directly (read: raw).

Read more …