JavaScript for Line of Business Applications
596.1K views | +0 today
Follow
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

Current selected tag: 'pattern'. Clear
Scoop.it!

JavaScript Clean Coding Best Practices - Node.js at Scale

JavaScript Clean Coding Best Practices - Node.js at Scale | JavaScript for Line of Business Applications | Scoop.it
This post covers general clean coding guidelines for naming and using variables & functions, as well as some JavaScript specific clean coding best practices
No comment yet.
Scoop.it!

Applying the Adapter Pattern for Analytics in Ember.js Apps

Applying the Adapter Pattern for Analytics in Ember.js Apps - The Ember Way - Medium

In this post, we’ll explore what the adapter pattern is, what it gives us, and demonstrate how to implement it to enable one API for orchestrating multiple analytics services.

We generally have a few players in the adapter pattern: the client, the adapter (or wrapper), and the adaptee.

No comment yet.
Scoop.it!

JavaScript Code Smells

JavaScript Code Smells | JavaScript for Line of Business Applications | Scoop.it

In the past I've given presentations, recorded videos, and written blog posts about fixing common JavaScript and jQuery bugs. This is a good skill to have, but what about working code? Fixing broken code is important, but have you ever gotten into the situation where your code works, but it doesn't feel quite right... maybe even smells?

No comment yet.
Scoop.it!

Replaying bugs with Flux

Replaying bugs with Flux | JavaScript for Line of Business Applications | Scoop.it

It’s important to note that with React with Flux, the application state lives outside of the UI-components, in the store(s). The stores populate their state according to the actions and the UI merely reflects this state. A UI defined with React can be seen as a pure function: given the same input (state), it will always produce the same output (ui).

Flux was inspired by CQRS and Event Sourcing. For those unfamiliar: think think of it as a simple version control system: each action is a commit, all consecutive commits give you the current state.

To record actions in Flux, we need to either extend the dispatcher with this functionality or create a new component which listens to the dispatcher. I’ve published a proof-of-concept on GitHub called FluxRecorder, which does the latter.

No comment yet.
Scoop.it!

Designing Front-End Components

Designing Front-End Components | JavaScript for Line of Business Applications | Scoop.it

In my experience, I've found that the best pieces of code I've ever used tend to follow the UNIX philosophy of doing one thing very well. Having that kind of focused approach to front-end modules typically isn't the case. Instead, we often develop solutions that are only useful in our specific use. For example, we may put together an entrenched AngularJS directive that uses other directives or relies on data-binding provided by Angular.

What's worse, most often we don't just limit ourselves to the scope of the libraries we're currently using, but to the specific scope of the one project we're working on. This means that now our library can't be extricated from that database without considerable work.

No comment yet.
Scoop.it!

Aspect Oriented Programming in JavaScript

Aspect Oriented Programming in JavaScript | JavaScript for Line of Business Applications | Scoop.it

As discussed above JavaScript supports both OOP and FP. It also turns out that it is very easy to add support for AOP to JavaScript by writing a simple library. JavaScript allows to easily redefine methods, add properties to objects during execution time, and also functions are objects in JavaScript. As a result a full-fledged Aspect Oriented Framework in JavaScript is only about 150 lines long as you will shortly see.


Our library will support the following:

  • Aspect – just functions, as almost everything in JavaScript is a function
  • Advice – “before” before method, “after” after method, “afterThrowing” when an exception is thrown, “afterReturning” just before returning a value from a function, “around” at the moment of function execution
  • Pointcut – “methods” all the methods of an object, “prototypeMethods” all the methods defined on the prototype of an object, “method” only a single method of an object
Jan Hesse's insight:

http://html5hub.com/oop-is-not-your-hammer/

No comment yet.
Scoop.it!

JavaScript Design Patterns

We've come a long way down the JavaScript road. Gone are the days of 'just hack it' for the web - architecting even a small project in JavaScript can be a challenge. Thankfully, there are several frameworks to help you; the most popular currently is AngularJS.

No comment yet.
Scoop.it!

Applying NASA coding standards to JavaScript

Applying NASA coding standards to JavaScript | JavaScript for Line of Business Applications | Scoop.it
This article is a try to apply NASA code guidelines to JavaScript / HTML development in order to use space software engineers experience and knowledge for better web applications, higher reliability, testability and performance.
No comment yet.
Scoop.it!

How to Speed Up Lo-Dash ×100? Introducing Lazy Evaluation.

How to Speed Up Lo-Dash ×100? Introducing Lazy Evaluation. | JavaScript for Line of Business Applications | Scoop.it

