JavaScript for Line of Business Applications
606.6K views | +10 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!

Dynamic D3 with Knockout.js

Dynamic D3 with Knockout.js | JavaScript for Line of Business Applications | Scoop.it

So, how can we combine these two immensely powerful libraries to do something interesting? Or at least vaguely interactive.

Let’s see if we can use D3 to draw some rectangles, described in a Knockout view-model, which we can modify using D3 or by altering the data itself.

There is some overlap in functionality here: KO enables us to generate DOM content based on data, as does D3. In theory we could use a KO template to generate fragments of SVG markup for each of our view models. But that would involve generating the elements long-hand and we wouldn’t have the association between view and view-model.

Now, we need a way of getting the KO data fed to D3 at the right time: when it’s updated.

One of the first things to notice is that if we observe the array of rects, we only see changes to the array, not to its elements. In other words, we only know when items are added or removed, not when elements properties are changed. Seeing as we need to know when a rectangle’s position changes, we’ll need to do some more work.

- See more at: http://www.voyce.com/index.php/2013/06/23/dynamic-d3-with-knockout-js/#sthash.IDxcsa5W.dpuf

No comment yet.
Scoop.it!

How to use History.js with Ember.js

How to use History.js with Ember.js | JavaScript for Line of Business Applications | Scoop.it

You may want to read this post if:
* you want your URLs to look like /posts rather than /#/posts and to interact with browser history properly
* you need to support browsers that do not support session history management
* the Ember.AutoLocation feature is not yet available

If enough of that is true that you're still reading, then keep reading and I'll explain how to use History.js to make the pain go away.

No comment yet.
Scoop.it!

An introduction to creating scalable Single Page Applications with Knockoutjs and SASS

Everyone who develops web applications (or websites in general) knows that the basic tools for creating simple "Single Page Applications" are HTML5, CSS3, JQuery and a server side framework (such as ASP.NET MVC) for serving data to AJAX requests. Although those are sufficient for implementing SPAs, they tend to lead to implementations that violate basic software design principles, leading to designs that are not easily scalable, difficult to debug and overly complicated.

In this post we will see how we can take advantage of the Knockoutjs and Syntactically Awsome StyleSheets - SASS frameworksin order to design SPAs.

No comment yet.
Scoop.it!

Backbone Antipatterns

Backbone Antipatterns | JavaScript for Line of Business Applications | Scoop.it

Backbone.js deserves a lot of credit for bringing MVC to mainstream client-side Javascript development. That said, many beginners ask what the ‘right way’ of doing something with Backbone is. The bad news is that there’s not necessarily a ‘right way’ – it all depends on the problem you are trying to solve. The good news is that there are definitely some ‘wrong ways’ that you should avoid on your way to finding the right solution for your particular problem.

In this post I’ll cover some of these anti-patterns, as well as some general advice for the new starter. I’ve ordered the anti-patterns roughly by significance from the major to the more trivial. Don’t be too upset if you’ve done something on this list – I’ve made most of these mistakes myself 

No comment yet.
Scoop.it!

Introduction to Knockout.js and CRUD Operations in ASP.Net Web Forms Using Knockout.JS

Introduction to Knockout.js and CRUD Operations in ASP.Net Web Forms Using Knockout.JS | JavaScript for Line of Business Applications | Scoop.it
This article is an introduction to Knockout.js and CRUD Operations in ASP.NET Web Forms using Knockout.JS.

The development paradigm has been changing rapidly for a last few years. The out of the box technologies have been introduced to develop applications with fast, scalable, extensible structure, easy to maintain and easy to use. Knockout.JS is also one of the examples of such emerging technologies. I take an opportunity to explain the concept and topic my way.

Jan Hesse's insight:

Part2:

http://www.codeproject.com/Articles/696466/Complete-End-to-End-CRUD-Operations-Using-Knockout

No comment yet.
Scoop.it!

Knockout Validation Rules Engine

We have recently begun working with Knockout.js and needed a way to run validation on the models. We found the amazing plugin Knockout.Validation. This plugin did an awesome job and we were able to port over all our jQuery Validation rules fairly easy. As I was working with the plugin, my model grew and additional models were being created it became tedious having to append every rule to every model property and not remember which rules applied to which model properties across model contexts. Thus the concept of the Knockout Validation Rule Engine was born.

No comment yet.
Scoop.it!

Paginated Collections with Ember.js + Solr + Rails

Paginated Collections with Ember.js + Solr + Rails | JavaScript for Line of Business Applications | Scoop.it

This time, I would like to show you how to add a simple pagination helper to your Ember.js application.

For this example, I will be using Rails + Solr for the backend and Ember.js as my frontend framework.

I am doing this with Rails and Solr, but you can do it using other backend frameworks, as long as the JSON's response resembles what we have here:

