Last active
October 5, 2015 00:08
-
-
Save Pickachu/2720897 to your computer and use it in GitHub Desktop.
Javascript Prototypal Programming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var controller = (function controller_declaration(library, library...) { | |
// Namespace de elementos com regras de negócio | |
var ... = {...} | |
⋮ | |
// Controller da página em questao | |
var controller = {...} | |
// Roteador de ações efetuadas na página, geralmente para o controller | |
var router = {...} | |
function initialize() { // controller initialization } | |
$(initialize) | |
}).call(parent_container, library, library...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.mixin = (function mixin_declaration(library, library...) { | |
var mix = other_mixin(); | |
// Mix specific functions | |
function ... () {...}; | |
⋮ | |
// Aditional shared function | |
mix[...] = function ... () {...}; | |
⋮ | |
return mix; | |
}).call(parent_container, library, library...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var module = (function module_declaration(library, library...) { | |
var public = function utility_function() {return public;}; | |
// Module specific namespaces | |
var ... = {...}; | |
⋮ | |
// Module public accessible methods | |
public[...] = function ... () {...}; | |
⋮ | |
// Module initialization | |
function initialize() {...}; | |
$(initialize) | |
return public; | |
}).call(parent_container, library, library...); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment