General design question constructing a singleton class
knowledge is extremely low)
Using YUI Ext .33 to build up an application interface along with
the Yahoo 11.4 libraries.
Looking at the example (number 6 on Jack's article "cross browser
web-20 layouts part 2 ajax-feed-viewer-20") he has declared the
Example function (? is there a name for this type declaration ?) in
a way which i assume is meant to be used as a singleton object.
Namely, that only one instance of Example should be defined. Is
that what happens with the return statement immediately pushing all
functions (like init) and the internal variables are private? Or?
Why not just define Example like YAHOO.ext.EventManager which is set
to a new function?
Realise my questions are disjointed and unclear but it is extremely
difficult from a Java/C++ world to understand Javasript design
patterns. Any links/help matieral online with design patterns?
- Think I got my answers by reading the following article:
And I think a layout constructor for my uses ought to be built up just
like the YAHOO.ext.EventManager (singelton by calling new on an
anonymous function) and if i want private variables then the
constructor way be returned.