Skip to content

Instantly share code, notes, and snippets.

View kborchers's full-sized avatar

Kris Borchers kborchers

  • GM Financial
  • Dallas, TX
  • 09:23 (UTC -05:00)
View GitHub Profile

Title

Mobile App Development for the Enterprise

Abstract

This session will start with a brief intro to mobile apps including everything from HTML5 to Hybrid to Native and some of the reasons developers choose one over the other. We'll then touch on some of the concerns enterprise developers need to be aware of when selecting one of those technologies. Then we'll dive into some demos and code from the AeroGear project, a JBoss Community project, and show how this set of tools currently can and plans to meet the needs of those enterprise and non-enterprise app developers.

this.getData = function() {
return data;
};
this.setData = function( newData ) {
data = newData;
};
this.addDataRecord = function( record ) {
data.push( record );
};
this.removeDataRecord = function( record ) {
@kborchers
kborchers / gist:3833435
Created October 4, 2012 13:11 — forked from matzew/gist:3832056
FAQ or Wiki or ...
  • What is a pipeline ?

A pipeline represents a set of n connections to a server. The pipeline class offers some simple 'management' APIs to work with containing 'pipe' objects. Basically it allows you to add or remove new connections to the pipeline.

  • What is a pipe ?

A pipe represents one connection to a server. The pipe API is basically an abstraction layer for any server side connection, which all allows you to simply 'read' from, or 'write' to a server connection. However, technical details like RESTful APIs (e.g. HTTP PUT or HTTT GET) are not exposed on the pipeline and pipe APIs. In the future you can have different type of pipe objects (-> connections). The default (and CURRENTLY only supported) type is a REST connection.

Below is an example from our JavaScript lib:

diff --git a/src/authentication/adapters/rest.js b/src/authentication/adapters/rest.js
index 680e000..41e4b19 100644
--- a/src/authentication/adapters/rest.js
+++ b/src/authentication/adapters/rest.js
@@ -6,196 +6,232 @@
*
**/
aerogear.auth.adapters.rest = function( moduleName, settings ) {
- var endPoints = settings && settings.endPoints || {};
+ // Allow instantiation without using new
$.fn.serializeJSON = function() {
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
// All taken from https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js
// When creating a new REST based pipe, a recordId can be configured
// An app using the lib can then use what ever record identifier it wants
aerogear.pipeline.adapters.rest = function( pipeName, recordId, settings ) { ... }
// Then during a save, I can check for a value assigned to that id to determine the request type
type = data[ this.recordId ] ? "PUT" : "POST";
// After that we get into whether or not data sync is happening, etc. but I do not rely on a particular record identifier

AeroGear DataManager JavaScript Specification

This is a very high level overview of the DataManager spec for the AeroGear.js library. This can also be used as inspiration for the other client libraries and is open for discussion from all points of view.

AeroGear.DataManager

Similar to AeroGear.Pipeline, this is an object used as a factory for creating new DataManager objects, which at this time are being referred to as valves in an attempt to stay with the Pipeline theme but is definitely not a name that is set in stone. A new valve is based off of adapters and planned adapters for the JS lib are memory (default), session/local storage, IndexedDB and possibly Web SQL though I believe this is no longer maintained and may be unnecessary. These objects then deal only with client side data.

Methods

Running "build-download" task
Initializing download module, might take a while
>> node.js:201
>> throw e; // process.nextTick error, or 'error' event on first tick
>> ^
>> TypeError: Object #<Object> has no method 'existsSync'
>> at setup (/Users/krisborchers/git-repo/jqueryui.com/node_modules/download.jqueryui.com/grunt.js:45:11)
>> at /Users/krisborchers/git-repo/jqueryui.com/node_modules/download.jqueryui.com/node_modules/async/lib/async.js:486:21
>> at /Users/krisborchers/git-repo/jqueryui.com/node_modules/download.jqueryui.com/node_modules/async/lib/async.js:185:13
>> at /Users/krisborchers/git-repo/jqueryui.com/node_modules/download.jqueryui.com/node_modules/async/lib/async.js:108:13
Kriss-MacBook-Pro:jqueryui.com krisborchers$ grunt deploy
Running "clean:folder" (clean) task
Folder "dist/" contents removed.
Running "lint:grunt" (lint) task
Lint free.
Running "build-pages:all" (build-pages) task
Built 2 pages.
total 56
drwxr-xr-x 14 krisborchers staff 476 Aug 28 22:34 .
drwxr-xr-x 10 krisborchers staff 340 Aug 30 07:20 ..
-rw-r--r-- 1 krisborchers staff 62 Aug 28 22:34 .npmignore
-rw-r--r-- 1 krisborchers staff 395 Aug 28 22:34 README.md
drwxr-xr-x 3 krisborchers staff 102 Aug 28 22:34 app
-rw-r--r-- 1 krisborchers staff 587 Aug 28 22:34 frontend.js
-rw-r--r-- 1 krisborchers staff 5654 Aug 28 22:34 grunt.js
drwxr-xr-x 5 krisborchers staff 170 Aug 28 22:34 lib
drwxr-xr-x 3 krisborchers staff 102 Aug 28 22:34 log