Modular Design Patterns in JavaScript

05-10-2014

In this article, I’ll be describing the structure and benefits of an extended modular design patterns, that includes four principal member types:

  • public: members that can be accessed from anywhere
  • private: members that can only be accessed from inside the object
  • privileged: members that can only be directly accessed from inside the object, but which can be indirectly accessed from outside via a public method
  • protected: members that can only be accessed from inside the object or any of its modules.

This article is not about object-orientation, because the structure we’re going to create is a kind of singleton, which is a single-instance structure that cannot be instantiated more than once. In fact, it isn’t instantiated at all (in the sense of having a constructor), so it’s an object-based rather than object-oriented pattern.

For more about the difference between object-based and object-oriented programming, and an introduction to object-orientated programming in JavaScript, I’d recommend Ryan Frishberg’s article: JavaScript Object-Oriented Programming.

Read More »

Events in the ASP.NET Request Life Cycle

09-08-2014

copied from the Programming Microsoft ASP.NET 4 book, Page 32, Charpter 2, Part 1.

Events are fired in the following sequence:

BeginRequest

The ASP.NET HTTP pipeline begins to work on the request. For the first request ever in the lifetime of the application instance, this event reaches the application after Application_Start.

AuthenticateRequest

The request is being authenticated. ASP.NET and IIS integrated authentication modules subscribe to this event and attempt to produce an identity.

If no authentication module produced an authenticated user, an internal default authentication module is invoked to produce an identity for the unauthenticated user. This is done for the sake of consistency so that code doesn’t need to worry about null identities.

Read More »

JavaScript undefined VS null

28-03-2014

Copied from here

undefined与null的区别

大多数计算机语言,都有一个表示“无”的值。

比如,C语言的NULL,Java的null,Python的none,Ruby的nil。有点奇怪的是JavaScript语言居然有两个表示“无”的值:undefined和null。

这是为什么?

Read More »

How to pronounce symbols on keyboard?

21-11-2013

copied from here

~ “tilde” or “tweedle” or “squiggly line”. Also used as a “swung dash” and in mathematics with other signs to mean “approximately” and in logic sometimes used to mean “not”. See Tilde on wiki

``` “grave accent” or “stress mark”. See http://en.wikipedia.org/wiki/Grave_accen… .

! “exclamation point” or “exclamation mark’. Used to end an emphatic sentence. Also often used in computer languages to mean “not” and in mathematics to indicate “factorial’. See Exclamation on wiki.

@ “at sign” or “commercial at sign”. See it on wiki.

# “number sign” or “pound sign’ or “octothorpe” or “hash mark”

$ “dollar sign”, for example $29.00 would be read as “twenty-nine dollars’

Read More »

Differences between StoredProcedure and UDF

01-09-2013

The differences between Stored Procedure (SP) and User Defined Functions (UDF) in MSSQL

Ability SP UDF
Return Values Can return zero, single or multiple values Mandatory to return one and only one value
Can use transaction Yes No
Can have input/output parameters Both Input parameters only
Interop Can call functions from SP Cannot call SP from function
Can be used in SELECT WHERE HAVING statement No Yes
Exception Handling Yes, can Try-Catch NO

Written with StackEdit.

Read More »