I always thought libraries like Lo-Dash can’t really get any faster than they already are. Lo‑Dash almost perfectly mixes various techniques to squeeze out the most from JavaScript. It uses JavaScript fastest statements, adaptive algorithms, it even measures performance to avoid accidental regressions in subsequent releases.

No comment yet.
Scoop.it!

Node.js Best Practices

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

Contents:

  1. Always Use Asynchronous Methods
  2. Never require Modules Inside of Functions
  3. Save a reference to this Because it Changes Based on Context
  4. Always “use strict”
  5. Validate that Callbacks are Callable
  6. Callbacks Always Pass Error Parameter First
  7. Always Check for “error” in Callbacks
  8. Use Exception Handling When Errors Can Be Thorwn
  9. Use module.exports not just exports
  10. Use JSDoc
  11. Use a Process Manager like upstart or forever
  12. Follow CommonJS Standard
No comment yet.
Scoop.it!

Software Development AntiPatterns

Software Development AntiPatterns | JavaScript for Line of Business Applications | Scoop.it
Good software structure is essential for system extension and maintenance. Software development is a chaotic activity, therefore the implemented structure of systems tends to stray from the planned structure as determined by architecture, analysis, and design. Software refactoring is an effective approach for improving software structure. The resulting structure does not have to resemble the original planned structure.
No comment yet.
Scoop.it!

AngularJS Style Guide by John Papa

AngularJS Style Guide by John Papa | JavaScript for Line of Business Applications | Scoop.it
angularjs-styleguide - AngularJS Style Guide: A starting point for AngularJS development teams to provide consistency through good practices.
No comment yet.
Scoop.it!

JavaScript: using closure space to create real private members

For a recent project, I was discussing with @johnshew about the way JavaScript developers can embed private members into an object. My technique for this specific case is to use what I call “closure space”.

As you can see, closure space properties can be a great way to create really private data. You may have to deal with a small increase in memory consumption but from my point of view this is fairly reasonable (And at that price you can have a great performance improvement over using the regular way).

Jan Hesse's insight:

http://angularclouddataconnector.codeplex.com/

No comment yet.
Scoop.it!

What the Flux? (On Flux, DDD, and CQRS)

What the Flux? (On Flux, DDD, and CQRS) | JavaScript for Line of Business Applications | Scoop.it

While the Flux pattern may have found a new home in JavaScript applications, they have been explored before in Domain-Driven Design (DDD) and Command-Query Responsibility Segregation(CQRS). I think it is useful to learn from these older concepts, and see what they may tell us about the present.

In this post I will:
  1. Give an overview of the Flux architecture.
  2. Present the CQRS pattern.
  3. Look at how Flux applies the concepts from CQRS.
  4. Discuss when Flux is useful for a JavaScript application.
No comment yet.
Scoop.it!

TypeScript Design Patterns

TypeScript Design Patterns | JavaScript for Line of Business Applications | Scoop.it

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.

The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. This small web application explains these patterns and gives examples on how you can use these patterns in TypeScript.

Arik Grinstein's curator insight, July 23, 2015 10:07 AM

Interesting Read.

Scoop.it!

Immutable data structures which are backwards-compatible with normal JS Arrays and Objects.

Immutable data structures which are backwards-compatible with normal JS Arrays and Objects. | JavaScript for Line of Business Applications | Scoop.it

Immutable JS data structures which are backwards-compatible with normal Arrays and Objects.

Use them in for loops, pass them to functions expecting vanilla JavaScript data structures, etc.

No comment yet.
Scoop.it!

Immutability in React

Immutability in React | JavaScript for Line of Business Applications | Scoop.it

In this article Christian Johansen gives you an example of how immutability can be used with React, the well-known library developed by Facebook.

In my previous article I mentioned that tracking changes can be drastically improved because we can short-circuit the expensive diffing algorithm in libraries like React. When you give React some new data, it calls theshouldComponentUpdate() function on all the components. If this function returns false, React won’t diff this component with the existing version, so the library won’t re-render the elements that make the component. This potentially saves a lot of work, and can lead to a massive improvement in performance.

Let’s consider our game. When you reveal a tile, the whole game is rendered over again. However, thanks to our immutable data model, all the tiles that didn’t change will still be the same exact references. These don’t need to be re-rendered, because with immutable data, same reference means no change. To let React know about this detail, we can improve our component wrapper as follows:

No comment yet.
Scoop.it!

Eliminate JavaScript Code Smells

