Node Style Woes - Domains and Promises

2016 Sep12
D

omains have been the red-headed step child of error handling in Node.js It is a library that has been deprecated since v0.12 and has been awaiting a suitable replacement ever since ( we are at v6.5 at the time of writing ). Until one has been implemented by the Node Core team, it is still de-facto way to deal with error propagation. As Node.js supports more and more ES6 features, I have been upgrading my open source projects where it seem appropriate. In my command line tool package, seeli, I was doing some updates and came across some exceptionally odd behavior around ES6 Promises and implicit Domain binding. In a nutshell - It's broke.

Monkey Patch (ˈməNGkē

Read More
filed under:  class es6 promises domain node

Docker for Dummies, I mean Developers

2016 Feb12
I

mages, Containers, and Tags! Oh My! **Docker** is the new hotness in the software world. Dockerize all of the things! For my tastes, [Docker](https://docs.docker.com) is really more of an operations tool for packaging and deploying self contained apps. However, it is making its way into the development circles. I have been finding that, sometimes, developers have a hard time understanding all of the pieces and how the fit together. They tend to copy and paste commands from docs and tutorials and pray to the gods that there app is running. Confusion between containers, and images, building and running and what tags are just has them typing themselves in circles. But fear **not**! There is a

Read More
filed under:  class oop docker

Fun With MooTool Part 3: Class Mutators

2013 Jun23
T

he Class system in [Mootools](http://mootools.net) a exceptionally powerful for the little amount of code that it is comprised of. A large part of that power comes from the Mutator system. A Mutator can be thought of a lot like a plug-in. However unlike most plug-ins that are executed at run time, Mootools Mutators are executed at the time a class is [actually defined](http://github.com/mootools/mootools-core/blob/master/Source/Class/Class.js#L76) altering the end result of the class

A Mutator is nothing more than a JavaScript function that has access to the internals of the class it is attached to. These functions are stored in a Mutators namespace in the Mootools library.

Read More

Fun With Mootools Part 2: Protected Methods

2012 Jul17
P

rivate and protected class methods can come in handy when creating complex applications. While JavaScript doesn't provide these features natively, [Mootools](http://mootools.net) provides a mechanism to define protected methods on a class. Protected means that the function can only be called by the originating class or a sub-class of the originating class. An attempt to call a protected function by a different class or from an instance of the class would result in error. Here is how you do that with a mootools classs:

var SecretClass = new Class({
	Implements:[Options]
	, initialize: function( options ){
		this.setOptions( options );
		var s = this.protectedMethod();
	}

	/**
	 * A regular class method 
	 */
	,publicMethod: function( name ){
		alert("Hello" + ( name || "world") + "!"
Read More
filed under:  mootools class javascript oop

Fun With Mootools Part 1: The Class toElement method

2012 Apr14
T

he [MooTools](http://www.mootools.net) ( My Object Orientated Tools ) JavaScript framework is a pretty sweet piece of software. It's goal is to make developing with JavaScript easier. It provides large set of tools for building complex JavaScript applications. There are a lot of hidden [goodies](http://www.youtube.com/watch?v=6nOVQDMOvvE) tucked away in the framework that kick off one of those ["AHa!" moments](http://en.wikipedia.org/wiki/Eureka_effect). One of those goodies is the toElement method on classes. One of those goodies is the **toElement** method on classes.

The Class' method, toElement, works in tandem with the MooTools document.id ( $ ) method. In most cases, Classes center around a DOM element for some reason

Read More
filed under:  dom mootools class javascript oop