background preloader

Understanding Design Patterns in JavaScript

Understanding Design Patterns in JavaScript
Today, we're going to put on our computer science hats as we learn about some common design patterns. Design patterns offer developers ways to solve technical problems in a reusable and elegant way. Interested in becoming a better JavaScript developer? Then read on. Republished Tutorial Every few weeks, we revisit some of our reader's favorite posts from throughout the history of the site. Solid design patterns are the basic building block for maintainable software applications. A design pattern is a reusable software solution Simply put, a design pattern is a reusable software solution to a specific type of problem that occurs frequently when developing software. patterns are proven solutions to software development problems patterns are scalable as they usually are structured and have rules that you should follow patterns are reusable for similar problems We'll get into some examples of design patterns further in to the tutorial. Take a look at the three examples above.

Related:  Naked JavaScriptJavascript Adv.

Object.create() The Object.create() method creates a new object with the specified prototype object and properties. SyntaxEdit Object.create([, ]) Parameters Fake operator overloading in JavaScript Update 2012-01-29: The post “What is {} + {} in JavaScript?” looks at the addition operator in more detail. This post describes how to do a limited version of operator overloading in JavaScript. With the technique described here, you’ll be able to implement a type StringBuilder that can be used as follows: var sb = new StringBuilder(); sb << add("abc") << add("def"); And a type Point that can be used as follows: Dive into JavaScript - A Brief JavaScript Introduction Types Types - 5 primitive types Primitive types: Undefined Null Boolean String (Immutable) Number (double/32bit integer) Number literal

BookBlock: A Content Flip Plugin A jQuery plugin that will create a booklet-like component that let's you navigate through its items by flipping the pages. View demo Download source BookBlock is a plugin that can be used for creating booklet-like components that allow a “page flip” navigation. Any content can be used, such as images or text. The plugin transforms the structure only when needed (i.e. when flipping a page) and uses some overlays as shadow for the pages to create more realism.

Handling Unicode Front to Back in a Web App Understanding encoding is all fine and good, but there are many gotchas involved in actually building a complex system consisting of many moving parts that uses anything but ASCII characters. This article shows how to get a PHP web application with a MySQL database set up to handle UTF-8 data front to back and explains common pitfalls. Setup We'll assume an application that needs to accept input of and output text containing any imaginable character currently supported by computers. For testing purposes, we'll use this block of text: A good day, World!

JavaScript’s Apply, Call, and Bind Methods are Essential for JavaScript Professionals Prerequisite: — Understand JavaScript’s “this” With Ease, and Master It. — JavaScript Objects — Understand JavaScript Closures (This is an intermediate to advanced topic) Duration: About 40 minutes. Functions are objects in JavaScript, as you should know by now, if you have read any of the prerequisite articles.

Javascript Cheat Sheet Basic Objects Math Methods DOM Events Event Object Constant Event Object Methods initEvent() preventDefault() stopPropagation() Google Launches Drive Realtime API To Let Developers Build Apps With Real-Time Collaboration Google just announced the launch of its Google Drive Realtime API, a new tool for developers that will allow them to bring the same real-time collaboration features that power Google Drive to their own apps. The API, Google writes, “handles network communication, storage, presence, conflict resolution, and other collaborative details so you can focus on building great apps.” Google partnered with three-developer focused tools, the collaborative code editor Neutron Drive, the project scheduling tool Gantter and the diagraming tool to test and launch this API. To show off the power of the API, Google also developed a cube puzzle that uses the Realtime API, as well as a Drive Realtime API Playground for testing the API.

A suite of Javascript libraries and tools designed for working with HTML5 Recent Updates Follow @CreateJS November 2014 Added Unit Tests to EaselJSUpdates in preparation for new releases (coming soon). New class model, with big performance increases October 2014 5 of the Best Free Online Wireframing Applications Many successful web designers and developers can visualize interfaces in their head. It’s a skill few others possess. Consider your clients. If you were lucky enough to receive a specification, did they re-evaluate their interface the minute they tried your lovingly-crafted application?

Events and timing in-depth Internally, the browsers are event-driven. Most actions occur asynchronously and create an event which is appended to the queue. They are taken from the queue and processed when the time permits. For example: A script has finished loading.Keypress, mousemove.The window is resized. Many events are integrated with JavaScript and many events are strictly internal. JavaScript Beyond the Web in 2014 JavaScript has evolved far beyond its role in the DHTML websites of the 90s. It is fast becoming the leading contender for a common language for the Internet of Things (IoT). While it’s far too early to say if JavaScript will truly take that crown, I believe JavaScript does have a role to play in this ever expanding IoT space. Last year, I wrote an overview of the technology that JavaScript developers could get involved with – JavaScript Beyond the Web.

Eloquent JavaScript ¶ When personal computers were first introduced, most of them came equipped with a simple programming language, usually a variant of BASIC. Interacting with the computer was closely integrated with this language, and thus every computer-user, whether he wanted to or not, would get a taste of it. Now that computers have become plentiful and cheap, typical users don't get much further than clicking things with a mouse. For most people, this works very well. But for those of us with a natural inclination towards technological tinkering, the removal of programming from every-day computer use presents something of a barrier. ¶ Fortunately, as an effect of developments in the World Wide Web, it so happens that every computer equipped with a modern web-browser also has an environment for programming JavaScript.

Node.js Guide Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. — The official Node.js website This manual consists of three different sections:

Related:  Anleitungen