Before we start, there's something I want to say, just in case you are using the ember-rails gem. 

I have created a new Model, Serializer and Controller on Rails. So, all this means that I'm going to need a newEmber.js model, in order to get it working. Remember, the store is in charge of finding the models through the adapter. It will communicate with the new Rails controller to serialize the new model.

From my point of view, we can have many paginated collections inside an application. So, one way to avoid code duplication is the use of Ember.js Mixins. 


No comment yet.
Scoop.it!

Modules: The Right Way

Modules: The Right Way | JavaScript for Line of Business Applications | Scoop.it

A module done "the right way" primarily means: it works. It doesn't error or run code in an unexpected way when you're deploying, have other developers running your code or come back to update a project some time in the future. Other problems like files space and ease of use should be secondary concerns.

I am using the term "modules" in the most generic sense of the word. These concepts can apply to your project structure, package manager or the very way you write code. I'll attempt to explain these concepts a generic way then provide real world examples.

No comment yet.
Scoop.it!

How to Unit Test Controllers In AngularJS Without Setting Your Hair On Fire

How to Unit Test Controllers In AngularJS Without Setting Your Hair On Fire | JavaScript for Line of Business Applications | Scoop.it
Developers almost universally agree that unit tests are a VERY GOOD THING when working on a project. They help you feel like your code is airtight, ensure reliability in production, and let you refactor with confidence when there is a need to do so.

AngularJS code touts its high degree of testability, which is a reasonable claim. In much of the documentation end to end tests are provided with the examples. Like so many things with Angular, however, I was finding that although unit testing was simple, it was not easy. Examples were sparse and though the official documentation provided some snippets of examples, putting it all together in my “real-world” case was proving challenging. So here I’ve written a little bit about how I ended up getting that wonderful green light for a passing build to show up.

* Instant Karma

* Writing Tests With Jasmine

* $httpBackend Is Cool

* Conclusion

No comment yet.
Scoop.it!

Making Dashboards with Dc.js - Part 1: Using Crossfilter.js

Making Dashboards with Dc.js - Part 1: Using Crossfilter.js | JavaScript for Line of Business Applications | Scoop.it

Dc.js is a JavaScript library used to make interactive dashboards in JavaScript. By clicking and selecting different events in graphs, you can filter the entire dashboard to drill into a particular event.

In order to do this, DC.js relies on two other JavaScript plugins/libraries: D3.js and Crossfilter js.

With this first art we're going to start off with how Crossfilter works because most of the actual dashboard code is manipulating the data for the charts. Once you have a good understanding of how that works, the actual graphing is pretty simple. I'm going to try to cover several different scenarios, so you can hopefully avoid some of the pitfalls as you start to use it.

No comment yet.
Scoop.it!

Unit testing an AngularJS directive

Unit testing an AngularJS directive | JavaScript for Line of Business Applications | Scoop.it

In this article, i’ll detail the process to unit test the stepper directive we’ve created in the last week custom component creation article. Next week, i’ll cover how to distribute your component via GitHub and Bower.

Unit testing is the art of testing individually every smallest part of your code, which are the foundations of your apps sanity. Once correctly tested, these parts assembled together will also play nicely, as their behaviour has already been validated independently.

Unit testing helps you prevent regressions, increase quality, maintenability, and trust in your codebase, thus better team collaboration, easier refactoring… and WIN :)

Another usage is, when you get a new bug report, you add the revelant test that demo the bug, fix it in your code so the test will pass, then keep it there as a proof of reliability.

No comment yet.
Scoop.it!

6 secrets of JavaScript Jedis

6 secrets of JavaScript Jedis | JavaScript for Line of Business Applications | Scoop.it
The trick to mastering JavaScript is knowing when and how to use some of its more idiosyncratic patterns and constructs. Get coding tips for using closures, inheritance, and more in JavaScript.

* Closures

* Higher-order functions

* Invoking functions

* What’s this?

* Protecting the global scope

* Inheritance

No comment yet.
Scoop.it!

Full-Stack JavaScript With MEAN And Yeoman

Full-Stack JavaScript With MEAN And Yeoman | JavaScript for Line of Business Applications | Scoop.it
Introduction A trend proliferating amongst prototypers in the Angular community is full-stack JavaScript development via the MEAN stack. The acronym stands

Supporters of the stack claim the use of JavaScript all the way down increases productivity and it’s hard to dispute that this notion is pretty appealing. You get consistent models across the stack and consistent best practices in many cases too.

For example, in the case of Mongo – you can store documents in a JSON-like format (BSON – Binary JSON objects), author JSON queries in Express/Node and pass these JSON documents back to an Angular powered frontend. At a high-level, this is compelling and certainly make ease debugging when the objects in your database are identical to those your JS sees.

