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 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. Like you, I am also a fan on JS.
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.
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.