views:

87

answers:

2

Hello guys,

We have just started our new assignment - web-based project. Before I get directly on to the question it would be necessary to explain about the project.

We are actually moving a product from desktop to web. This is it. All backend services are web services. Our choice of server technology will be .NET. As we are good with it and also client are equipped with it too. So, we will be doing all the server work in ASP.NET AJAX. PageMethod will be preferred choice to communicate with server (C# 3.0) and client (JavaScipt). There will be a real need of jQuery for parsing DOM and XML parsing. We do not to put effort to reinvent the wheel.

Now, there are things what we have to do and mostly it will be in JavaScript. We would like to package it in one.

E. John did a very useful session on 'Building a JavaScript Library' which is very useful. It surely keep in this way.

A fairly good amount of JavaScript engineers are here. And I would like to have their recommendations and suggestions before we start over.

Do you know some good references on JavaScript Library design? If you every made your own JS Library what you learned from it? Have you look into gmail/googledocs/facebook JavaScript? What have you learned from it?

Thanks.

+1  A: 

To design a javascript library -

  1. Identify what functions you write often.
  2. Save them in a seperate .js file.
  3. Keep a log or comment block on top of the development version and update to reflect the contents of the file.

Done.

Moshe
+1  A: 

Start off with something like this:

var yourNamespace = yourNamespace || (function () {
    "use strict";
    // private variables here
    return {{whatever you want yourNamespace to be here}};
}());
Eli Grey