M
M A Hossain Tonu
JSON stands for JavaScript Object Notation. The current trend among
many JavaScript developers seems to be to write code JSON style, i.e.
to collect a number of functions/methods into a singleton object
written in object notation.
What! did i heard Singleton Object? Whats dat ?
Well Wiki says: The singleton pattern is a design pattern that is used
to restrict instantiation of a class to one object
Actually JSON objects are singleton objects by design, not by choice,
since they have no constructor. I really like JSON
So using the JSON you can define a class, while at the same time
creating an instance (object) of that class, means that you can have
only one single instance of this class at any time, you cannot
instantiate more objects of the same class.
I have written here more:
http://mahtonu.wordpress.com/2010/04/13/json-style-javascript-object-declaration/
many JavaScript developers seems to be to write code JSON style, i.e.
to collect a number of functions/methods into a singleton object
written in object notation.
What! did i heard Singleton Object? Whats dat ?
Well Wiki says: The singleton pattern is a design pattern that is used
to restrict instantiation of a class to one object
Actually JSON objects are singleton objects by design, not by choice,
since they have no constructor. I really like JSON
So using the JSON you can define a class, while at the same time
creating an instance (object) of that class, means that you can have
only one single instance of this class at any time, you cannot
instantiate more objects of the same class.
I have written here more:
http://mahtonu.wordpress.com/2010/04/13/json-style-javascript-object-declaration/