Building own Library


I’m looking at creating my own JS library. Your probably thinking, why? Experience/Show employer, and I want 100% control over my websites. Anyways, I’m a huge fan of JS, yes, I said that, and I’m asking people who have done it, what are the major pitfalls and what should I look out for during the process? Experiences will vary, but trying to get some incite before moving forward.

Thanks guys.

I’m about to hit the hay, but here’s something that should help to get the ball rolling.
Roll out your own JavaScript Interfaces

Thanks for that link, it’s given me a good foundation and idea of how to go forward. I might take a look at the jQuery library to see how the code is structured and functions. But of course make my library unique to everything that is currently out there. Not an easy task, I know. :wink: Like you, I am also a fan on JS.

var CookieController = {

name: "Jason";
SportsTeam: "Chiefs";

addCookie: function()
           //La de da;

deleteCookie: function()
             //Word Life;


How can I prove upon this framework? Is their a more efficient way?

How can you prove? As in, how can you prove that it’s working as you expect it to be, by applying some tests to it?

Oops, I mean can I improve the code. Is their a better archetucture? Design Pattern?

You are mixing data and methods together, which tends to be a no-no.

You also have a function to read a cookie value, as well as a storage location from which the value can be read. That’s two different ways to obtain the same information, which can be a design issue too.

So, basically my design pattern sucks. Do you have a recommendation of a library design pattern? The link you sent me was interesting, I might just design something similar.

The techniques that jQuery use seem to be solid and stable. Other ones such as YUI can be worth looking at too, in terms of how they do things.

Pro JavaScript Design Patterns - Google Books

Here’s something that will be useful. It’s a weekly blog called Let’s make a Framework, which goes in to the issues and details of what’s involved throughout the whole process.

very interesting :slight_smile: