JavaScript for Line of Business Applications
606.5K views | +6 today
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...

Popular Tags - Filter using the Funnel

Scoop.it!

Overview of Derby.js and Meteor.js

With a focus on their philosophy (vs practical usage tips)...

Agenda
* Derby.js/Meteor.js - Common Concepts
* A little more about Derby.js
* A short Derby.js demo (Oooooo)
* A little more about Meteor.js
* A short Meteor.js demo (Ahhhhh)
* Discussion & Beers (Yummm)

No comment yet.
Scoop.it!

Computed Properties in Ember.Js

Computed Properties in Ember.Js | JavaScript for Line of Business Applications | Scoop.it

In a nutshell, it's a property whose value is computed the first time it's asked for. You can defined the computed property as a function and when someone asks for it, Ember will automatically invoke the function and treat the return value like value of the property.

y default, all computed properties are cached. That means that once you requested the value of computed property (called get on it), it's going to compute and cache its value. Computed property gets recomputed when any of the properties it depends on changes.

* How is CP different from Observers and Bindings?

* What do I use and when?

 

No comment yet.
Scoop.it!

FluentKnockoutHelper - generate Knockout syntax with strongly typed, fluent, lambda expressions for ASP.NET MVC

FluentKnockoutHelper - generate Knockout syntax with strongly typed, fluent, lambda expressions for ASP.NET MVC | JavaScript for Line of Business Applications | Scoop.it

