Blog

Jun 24

REST tips

By on June 24, 2014 11:50 am

At SitePen, we have long been advocates for building web applications on a RESTful architecture. Over the last several years, it has been exciting to see organizations increasingly provide RESTful endpoints for the Dojo-based front-ends that we support and develop. A well-designed REST backend can be a excellent foundation for manageable, scalable applications, that will be ready to evolve into the future. I wanted to share a few tips for designing a set of RESTful services.

Jun 17

Local Database Stores

By on June 17, 2014 10:57 am

Modern browsers have powerful new database capabilities that enable applications to store data locally, and perform advanced indexed queries without a network connection. Applications can be built with offline support without any disruption to data interaction, including searching. However, these database capabilities have traditionally been difficult to use across browsers since Safari only supports WebSQL (although version 8 is slated to include IndexedDB support), and Firefox and Internet Explorer only support the W3C’s IndexedDB API (Chrome supports both). And these two interfaces couldn’t be more different, making it very problematic to write applications that work offline on all the major browsers.

But, it is now much easier to access these database capabilities. By taking advantage of the consistency of the Dojo object store implementation, in version Dojo toolkit version 1.10, dojox/store now includes object store implementations for IndexedDB and WebSQL, along with a wrapper that will automatically delegate to the appropriate store implementation based on browser support. With a single common interface, you can retrieve, update, add, and delete objects, and even perform sophisticated queries in exactly the same way with the different underlying storage implementations.

May 29

Building on Persevere

By on May 29, 2014 11:11 am

Persevere is a server-side JavaScript framework that we started several years ago to help build RESTful web applications with clean separation of concerns, encapsulation, and the consistency of JavaScript in both client and server. Recently, we had the opportunity to work on a project that used the full capabilities of Persevere, leveraging many of its features and leading to some improvements as well. We wanted to share some insights on how to best leverage some of the unique features of Persevere.

May 16

Looking Ahead with Stores

By on May 16, 2014 1:25 pm

Part of the foundation of the Dojo architecture is the data store layer. Dojo applications are built on a uniform interface for accessing different data sources, to make it possible for different presentation components to be used with different data models. We are continuing to work towards evolving and refining our data layer at SitePen. Lately we have been working on a new project called dstore, that represents our vision for the future of the Dojo data layer. The dstore project will include a number of improvements and new capabilities, including an improved querying API, better notifications, more stores, and a data modelling system for individual objects.

Jan 6

Private Matters: Convention and Closures

By on January 6, 2014 11:10 am

Many object-oriented programming (OOP) languages provide a way to define private properties and methods. This allows objects to encapsulate functionality and state information. This encapsulation leads to a clear distinction between the internal implementation and a clean external interface.

However, JavaScript does not have a native mechanism for declaring private properties and methods, in the same sense that other object oriented languages do. But, there are a few techniques that we can use to achieve the same results.

Dec 4

Persevere on Heroku

By on December 4, 2013 9:52 am

It is becoming increasingly popular to deploy Node.js-based applications to Node-friendly hosting services to take advantage of the pre-built, reliable, robust architecture and infrastructure these services provide. Persevere, a JavaScript server framework for developing RESTful applications on Node.js, is an excellent fit for these types of hosting services. In this post I will show you how easily a Persevere application can be built and deployed on one such service, Heroku, but the process can be easily replicated on other providers that offer similar functionality.

Sep 17

Building UI Components with xstyle

By on September 17, 2013 8:36 am
This entry is part 4 of 4 in the series Getting to Know xstyle

xstyle_transparentIn this post, we will walk through creating widgets, or UI components in xstyle. CSS itself has a basic component-like unit, a CSS rule. However, xstyle enables a level of advanced UI for constructing rich components, beyond what can be specified with basic CSS. The simple extensions in xstyle allow us to generate DOM elements, respond to events, and encapsulate functionality for easy reuse and composition.

Sep 10

Building an application with xstyle

By on September 10, 2013 11:10 am
This entry is part 3 of 4 in the series Getting to Know xstyle

xstyle_transparentIn this post, we want to walk through how you would get started building an application using xstyle, an extensible CSS framework. xstyle provides extensions that allows us to declaratively describe an user interface, making use of data bindings, element generation, and components, giving us an elegant means to create an application. In this tutorial, we will be using xstyle with Dojo, and use xstyle completely for our UI. Before starting, remember that you can use xstyle to any degree desired. xstyle can simply be used to make CSS improvements, it can build more sophisticated UI components, and it can be used to describe the entirety of the user interface (combined with a JavaScript-driven data model). Here we will be looking at the application level usage of xstyle, and we will create an app with a simple list of contacts and a form to edit the contact.

Sep 4

Improving your CSS with xstyle

By on September 4, 2013 9:15 am
This entry is part 2 of 4 in the series Getting to Know xstyle

xstyle_transparentxstyle is a framework for extending CSS, which can be used to improve the quality, maintainability, and performance of your stylesheets. While xstyle can be used as a full framework for building applications with data bindings and UI generation, in this post we will focus on making progressive improvements to stylesheets within the traditional role played by CSS.