module-pattern Questions

2

Solved

From a single instance and a multiple instance point of view, why would I write all those extra lines of code following the Module Pattern vs just using a standard Constructor with methods and prop...
Effeminacy asked 28/11, 2012 at 18:15

1

Solved

I've seen that in some projects, Module Pattern uses instead of Singleton Pattern and vice versa. I want to know exactly, what's the different between Module Pattern and Singleton Pattern?
Seeress asked 17/11, 2012 at 9:4

2

Solved

First a bit of history, we have an engine which is made up of many javascript files which are essentially modules. These modules return a single class that are assigned to the global scope, althoug...
Clarhe asked 25/4, 2012 at 8:25

1

Solved

I can define private member fields in module pattern using the code below var myClass = function(){ var private_field1,private_field_2; var private_func1 = function(){ //....... } //..........

3

Solved

I get the basics of the Module Pattern and its use of a closure to allow for private members, BUT I can't quite swallow why the below code does what it does: var Calculator = function() { var pri...
Amerce asked 18/4, 2012 at 5:51

4

I tend to write object constructors in the following way: function Person(name) { this.name = name; } Person.prototype.greet = function () { alert("Hello! My name is " + this.name + "."); }; I...

3

Solved

I'm a complete newbie to ninject I've been pulling apart someone else's code and found several instances of nInject modules - classes that derive from Ninject.Modules.Module, and have a load metho...
Hirohito asked 13/1, 2010 at 12:1

2

Solved

Is there a way to have a public function from the module-pattern accessing private variables dynamically? test1 shows what I mean with "access dynamically" but with public variables var x = (funct...
Clue asked 25/12, 2011 at 4:26

1

Solved

I want to write a JS library and handle it like this: var c1 = Module.Class(); c1.init(); var c1 = Module.Class(); c2.init(); And of course, c1 and c2 can not share the same variables. I think I...
Combustor asked 24/9, 2011 at 18:39

2

Solved

I've read about the Revealing Module Pattern and I love it. But what about large projects where the 'master-object' has tens of sub-objects and maybe hundreds of functions. I wouldn't want to...
Epizootic asked 22/5, 2011 at 1:59

2

I've been writing an application and I have had a lot of success breaking different pieces of functionality into the so called "Module" pattern where you have a self-executing singleton with public...
Etui asked 16/5, 2011 at 21:13

2

Solved

I would like to know what's the difference (advantages/disadvantages) between the following patterns. How can I create sub modules based on the module pattern? My goal is to have my js organiz...
Hula asked 4/11, 2010 at 20:29

2

Solved

I would like to call a public method from a private one but the property "this" refers to the window object. Please note i am trying to apply the module pattern. You can find a working code exampl...
Lillylillywhite asked 21/12, 2010 at 23:56

1

Solved

I'm trying to understand js module patterns in use with jQuery. I've edited this a couple of times and will try to end up with a good practice for my skill level (a couple of months fresh on jquery...
Photoconductivity asked 30/11, 2010 at 8:51

3

Solved

I'm interested in using the Module Pattern to better organize my future projects. Unfortunately, there are only a few brief tutorials and proof-of-concept examples of the Module Pattern. Using the...
Totalizator asked 27/4, 2010 at 1:27

© 2022 - 2024 — McMap. All rights reserved.