Backbone.js is a popular JavaScript framework with over 1400 lines of code. It is made up of several key components including Models, Collections, Views and a Router. The framework relies heavily on Underscore.js for functions like each and extend. It allows developers to easily build single page applications by providing structure for common tasks like syncing models with the server and handling browser history.
After a short introduction to object orientation, this lecture gives an overview of the Smalltalk programming language.
This lecture was given on November 10, 2008, during the summer school on programming languages (http://pleiad.dcc.uchile.cl/pl2008/)
All 'classic' 23 GOF Design Patterns, illustrated by Nelleke Verhoeff (Red Cheeks Factory). Trying to show the essence of each Design Pattern, with some examples from PHP.
Second version of my Design Patterns presentation. This presentation was held February 13, 2014 at the 010PHP meeting in Rotterdam. Presentation was in Dutch.
Java 9 introduces modules to the Java programming language and its runtime. Despite this feature being optional, due to the modularization of the standard library existing applications might behave differently when running on a version 9 JVM. Furthermore, because of changes in the runtime, existing libraries and frameworks might not yet correctly process your modularized code. As a result, updating to a Java 9 VM and taking Java 9 into brings its challanges.
This talk discusses the practical implications of module boundaries and analyzes new limitations Java 9 imposes on the reflection API. This talk explains how reflection is used in popular frameworks like Spring and Hibernate and explains why existing applications might break or change their behavior when facing modularized code. Finally, this talk showcases alternatives to now failing Java programming patterns and weights their robustness with regard to the Java releases 10 and upward.
The presenter is an active contributor to open source and helped to migrate many popular Java libraries to supporting Java 9. As a consequence, he as been working with Java 9 for almost two years.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
After a short introduction to object orientation, this lecture gives an overview of the Smalltalk programming language.
This lecture was given on November 10, 2008, during the summer school on programming languages (http://pleiad.dcc.uchile.cl/pl2008/)
All 'classic' 23 GOF Design Patterns, illustrated by Nelleke Verhoeff (Red Cheeks Factory). Trying to show the essence of each Design Pattern, with some examples from PHP.
Second version of my Design Patterns presentation. This presentation was held February 13, 2014 at the 010PHP meeting in Rotterdam. Presentation was in Dutch.
Java 9 introduces modules to the Java programming language and its runtime. Despite this feature being optional, due to the modularization of the standard library existing applications might behave differently when running on a version 9 JVM. Furthermore, because of changes in the runtime, existing libraries and frameworks might not yet correctly process your modularized code. As a result, updating to a Java 9 VM and taking Java 9 into brings its challanges.
This talk discusses the practical implications of module boundaries and analyzes new limitations Java 9 imposes on the reflection API. This talk explains how reflection is used in popular frameworks like Spring and Hibernate and explains why existing applications might break or change their behavior when facing modularized code. Finally, this talk showcases alternatives to now failing Java programming patterns and weights their robustness with regard to the Java releases 10 and upward.
The presenter is an active contributor to open source and helped to migrate many popular Java libraries to supporting Java 9. As a consequence, he as been working with Java 9 for almost two years.
With its ninth version, the Java platform has shifted gear and introduced biyearly releases. This was followed by a license change where Oracle, the steward of Java, now publishes a commercial and a non-commercial release of the Java virtual machine while other vendors took more space to promote their alternative builds of the OpenJDK. And in another flood of news, the Java EE specification was terminated and resolved into the Jakarta EE namespace.
A lot has been happening in the traditionally conservative Java ecosystem, to say the least, and many users are wondering if they still can rely on the platform. This talk gives an overview of the Java ecosystem, summarizes the changes that have been, that to expect and why the evolution of the platform is good news to the community.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
A presentation I gave on September 26 at the Melbourne Symfony developers group on using Environment Variables (envvars) in Symfony and managing secrets in your PHP applications.
For more information on these subjects, check out the supporting piece I wrote: https://samjarrett.com.au/swipe-right
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
Kotlin is new JVM language still cooking in Jetbrains kitchen. It looks awesome compared to Java 7, but now, with Java 8 in the field, the question arises: “Does Kotlin still have enough advantages over Java to attract Java developers?” Similar questions could be asked for other JVM languages like Scala, Ceylon, Clojure. We tried to compare new features of Java 8 with corresponding features of Kotlin and see what Kotlin offers beyond features existing in latest Java release.
With Java 9 modules coming to us soon, you want your existing code to be fully ready for the module system. Making code modular can be a daunting task, but Java 9 comes with a number features to ease migration. This includes automatic modules, the unnamed module and a number of command line arguments.
In this talk we will look at examples of migrating real code. It discusses common problems youll run into during migration, leading to practical tips and the ability to set realistic goals. Its also a good way to understand the module system itself and the various migration paths it supports. This talk is an excellent preparation to start migrating your own code.
* Understanding modules and the module path
* Automatic modules
* Mixing classpath and modulepath
* Dealing with reflection
* Escape switches
* Jdeps
All topics will be based on examples of often used libraries and frameworks.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
A presentation I gave on September 26 at the Melbourne Symfony developers group on using Environment Variables (envvars) in Symfony and managing secrets in your PHP applications.
For more information on these subjects, check out the supporting piece I wrote: https://samjarrett.com.au/swipe-right
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
The Bundle system is one of the greatest and most powerful features of Symfony2. Bundles contain all the files related to a single feature of your application: controllers, entities, event listeners, form types, Twig templates, etc. But how much of that actually needs to be inside a bundle?
In this talk we’ll take a bundle, containing all those different types of classes, configuration files and templates, and strip it down to the bare necessities. And I promise that after moving many files out of the bundle, everything still works.
While looking for ways to move things out of the bundle, I will discuss some of the more advanced features of bundle design, like prepending configuration, compiler passes and Doctrine mapping drivers. We will end with a very lean bundle, surrounded by a few highly reusable, maximally decoupled libraries.
Kotlin is new JVM language still cooking in Jetbrains kitchen. It looks awesome compared to Java 7, but now, with Java 8 in the field, the question arises: “Does Kotlin still have enough advantages over Java to attract Java developers?” Similar questions could be asked for other JVM languages like Scala, Ceylon, Clojure. We tried to compare new features of Java 8 with corresponding features of Kotlin and see what Kotlin offers beyond features existing in latest Java release.
With Java 9 modules coming to us soon, you want your existing code to be fully ready for the module system. Making code modular can be a daunting task, but Java 9 comes with a number features to ease migration. This includes automatic modules, the unnamed module and a number of command line arguments.
In this talk we will look at examples of migrating real code. It discusses common problems youll run into during migration, leading to practical tips and the ability to set realistic goals. Its also a good way to understand the module system itself and the various migration paths it supports. This talk is an excellent preparation to start migrating your own code.
* Understanding modules and the module path
* Automatic modules
* Mixing classpath and modulepath
* Dealing with reflection
* Escape switches
* Jdeps
All topics will be based on examples of often used libraries and frameworks.
Improperly architected applications may work, may perform well, and may meet the acceptance criteria, but the ability to maintain them degrades over time. This presentation will show some of the common mistakes made when building large web applications, how to be aware of them, correct them, and hopefully prevent them.
Presentation derived from the "What's new in Python 2.6" document on http://www.python.org/ including much reformatting for presenting and presenter notes.
Please download the Keynote original - that way the presentation notes aren't burned into the slides.
Miller Columns (used in iPhone and Mac Finder) are an elegant way of displaying and navigating a tree. This talk describes a JavaScript implementation of Miller Columns, and why JavaScript needs modules and a standard library.
Deep Dive into Backbone.js Internals + Underscore.js
1. Deep Dive Into Backbone.js Internals +
Underscore.js.
Mauvis Ledford
CTO, Pathbrite
2. Backbone.js: Quick Facts
• 0.1.0 released Oct 13, 2010, latest stable 0.9.2 – 7 months ago
• Used in dozens of popular web and mobile web sites out there:
• Soundcloud, Stripe, Grooveshark, Do, BitTorrent, Nike+, …
2
3. Backbone.js: Source Code Analysis
Lines of code
• 1432 lines w/ comments.
• 856 lines without.
Size
• 52kb raw w/ comments
• 30k without
• 5.6kb packed and gzipped
Underscore
• 4kb packed and gzipped
3
8. Diving into the code: top down
Environment setup.
Anonymous function
to encapsulate
framework setup.
Calling anonymous
function in the context of
global object.
Node:
global
DOM:
window
8
9. Diving into the code: top down
Two checks: “exports” and “require”.
Preparing for jQuery-
…
like “noConflict”
Checks for existence of
global “exports” variable. If
exists, assume we are
serverside.
…
Similarily, if underscore isn’t loaded and global
“require” exists include underscore lib.
9 Let your knowledge shine
10. Diving into the code: top down Supports jQuery,
NoConflict and optional DOM library. Zepto, or Ender
…
Allows you to
restore Backbone
namespace to
previous Backbone.
…
Used with Backbone.sync method.
10
11. Diving into the code: top down
Event class, so important!
…
All of Backbone’s
classes inherit this
class and now
have these
methods.
…
Backwards compatibility
11
12. Diving into the code: top down
Mixing Event class in to custom class.
…
…
12
13. Diving into the code: top down
Model class
…
Every new model gets a unique id.
Attributes are set silently on
model creation.
Last step, call the models init.
…
13
14. Diving into the code: top down
Model class
…
Notice that `Events` class
extends `Model.prototype` which
is then extended by an
anonymous object.
…
14
15. Diving into the code: top down
Collection class
If `comparator` function is passed
new models are sorted in order.
…
…
15
16. Diving into the code: top down
Collection class
…
Notice that `Events` class is
mixed in again.
Additional underscore
methods are added
directly to
`Collection.prototype`.
…
16
17. Diving into the code: top down
Demonstrating models and collections on https://pathbrite.com/portfolios
.
// Count portfolios
rrripple.data.portfolios.length;
// Get collection JSON list.
rrripple.data.portfolios.toJSON();
// Get model JSON list.
rrripple.data.portfolios.first().toJSON();
// Add new portfolio item.
rrripple.data.portfolios.add({
title : 'Watermelon'
});
17
18. Diving into the code: top down
Router class.
…
…
Show
sample
routes.
18
19. Diving into the code: top down
History class
…
…
Backbone.history.navigate('/portfolios', {
trigger: true
});
19
20. Diving into the code: top down
View class
…
`ensureElement` sets
`this.el` to a detached div if
no el or tagName specified.
Arguments passed with these
keys are applied directly to the
instantiated view during
`this._configure`, the rest can
be found in `view.options`.
…
Show:
rp.classes.views.popup
in
editor.
var
view
=
new
rrripple.classes.views.par>als.Se?ngsPopup();
20
21. Diving into the code: top down
Inherits functionality
…
User.prototype.save = function(attrs) {
// modify attrs code
User.__super__.save.apply(this, arguments);
};
Shh! Saved referenced to parents
prototype. Let’s you access
parents method you could have
overwritten on the child.
…
21
22. Diving into the code: top down
Giving all classes extend ability
…
…
Notice `_.extend` != `Collection.extend`!!!
22
23. Live Demos
Frontend and backend Backbone examples
Pathbrite:
Backbone
as
a
frontend
plaGorm.
pathbrite.com
Kbot:
Turntable
robot
built
on
Node
and
Backbone.
github.com/krunkosaurus/kbot
23