The Reactive Manifesto puts together the ideal architecture for today’s system
infrastructure, designed to cope with ever-increasing need for performance, reliability and responsiveness. The same
evolution of expectations is taking place in the JavaScript front-end, but do the same ideas and principles apply?
HTML elements are free
to change the style, size, and placement of their children, and even their order. A lot of advanced use cases define
rendering based on both the properties of element as well as the properties of their children; one particularly
interesting case is the 2 column timeline. This is similar to a standard 2 column flow, except instead of first filling
one column and overflowing to the second, columns are filled simultaneously – inserting elements into whichever has the
least content. The net effect is elements occurring earlier in the HTML markup are placed vertically higher in the page
than elements occurring later. The page reads top to bottom as a chronological timeline, which while being a simple
enough concept cannot be done using standard HTML. In fact, the exact ordering of elements are different based on widths
of the columns. Column placements are determined by previous element’s heights, and heights are a function of widths, so
setting colum...
Thread-Local storage (TLS)
allows static variables to be attached to the currently executing thread. The most common use of TLS is to allow global
context to be available throughout the entire call stack without passing it explicitly as a method parameters. In a
web-application, this allows contextual request metadata, such as the URL, to be referenced anywhere within the code
handing the request; which is extremely useful for logging or auditing purposes.
Most sortable HTML
table generators (such as AngularJS’s ng-grid) allow cells to be customized and
formatted according to templates, however all templates are specified as parsed strings of HTML content. The Web
Components specification allows for HTML Templates, meaning
actual HTML fragments can be used instead of pieced together strings. Two benefits are better readability, CSS
encapsulation by way of Shadow DOM, and soon to be native
support by modern browsers.
As businesses now rely
more heavily on web applications to perform daily operations, a user-friendly datatable/spreadsheet is indispensable to
all web developers. While individual requirements vary, the core staple is the sortable table. Using Polymer’s Templates
and Data-Binding, one can be implemented in a remarkably concise way.
One useful feature of
modern JavaScript libraries is 2-way data-binding. All interactive websites perform this functionality one way or
another, but only a few libraries such as Ember.js, AngularJS
and Polymer don’t require a single line of JavaScript.
In the years 2002-2003, Internet Explorer captured 95% of world-wide browser market share. It was unfathomable to many
that over the next 10 years IE would decline to just over 15%.
At the heart of a web
page, there are UI elements and these elements interact: with the user, each other, and the server.
Although HTML5 expanded the original set of elements to include audio,
video, and date pickers, there has been no standard way to define custom elements. Elements not specified in the HTML
specification have had no support thrusting this responsibility onto client-side and server-side web frameworks.
The key to high availability is
redundancy; it follows that if uptime matters, Finagle needs to be deployed to
multiple servers. This article walks through both the basic multi-host configuration using finagle-core, and a
more robust deployment scenario utilizing the finagle-serversets module.
The Separation of Concerns (SoC) pattern is one of those software
architectural choices that everyone is helpful. It increases clarity, shortens the amount of code in the working
context, and minimizes the chance of side effects. For example, two concerns that should not require entanglement:
updating data and cache invalidation. Both are related, but one is concerned about business logic and database access,
while the other deals with the cache servers. Finagle’s generated FutureIface can be used to keep these two separate.
A 30-minute presentation on Sept 19th at the Scala-Toronto Meetup. The
slides introduce a technical application of Apache Thrift and additional features offered by
the Twitter Finagle.