Eliminate JavaScript Code Smells | JavaScript for Line of Business Applications | Scoop.it
AGENDA
  • Easy to lint, Common rules
  • Easy to lint, Fresh rules
  • Easy to lint, No rules
  • Hard to lint, Subjective rules
No comment yet.
Scoop.it!

I wrote a JavaScript study guide

I wrote a JavaScript study guide | JavaScript for Line of Business Applications | Scoop.it

JavaScript is a disgusting language. But I love it!

It’s riddled with awful parts, was put together in 10 days, and now we have to suffer for the next 20 years (it turns 20 in a few months).  However, it’s also the duct tape of the internet, and it works just about anywhere that there is a browser. It’s also perhaps the most misunderstood language.

At hackathons, I see tons of students trying to get started with JavaScript, as they are trying to write web apps or cross platform mobile ones, and they often get caught on simple things. For that reason, I’ve put together a JavaScript study guide.

Steven Hill's curator insight, March 10, 2015 11:12 AM

This is something I would like to explore.

Scoop.it!

JavaScript classes with ECMAScript 6

JavaScript classes with ECMAScript 6 | JavaScript for Line of Business Applications | Scoop.it
JavaScript has been officially initiated as an object-oriented language with the introduction of classes in ECMAScript 6.
No comment yet.
Scoop.it!

Using the Strategy Pattern to Reduce Complexity in Your JavaScript

Using the Strategy Pattern to Reduce Complexity in Your JavaScript | JavaScript for Line of Business Applications | Scoop.it

The Strategy Pattern will be our weapon of choice for tackling the problem above. So what is the Strategy Pattern, you may ask? Essentially it is a way to evaluate an input at runtime and execute predefined code based off of that input. This is JavaScript, a dynamic language so we won't have to go the full polymorphic, implenting interfaces like in C# to use this pattern. As an aside, you could actually do it that way in JavaScript if you'd like.

No comment yet.
Scoop.it!

JavaScript Architecture for the 23rd Century

JavaScript Architecture for the 23rd Century | JavaScript for Line of Business Applications | Scoop.it

For a long time it seemed like it was ok to just use a single file full of jQuery selectors and event handlers. This is just not a sustainable pattern. The Modern Web that we are entering here in the 23rd century demands a more thought out, and architected approach.

An architectural pattern is not something that you sit down and write. No one sits at their desk and thinks about how to write a new shiny pattern. A pattern is something that comes about as a discovery. Some problem is solved potentially multiple times and a pattern is extracted from the solution(s).


* Constructor
* IIFEs to prevent global leaks
* IIFE for the Revealing Module Pattern
* Organizing Files
* AMD
* Browserify
* ES6
* Traceur

No comment yet.
Scoop.it!

Tips for writing third-party JavaScript

Tips for writing third-party JavaScript | JavaScript for Line of Business Applications | Scoop.it

The unique challenges faced in writing third-party JavaScript revolve around the same-origin policy. Because the JavaScript file is based on a different domain to its host, inbuilt browser security places restrictions on cookie use and client-side/server communication. 

By using jQuery for prototyping, you will be deferring full browser support issues until a little later in the project timeline, but by then you should have gained a better understanding of the unique problems inherent when writing third-party JavaScript.

No comment yet.
Scoop.it!

The Case for Object-Oriented JavaScript

The Case for Object-Oriented JavaScript | JavaScript for Line of Business Applications | Scoop.it

JavaScript is a flexible and powerful programming language that drives most modern-day web sites and applications. The jQuery library, in particular, has a simple API for traversing and manipulating the DOM. Just choose a your selector, add an event handler, and voilà! Instant UI magic. The ease of jQuery, though, comes with a price. Without much thought in organizing your code, it’s easy to end up with a hot mess of jQuery selector soup -- and that’s the last thing we want in a complex application like ours.

In this blog post, I will show you the case for object-oriented design in a functional language like JavaScript, using examples from Wealthfront's codebase.

No comment yet.
Scoop.it!

The State Of JavaScript - A Shift From Imperative To Declarative

The State Of JavaScript - A Shift From Imperative To Declarative | JavaScript for Line of Business Applications | Scoop.it

JavaScript has seen a ton of development even in the past 5 years. The changes haven't been so much in the language itself, but in how the language is being used. This has been a product of the host of libraries and frameworks that have been created that allow developers to consume them and do just about anything. Need a library to build robots to assist you in your evil plot to take over the world? It probably already exists.

If I had to pinpoint the biggest shift in the JavaScript world in the past few years, it would be the transition from imperative to declarative.

No comment yet.