Note: There is little about the MEAN stack heavily coupled to Angular and a developer could substitute it for Backbone.js, Ember.js, Polymer or any other framework without losing the single-language stack advantages it offers.

No comment yet.
Scoop.it!

Complementing SignalR's real-time communication with Knockout.js

Complementing SignalR's real-time communication with Knockout.js | JavaScript for Line of Business Applications | Scoop.it

n line with proper software design practices, we want code that has clean separation of concerns and is easily testable. This code runs counter to those goals. If we take a closer look at the file, we can see several reasons why. The most obvious culprit is the huge chunk of HTML markup assigned to the rowTemplate variable, a clear violation of separation of concerns. The lack of testability is slightly more subtle, and there are actually two issues that make this code difficult to test. The first issue is that everything is scoped to jQuery’s .ready method, so there is no public surface area for a test framework to hook into. The second issue deals with the jQuery selectors that are used to find and update specific DOM elements — which wouldn’t exist in a test environment where our JavaScript code is being run in isolation, in a headless browser. So what can we do to fix these issues?

 

This example is an excellent candidate for refactoring to use the MVVM pattern. We’ve had great success with this pattern on the FNC.br project, and more specifically with the Knockout.jsframework. In this post, I’ll show you how to modify the stock ticker example in the Microsoft tutorial using MVVM, resulting in testable code with cleanly separated concerns. The SignalR messages we receive are essentially an observable stream of events, which fits perfectly with Knockout’s Observable/Observer paradigm. These messages will serve as our Model. Our View will be the StockTicker.html page, with declarative Knockout bindings in place of the “poor man’s templating” solution used in the tutorial.  And finally, for our ViewModel, we’ll create a pure JavaScript code file with enough of a public interface to test. Let’s get started.

No comment yet.
Scoop.it!

Monolithic Node.js

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

Are large-scale Node.js systems possible with mainstream developers? If you believe that these large-scale Node.js systems will resemble the large-scale Java and .Net systems you have known and loved, then the answer is, emphatically, no. JavaScript is far too weak a language to support the complexity inherent in systems of such scale. It’s not exactly type-safe, and half the language is unusable. There’s a reason the best-selling book on the language is called JavaScript, The Good Parts.

Despite this, we’ve managed to build quite a few large-scale systems at my company, nearForm. Here’s what we’ve learned, and how we do it.

The defining attribute of most large-scale, mainstream traditional systems is that they are monolithic. That is, a single large codebase, with many files, thousands of classes, and innumerable configuration files (in XML, if you’re lucky). Trying to build a system like this in JavaScript is indeed the path to madness. The visceral rejection of Node.js that you see from some quarters is often the spidey-sense of an experienced enterprise developer zapping them between the eyes. JavaScript? No! This reaction is entirely justified. Java and .Net have been designed to survive enterprise development. They enable monolithic architecture.

No comment yet.
Scoop.it!

JavaScript Promises: There and back again

JavaScript Promises: There and back again | JavaScript for Line of Business Applications | Scoop.it
What's all the fuss about?

JavaScript is single threaded, meaning that two bits of script cannot run at the same time, they have to run one after another. In browsers, JavaScript shares a thread with a load of other stuff. What that stuff is differs from browser to browser, but typically JavaScript is in the same queue as painting, updating styles, and handling user actions (such as highlighting text and interacting with form controls). Activity in one of these things delays the others.

 

* What's all the fuss about?
* Events aren't always the best way
* Promise terminology
* Promises arrive in JavaScript!
* Browser support & polyfill
* Compatibility with other libraries
* Complex async code made easier
* Promisifying XMLHttpRequest
* Chaining
* Error handling
* Parallelism and sequencing - Getting the best of both
* Promise API Reference

No comment yet.
Scoop.it!

Commangular - COMMAND FRAMEWORK FOR ANGULARJS

Commangular - COMMAND FRAMEWORK FOR ANGULARJS | JavaScript for Line of Business Applications | Scoop.it
Commangular is an abstraction on top of AngularJS that aims at simplifying the creation and organization of operations in a self-contained code units and chain them together with an easy andfluent API.

AngularJS is declared as a MVW framework. MVW is Model-View-Whatever, "Whatever fits to you". Commangular lives in the whatever side. I define Commangular as a unified controller for AngularJS that aims to totally separate view layer and infrastructure layer in an AngularJS application.

Of course, this is not the only option you have to architect an angularJs application, is just one option that gives you powerfull things like interception, operation chaining and other planned concepts like commangular-spoof for backendless development and rapid prototyping.

No comment yet.
Scoop.it!

angularjs-FlightDashboard

