Friday, December 6, 2013

User Registration and Login

Basic user registration and login has been implemented, and anyone is now free to make a beta account!

I've been using, testing, and tweaking Thinker for the past few months (along with a few other beta testers), and it's been working very well.

The login and registration forms themselves actually inherit directly from the Quantum model, meaning that the form is a Node with labeled Links to the inputs which themselves are Nodes. Each Node can render itself, binds it own events, and validate itself. The model for the whole form is defined and initiated with Quantum Thinker Data. This paradigm has become my own kind of app framework analogous to something like Backbone.js.

As illustrated in the diagram from my last post, the Quantum Class Hierarchy included some multiple inheritance connections. After working on how best to accomplish this, I devised a method for ad hoc prototype inheritance in Javascript. Instead of defining a classical prototype chain, this technique compiles prototypes with an object extension method I call `uber()`. It's similar to a typical `extend()` method but it works in reverse. This is because compiling inheritance on the fly typically ascends the hierarchy, and applying super namespaces this way is more straightforward. An instance can be created with a prototype that extends any number of other prototypes in any order. As mentioned, prototypes can be inherited with a namespace which allows access to any super methods with the same name.

You can see a Gist outlining this method here.