* Painlessly generate Knockout syntax with strongly typed, fluent, lambda expression helpers similar to ASP.NET MVC
* Rich intellisense and compiler support for syntax generation
* Fluent syntax makes it a breeze to create custom helpers or extend whats built in
* OSS alternative to ASP.NET MVC helpers: feel free to add optional features that everyone in the community can use and I'll merge your pull in ASAP!
* Painlessly provides validation based on .NET types and DataAnnotations in a few lines of code for all current/future application types and changes
* Client side JavaScript object factory (based on C# types) to create new items in for example, a list, with zero headaches or server traffic

 

Durandal.js is a new framework that uses Knockout, jQuery, Require and Sammy that makes it very easy to create single page applications. It 'just works' with Knockout and feels very clean so I have created the Survey App using it. Also take note other than for the start page and WebAPI MVC isn't used at all for views. This seems pretty natural so far but time will tell as it is built out.

Take a look at Survey App demo to see a full demo using Durandal.js

No comment yet.
Scoop.it!

Start testing your app with CasperJS

Start testing your app with CasperJS | JavaScript for Line of Business Applications | Scoop.it

We have invested a lot of time in our unit and acceptance testing, but we also need to test our application after deployment or on a staging infrastructure.

We have looked into several tools, including Selenium and Testacular, but found that CasperJS provides the perfect mix of being easy to use and being powerful enough for our purposes.

We wanted a tool that doesn’t have any dependencies on languages or frameworks a team may use. While tools like Capybara are great and neatly integrated into Rails they still need some effort to be set up. And if you don’t use Rails you are out of luck.

We also wanted everyone on our team to be able to write tests with it. The syntax therefore needed to be easy and comfortable for all of us. CasperJS is based on Javascript but has Coffeescript support built in. WIN!

No comment yet.
Scoop.it!

Using Base Controllers In AngularJS - An Experiment

Using Base Controllers In AngularJS - An Experiment | JavaScript for Line of Business Applications | Scoop.it

I've started using the Revealing Module Pattern a lot more than I ever have before. While many things have contributed to this shift, one feature, or lack thereof, was the inability to use Base Controllers in AngularJS. Since Controllers cannot be generated within Factories, it seemed that Base Controllers could only be provided through global references (which goes against everything that AngularJS stands for). That said, after my conversation yesterday, I wanted to give Base Controllers one more try.

NOTE: This is just an experiment in using Factories to generate Controllers. I am not necessarily advocating this approach - see final paragraph.

In JavaScript, when you invoke a constructor function, the return value of the construtor matters. If you don't return anything, JavaScript will use the instantiated object as the result of the invocation. If, however, you return a value (other than "this") from the constructor function, JavaScript will use that return value as the result of the invocation.

When it comes to AngularJS, we can leverage this language feature to fake the ability to create Controllers inside of Factories. The idea is simple, but a bit confusing. And, after some trial and error, I finally got it to work. What we're going to do is turn our Controller into a factory.

No comment yet.
Scoop.it!

Twitter Bootstrap Modals and Knockout.js

Twitter Bootstrap Modals and Knockout.js | JavaScript for Line of Business Applications | Scoop.it

Displaying modal dialog boxes directly from your Knockout view models turns your application into unmaintainable jQuery spaghetti. Your once clean view model, is now fighting with the DOM and dragging you into callback hell.

Imagine instead maintaining a clear separation of concerns between your view models and your UI. Views models only need to collaborate with other view models, never with the DOM.

This post will teach you how to use Twitter Bootstrap modals in a Knockout.js application, while keeping your code clean and simple.

You'll learn how to use Knockout's built-in function, ko.renderTemplate, to generate a modal dialog box UI, on-demand, from a template.

This post will also show how jQuery's Deferred object can neatly manage the asynchronous nature of displaying a modal dialog and waiting for its result.

No comment yet.
Scoop.it!

PhoneGap 3 for Dummies, Part 1: Setup and a first example

PhoneGap 3 for Dummies, Part 1: Setup and a first example | JavaScript for Line of Business Applications | Scoop.it

I found a lot of tutorials for PhoneGap 2, but I couldn’t find any PhoneGap 3 tutorial. That’s why I start a PhoneGap 3 tutorial session. Please note, I never worked with PhoneGap 2, so please correct me if I’m wrong.

In the first part I want to install PhoneGap 3 and deploy a sample example into the Android / iOS simulator.

Prerequisites:

* Node Js

* NPM

* Google Android 4.2.2 (API 17), SDK build tools

or

* XCode and Brew

No comment yet.
Scoop.it!

Knockout.js Tips and Tricks

Knockout.js Tips and Tricks | JavaScript for Line of Business Applications | Scoop.it

I presented a session on Knockout tips and tricks. These were some things that I felt would be useful to a developer after they have the basics of Knockout done. The session included these ten rounds of tips:

* Dynamic Templating

* Controlling “this”

* Throttling

* Subscriptions

* Custom Bindings

* Extensions

* Computed options

* Binding Providers

* Debugging Tips

* Code Smells

 

For this type of talk with lots of live coding, it is challenging to share the slides. So, I recorded a screencast of the presentation.

No comment yet.
Scoop.it!

Learning Javascript with Object Graphs (Part II)

Learning Javascript with Object Graphs (Part II) | JavaScript for Line of Business Applications | Scoop.it

The first article using graphs to describe JavaScript semantics was so popular that I've decided to try the technique with some more advanced ideas. In this article I'll explain three common techniques for creating objects. They are constructor with prototype, pure prototypal, and object factory.

My goal is that this will help people understand the strengths and weaknesses of each technique and understand what's really going on.

No comment yet.
Scoop.it!

TypeScript State Machines

TypeScript State Machines | JavaScript for Line of Business Applications | Scoop.it

So it's probably fairly easy to see, if I like JavaScript and I like static typing, why TypeScript could seem apper attractive prospect. And here was a nice little project that was non-trivial but still pretty compact that I could try it out with.

The type annotations in TypeScript are optional, but since I'm writing the code from scratch it makes sense to use them throughout. Interfaces are defined but do not need to referenced by types that implement the interface - so long as they have all of the required properties and methods then they will implicitly be considered to implement the interface. This is like Google's Go language and not like C#.

One thing that I don't like too much is that it isn't currently possible to specify an interface with readonly properties. It must be a property with a getter and setter or nothing. So I've resorted to specific Get methods on the interfaces instead, such as GetColour() and GetState().

No comment yet.
Scoop.it!

Complex Architectures in Ember

In Ember.js, routes and templates dictate the architecture of your app. This presentation will talk about why this is, and what tools Ember provides to manage architectural complexity.

No comment yet.
Scoop.it!

Ember JS & SEO - Make your App crawlable with the Hashbang Location

Ember JS & SEO - Make your App crawlable with the Hashbang Location | JavaScript for Line of Business Applications | Scoop.it

The topic of Search Engine Optimization (SEO) pops up quite often, when disadvantages of Javascript MVC frameworks are discussed. Naturally webapps written entirely in Javascript are not crawable without any actions taken by you. In this article i will discuss the fundamental problems of javascript mvc apps in this topic and then i will present a solution for EmberJS Apps.

All crawling approaches basically need to solve two problems:

* Search Engines must be able to discover URLs, which should be crawled.

* Your server must be able to respond to these URLs, when the Search Engine crawler asks for it.

Let’s first discuss these two problems and possible solutions. Afterwards i will discuss two common approaches adressing both problems.

No comment yet.
Scoop.it!

Handle Keyboard events in an Ember.js view

Handle Keyboard events in an Ember.js view | JavaScript for Line of Business Applications | Scoop.it

We ran into a situation where we wanted to be able to close our ember.js view (a modal) when the user pressed the esc key.

We could have also just defined a keyUp method directly on the view, but it's always fun to play with new stuff. Unfortunately, this didn't work. It looks like it should and it fact it does exactly what you've asked it to do. It watches for keyUp events on the view, but not global keyUp events. The user has to click on some part of your view to give it focus and then press the esc key. We even tried setting the focus and add tabIndex="0" to our top level div. Those techniques kind of worked, but it still didn't feel right. We found that we still had to click on the page to get the keyUp event to make it into our view. For end users that wasn't going to work so back to our original code we went.

No comment yet.
Scoop.it!

Testing synchronous and asynchronous JavaScript callbacks with QUnit

Testing synchronous and asynchronous JavaScript callbacks with QUnit | JavaScript for Line of Business Applications | Scoop.it

QUnit is a JavaScript unit testing framework. It is used to test projects like jQuery,jQuery UI and jQuery Mobile. It has got strong roots in frontend JavaScript testing and includes some neat features to test DOM operations. That’s why we’re using it for frontend testing in this screencast. QUnit is perfectly capable of testing your node.jsprojects as well, though.

 

Synchronous callbacks

How do you test that a callback function gets called after you pass it to another function? You can pass an anonymous function containing an assertion as a callback. But then the problem is, even if this assertion never gets executed, the test won’t fail because all other assertions passed. In QUnit, you can tell a test how many assertions should succeed. This way the test will fail if some assertions don’t get executed.

 

Asynchronous callbacks

But what if a callback is only invoked some time later, after a result came in or after some time passed? The test will probably have finished unsuccessfully by then. QUnit allows tests to wait for asynchronous callbacks to be called.

The screencast contains examples of both, synchronous and asynchronous callbacks. Watch the screencast to learn more!

No comment yet.
Scoop.it!

Building a Dynamic Application Menu with Durandal.js, Knockout, and Bootstrap

Building a Dynamic Application Menu with Durandal.js, Knockout, and Bootstrap | JavaScript for Line of Business Applications | Scoop.it

I’m going to do a longer series here about how to create a dynamic menu bar system with Durandal, Knockout, and Twitter Bootstrap.  This menu bar is going to emulate the traditional desktop application menu bar you find in apps (like the File, Edit, or View menus, for example).  The special thing here is that it will be 100% dynamic.  This will allow interesting scenarios such as dynamically altering the application menu when the application is in a different mode or allow something like plug-ins to alter the menu structure adding new commands.

Jan Hesse's insight:

The other parts are:

http://www.timlabonne.com/2013/07/building-a-dynamic-application-menu-with-durandal-js-knockout-and-bootstrap-pt-1/

http://www.timlabonne.com/2013/07/building-a-dynamic-application-menu-with-durandal-js-knockout-and-bootstrap-pt-2/

http://www.timlabonne.com/2013/07/building-a-dynamic-application-menu-with-durandal-js-knockout-and-bootstrap-pt-3/

http://www.timlabonne.com/2013/07/improving-on-kolite/

No comment yet.
Scoop.it!

Ember Table - A fast, lazy rendered, easily extensible table built with Ember.js

Ember Table - A fast, lazy rendered, easily extensible table built with Ember.js | JavaScript for Line of Business Applications | Scoop.it
Tree Table

Sort, freeze, resize, and rearrange columns. Collapse and select rows. Freeze headers and footers. Navigate with keyboard.

Table With Lots of Rows

Lazy rendering means huge tables stay incredibly fast.

Editable Table Cells

It is easy to add custom content to cells.

Table with Bar ChartsTable with D3 Sparkline

Inspired by example from Edward Tufte's book Beautiful Evidence.

Table with Ajax

Loading Github events using Ajax!

No comment yet.
Scoop.it!

Node.js vs. PHP

Node.js vs. PHP | JavaScript for Line of Business Applications | Scoop.it

PHP is not going to disappear soon, but its position is being undermined even further by the nascent Node.js. When the Internet exploded in the 2000′s, PHP was the thing ”all the cool kids” did.

Over the years, PHP and its apps became vulnerable to security threats (e.g., SQL injections), lacked a centralized packaging registry (was Composer inspired by Node Package Manager?), had an inconsistent API and suffered from subpar performance. It’s easy to argue that there are better alternatives to PHP, for example Ruby on Rails and Django, however nothing is as approachable as Node.js.

For those of you who aren’t familiar with Node.js, or who have heard of it but can’t quite grasp the concept, I like to say that it is functionally similar to the PHP + Apache or ASP + IIS stacks. Nowadays, it is also gaining momentum.

Many people, whether software engineers or entrepreneurs, are often faced with the decision: “What tech stack should I use?” In this article, I’ll try to compare PHP and Node.js using an apples-to-apples approach, looking at the question from different angles including:

* Syntax

* Context switch

* Modules
* Ecosystem
* Frameworks
* Real-time apps
* Database apps
* Third-party services apps
* Web servers
* Hosting
* Performance


Entropic-Synergies's curator insight, September 19, 2013 4:06 AM

Seems an objective comparison

Agtunn Naymin's curator insight, October 8, 2013 3:45 AM

should try appserver.io is multithread PHP Server

Scoop.it!

ExtJS Best Practices

ExtJS Best Practices | JavaScript for Line of Business Applications | Scoop.it

ExtJS is a powerful Javascript framework for developing rich Internet applications—but with great power comes great responsibility. If you are inexperienced or careless with your implementation, your development effort can quickly spin out of control. Your project structure might grow to become unruly, steepening the learning curve for developers new to the framework. Worse yet, performance issues may arise that can be tricky to deal with once they have a foothold within your application.

Equipped with some tips from Senchacon ‘13 and my past experience with ExtJS, I’d like to share some knowledge that will help you be proactive against these issues and avoid potential roadblocks.

No comment yet.
Scoop.it!

The Broad Strokes of Meteor Permissions in Meteor js

The Broad Strokes of Meteor Permissions in Meteor js | JavaScript for Line of Business Applications | Scoop.it

Let’s talk permissions. In particular, how Meteor js handles permissions and how you can use them to:

* Secure your content so that people only see what they are allowed to see.

* Avoid performance issues by only loading for the user stuff that he needs to see at that given moment (and not the entire universe of information).

 

The way Meteor does this is actually rather elegant. If you are familiar with Drupal, the closest equivalent would be a menu_hook. If you’re not familiar with Drupal, it’s not too complicated. Basically, in your server code (the code that the client can’t see), you define a series of values in a couple functions that tell the client what he is allowed to store in his local MogoDB.

But before I get ahead of myself, let’s first break out how Meteor is storing the data your user is seeing.

No comment yet.
Scoop.it!

A Glimpse of Angular.js $scope via Example

A Glimpse of Angular.js $scope via Example | JavaScript for Line of Business Applications | Scoop.it

Angular.js is nice. I especially feel so after I started to write Backbone.js again - I had to maintain a project written in Backbone.js. Every time I write Backbone.js, I cannot help imagining how simple and easy the code and test will be if it is written in Angular.js.

However, Angular.js does have its own complexities. One of the most confusing part is its $scope life cycle. Let me use a real-life example. A few days ago, I was building this feature: when the user clicks a button, an input box appears and the focus is on the input box.

In Angular.js, you are not supposed to manipulate DOM in controller. Instead, you should write directive. 

We write our own directive called “focusIf” and will trigger a focus event whenever the expression is true. It’s simple and elegant, until you realize it does not work.

No comment yet.
Scoop.it!

Learning Javascript with Object Graphs (Part III)

Learning Javascript with Object Graphs (Part III) | JavaScript for Line of Business Applications | Scoop.it

Part I of this series explained basic object graphs and visually described references, closures, and basic inheritance in JavaScript. Part II compared different styles for doing object-oriented programming in JavaScript. Now in Part III we'll get creative and look as Ruby's object model and compare it to how JavaScript works. Also I'll show how to implement some Ruby style classes. JavaScript is a very flexible language and can support about any object model you want with enough understanding and creativity.

No comment yet.
Scoop.it!

How Nodejs Makes Network Code More Testable

How Nodejs Makes Network Code More Testable | JavaScript for Line of Business Applications | Scoop.it

I am currently working on a project called Cloak, which is a network layer for multiplayer HTML5 games that handles lobbies, rooms, chat, reconnection to games, and so on. Cloak has both a client and a server component and handles all the communication between them. Traditionally this would be a huge hassle to write automated tests for, but Node.js has made it easy. Our tests use Nodeunit to run the actual Cloak server and actual Cloak clients at the same time! For example, one test configures a server to automatically create rooms when two users connect, then fires up two clients, connects them both, and confirms that a new room was created for them.

I have always been in favor of writing the types of tests that are most valuable for the application they’re testing. What I just described might be called integration testing(as opposed to unit testing), and to me that is exactly the kind of testing Cloak needs in order to really build confidence in the correctness of the library. Integration testing can be quite challenging on many platforms. Consequently, I’m all the more pleased with my results doing integration testing for Cloak.

No comment yet.
Scoop.it!

Learn TypeScript to Improve Your JavaScript

Learn TypeScript to Improve Your JavaScript | JavaScript for Line of Business Applications | Scoop.it

TypeScript is JavaScript for C# Developers. The CoffeeScript of .NETters. It is a superset of JavaScript that brings all the goodness of type-checking, classes, modules, lambda expressions and awesome tooling to the web front-end. Everything to make for a more productive and better JavaScript development experience.

Regardless of its many benefits, this brief article is not going to be a TypeScript tutorial nor a how-to. Instead, I will focus in the TypeScript feature that suprised me the most, the quality of the JavaScript generated by the TypeScript transcompiler and the transcompiler itself as a tool to learn JavaScript best practices.

No comment yet.
Scoop.it!

Making your ajax webapp crawlable

Making your ajax webapp crawlable | JavaScript for Line of Business Applications | Scoop.it

As awesome as Google's crawlbot is, it doesn't view your website like a real human does. If your page requires ajax requests to fire and javascript code to populate the DOM in order to view anything useful, Google won't see that. Here's how I've solved this problem for this blog.

I know you're like me and want a recipe instead of pouring over official documentation, so here it goes.

Google requires you to have not just a hash (#) be the delimiter right before your webapp's route, but a hashbang (#!). Ember doesn't support this out of the box, so we need to register a new type of location implementation.


No comment yet.
Scoop.it!

Automatic Paging with Knockout data-bindings

Automatic Paging with Knockout data-bindings | JavaScript for Line of Business Applications | Scoop.it

I’ve been a heavy user of Knockout JS and MVVM with JavaScript for over a year and I’ve found most designs can be achieved with the basic data-bindings. There are two scenarios that I have found which require specialized bindings. The first is a select box with numerous options. The second is a long list of data that doesn’t fit on a single screen.

I prefer to use the chosen jQuery plugin to manage unwieldy select boxes. The problem is combining the jQuery plugin with Knockout data-binding. For this I use a Knockout Binding Extension For Chosen. One caveat on this binding is that it can take a while to bind. If you have multiple select boxes with large amounts of data displaying dynamically, you can notice a significant delay. I ran into this problem when binding to an editable grid.

No comment yet.