Skip to content

An opinionated backbone-marionette styleguide for teams or individuals

Notifications You must be signed in to change notification settings

jagretz/backbone-marionette-styleguide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

(WIP) Backbone - Marionette Styleguide (WIP)

A work in progress (wip), I have just began building an application in backbone-marionette so I am learning and gathering best practices as I go.

Purpose

An opinionated backbone-marionette styleguide for teams or individuals.

This is an opinionated style guide for syntax, conventions, and structuring backone applications using marionette library. If you like what you see then have at it. Have improvements to suggest, fork this or hit me up I'd love to have your suggestions!

Styles and format are based upon my very limited knowledge of and experiences while developing applications with backbone and marionette.

The intention of this styleguide is to guide projects and teams building backbone-marionette apps by showing the conventions I use and, more importantly, why the convention was chosen.

Table of Contents

  1. Template
  2. Type of Object
  3. Module
  4. API References

Template

  • what

    Why?:

function template(param1, param2) {
    // I am a template
};

Back to top

Type of Object

  • Define a meta object on your backbone models, collections and views. Define additional private and immutable properties with Object.defineProperty().

    Why?: meta property is a place to add meta information regarding the object.

    Why?: Very helpful when debugging. Provides a constructive name for your object other than child

    Why?: Makes this private and immutable.

var ModelConstructor = Backbone.NestedModel.extend({
    meta: {}
});

Object.defineProperty(ModelConstructor.prototype.meta, 'className', {
    value: 'ModelConstructor'
});

Back to top

Module

  • what

    Why?:

Back to top

API References

For anything else, check the API reference:

Back to top

About

An opinionated backbone-marionette styleguide for teams or individuals

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published