Cultivating your code
As you build your application, there will come a point at which you create a new class and yet it doesn't logically fit into the directory structure Sencha Cmd created for you. Let's look at a few examples.
I'm a lumberjack – let's go log in
Many applications have a centralized SessionManager
to take care of the currently logged in user, perform authentication operations, and set up persistent storage for session credentials. There's only one SessionManager
in an application. A truncated version might look like this:
/** * @class CultivateCode.SessionManager * @extends extendsClass * Description */ Ext.define('CultivateCode.SessionManager', { singleton: true, isLoggedIn: false, login: function(username, password) { // login ...
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.