Code, code, and more code

It's time to get our hands dirty and put fingers to keyboards. As always, we generated a new base application using Sencha Cmd and will use the resulting "main" view as a starting point for our user interface. First though, let's flesh out the data layer that we designed earlier:

// app/model/BaseModel.js
Ext.define('Alcohology.model.BaseModel', {
    extend: 'Ext.data.Model',

    schema: {
        namespace: 'Alcohology.model',
        urlPrefix: 'http://localhost:3000',
        proxy: {
            type: 'rest',
            url: '{prefix}/{entityName:uncapitalize}'
        }
    }
});

We've used a base model in previous chapters because it gives us a good way of centralizing proxy configuration. The models that inherit from it are all straightforward, as shown in the following code:

Get Ext JS Application Development Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.