FaceQuiz is a personal itch. I barely remember people the second or third time I see them. Often times this occurs at meetup.com events. It occurred to me that I could intersect attendees at the next event with attendees at previous events to figure out who I might know. Of course, I didn’t meet everyone there, so I really want a way to mark the people I did meet and then review the people who said they’ed be at the next one.
The API keeps on turning
While searching for the missing JS library, I found a reference to Facerize, which almost obviates the need the write it myself. However, if it has support filtering by event, it doesn’t advertise it. They’ve also been in invite-only beta for over six months, so I can’t try it out.
MVC is of course Model, View, Controller. Models are fairly lightweight. There is a provision to specify only the URLs, but this assumes that you have Rails-esq RESTfull endpoints. Fortunately, doing more creative things, such as using the meetup wrapper or localStorage, just means implementing a conventional set of methods like findAll, findOne, create, destroy, etc.
Views are just ‘ejs’ templates using the defacto <%%> tags. Controllers render views and then set up event bindings on their elements. There is also a generalized event framework which really forms the core of tying programs together. As one example, models will generate events (a service you have to provide yourself if you are overriding the model methods) so that controllers can keep up on lifecycle events like created, updated, and destroyed to update the page. Event binding on controllers is streamlined by interpreting the object keys as psuedo selectors, rather than calling some sort of bind method.
It’s a completely generic mechanism however, and the real art comes in choosing sufficiently ‘domain’ events for each controller. As an example, I set up FaceQuiz as a three-tab interface with Quiz, Events, and Meet. The event list triggers an event.selected er, event. This gets picked up by the meet controller to look-up the appropriate list of attendees and the quiz controller to filter the pool to quiz over. It also gets picked up by the current-event control, which displays the selected event while in the other tabs, and also allows one to clear the selected event in order to go back to quizzing over all connections. Clearing happens by trigging the same event.selected with a null value.
Could I just not use Steal? I could probably get away with it for developing my application, but JMVC itself uses Steal internally. It’s not clear that it would be possible to generate a combined and minified file with two packaging systems involved, and it would neither improve the loading situation nor remove all long namespaces (without writing an adapter layer)