angularjs-FlightDashboard | JavaScript for Line of Business Applications | Scoop.it
angularjs-FlightDashboard - Demonstrations of Promise Chaining with AngularJS $q
No comment yet.
Scoop.it!

Announcing Dynatable.js

Announcing Dynatable.js | JavaScript for Line of Business Applications | Scoop.it

HTML5+JSON interactive table plugin.

Dynatable is a funner, semantic, interactive table plugin using jQuery, HTML5, and JSON. And it's not just for tables.

The core focus of Dynatable is to provide:

1. A clear and robust API, that mostly stays out of your way, but allows absolute control to those who need it, and which follows standard JavaScript naming and namespacing conventions.

2. Speed and efficiency, by striking a balance between clean, readable code and memory and performance optimizations.

No comment yet.
Scoop.it!

JavaScript Compression libraries (libraries and test conditions)

JavaScript Compression libraries (libraries and test conditions) | JavaScript for Line of Business Applications | Scoop.it

I had a chance to perform investigation of JavaScript based compression. In this investigation I tried to
compare Compression, Decompression and Integration with other platforms (like Java) of all libraries I was able to find.

Current post contain libraries overview and test conditions. Next posts will contain actual result of compression, decompression and integration:
* Compression ratio
* Compression performance
* Integration of compression librearies with other platforms
* Deflate libraries integration
* LZW libraries integration
* Other libraries integration
* Decompression performance
* Decompression on other platforms

Jan Hesse's insight:

http://problemsolverblog.blogspot.de/2011/10/javascript-compression-libraries_21.html

No comment yet.
Scoop.it!

Unit and End to End Testing in AngularJS

Unit and End to End Testing in AngularJS | JavaScript for Line of Business Applications | Scoop.it

Unit testing is a technique that helps developers validate isolated pieces of code. End to end testing (E2E) comes into play when you want to ascertain that a set of components, when integrated together, work as expected. AngularJS, being a modern JavaScript MVC framework, offers full support for unit tests and E2E tests. Writing tests while developing Angular apps can save you great deal of time which you would have otherwise wasted fixing unexpected bugs. This tutorial will explain how to incorporate unit tests and E2E tests in an Angular application. The tutorial assumes that you are familiar with AngularJS development. You should also be comfortable with different components that make up an Angular application.

We will use Jasmine as the testing framework and Karma as the test runner. You can use Yeoman to easily scaffold a project for you, or just quickly grab the angular seed app from GitHub.

No comment yet.
Scoop.it!

JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks

JSMVCOMFG: To sternly look at JavaScript MVC and Templating Frameworks.

Security Research on commen Frameworks schowing their weakest parts.
No comment yet.
Scoop.it!

Writing Fast JavaScript For Games & Interactive Applications

Writing Fast JavaScript For Games & Interactive Applications | JavaScript for Line of Business Applications | Scoop.it

Recent versions of JavaScript engines are designed to execute large bodies of code very fast but if you don't know how JavaScript engines work internally you could easily degrade your application's performance. It's specially true for games that need every drop of performance they can get.

In this article I will try to explain some common optimization methods for JavaScript code that I picked up during development of my projects.

* Garbage Collection
* JavaScript Internals
* Deleting Object Properties
* Monomorphic Variables
* Arrays
* Conclusion

Tyler Richendollar's curator insight, December 15, 2013 9:28 PM

Optomize your  JavaScript for interactive applications-- this article shows several ways how.

Scoop.it!

Effective Unit Testing with AMD

Effective Unit Testing with AMD | JavaScript for Line of Business Applications | Scoop.it

AMD (short for Asynchronous Module Definition) is a JavaScript API specification for structuring modular code. The web abounds with blog posts illustrating its use in front-end application development (and there’s plenty of healthy debate around its necessity, too). The topic of unit testing (despite being integral to the process of software development) does not receive much attention in these discussions.

As it happens, AMD has an impact on how one authors tests. More than just dictating some additional function calls, AMD (and the RequireJS library in particular) can actually enhance unit test suites.

 

Finally, if you’re convinced AMD is right for your project, then the truth is: your hands may be tied. The structure of an application dictates the structure of its unit tests. This means your test environment is going to have to account for that sweet, sweet asynchronicity of your module definitions.

No comment yet.
Scoop.it!

7 lines JavaScript library for calling asynchronous functions

7 lines JavaScript library for calling asynchronous functions | JavaScript for Line of Business Applications | Scoop.it

I was surprised by the good feedback for JavaScript template engine in just 20 lines and decided to blog for another small utility function which I'm using often. While we are talking about JavaScript in the browser, most of the operations are asynchronous. We are dealing with callbacks all the time and sometimes we end up with awesome callback hell.

Let's say that we have two functions and we want to call them one after each other. They both operate with same variable. The first one sets its value and the second one uses it.

No comment yet.