SlideShare a Scribd company logo
1 of 91
Download to read offline
Mallorca, 24 September 2010
Presentation @ HackFwd Build 03, Release 0.1
TheDeadline GmbH & Co. KG
Using Clojure, NoSQL Databases and
Functional-Style JavaScript to Write Next-
Generation HTML5 Apps
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
2
Since 1999 I have been running a successful software
development company. In 2009 we started building
TheDeadline with Clojure. We are a HackBox!
And I am a Board Member of HackFwd: Eat your own dogfood!
> whoami
Stefan Richter
Apple II
Pascal,
C64,
6502
VAX,
Unix, C,
4GLs,
Smalltalk
Lisp,
Scheme
Unix, C/C++,
4 GLs,
Windows NT,
VB (!)
University studies and
work as a programmer in
research institutes
Working as a
professional programmer
Running my own company
20102005199819951990198719831966
Linux, Java,
Python, Ruby
Objective-C, C/C++
Common Lisp, Clojure,
JavaScript
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Please pardon the colors.
3
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
The
Web is
dead.
4
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Okay. We all know that more
and more people are
accessing the internet via
mobile devices
(smartphones).
5
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
By accident, Apple
”invented“ the app economy.
6
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
People are buying
specialized apps which are
bound to a specific platform
(iPhone/iPad, Android, etc.).
7
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
The Wired magazine calls
these platforms ”walled
gardens.“
8
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Because:
These apps use the internet
for data transmission and
networking, but they are
not on the web.
9
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
It seems like people are
building more and more
stuff for ”walled gardens“!?
10
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Do we really have to build
for ”walled gardens“?
11
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
No. Because it is a waste of
time to build apps that run
on just one platform.
12
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And it is a waste of time to
implement the same app for
different platforms.
13
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We (TheDeadline-Team) had
the same problem:
We needed mobile clients
for iPhone/iPad and
Android.
14
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
But then we would have to
maintain at least three
different platforms: Web,
iPhone, Android.
15
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So, every feature would
require three times the
effort.
16
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Or:
Our team would become
three times slower.
17
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Our solution:
Build an unified HTML5
client that runs in all
modern web browsers as
well as on both iPhone and
on Android.
18
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
As you all know, HTML5 is
basically a set of browser
APIs and HTML extensions.
Some of them can be used to
build a web client that feels
like a native client.
19
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
20
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
HTML5 can do much more
(video, 2D canvas, etc.), but
we don’t need it for our
core app.
21
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
What an ”HTML5 client“ is
depends on the type of app
you are building.
22
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
My definition of an HTML5 client:
- App runs mostly inside the
browser (JavaScript)
- App can be used offline
- Syncs data automatically with server
- Feels more like a
native app, but no WIMP
interface (use CSS3)
- Supports only modern browsers,
no IE6/IEx fallbacks ;)
23
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So, what parts of the HTML5
standard do we need to
implement this?
We need:
- Client-side storing of data
- Client-side caching of UI
- Optional:
- New stylable HTML5 elements
- CSS3 media queries
24
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We are using the Local
Storage API to store all user
data locally on the client
side.
25
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We are using the Caching
API to cache the static UI
parts on the browser-side.
26
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
27
Google App Engine
Clojure
AppEngine SDK for Java
Datastore TaskQueues
Compojure
Browser
JavaScript
JQuery (mostly)
Before: a request/response
style web-application.
HTTP/SSL HTML/CSS/JS
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Almost everything was
rendered on the server.
(Okay, we had some AJAX,
too. But not much.)
28
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
For the server-side
rendering, we are using
Compojure and Hiccup.
29
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
On the next slide, you can
see how nice it is to have
your application code, HTML
and CSS in one place.
It is also a good example of
how to use multimethods for
UI rendering. (You don‘t
need a web-framework when
you are using Lisp).
30
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
31
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
You see, we are not only
strong supporters of the
NoSQL movement, we want to
suggest a new movement:
The No Templates movement.
;)
32
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Too bad that we can’t use
this on the client side.
So, how can we render the
UI on the client side?
33
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Most people would shout:
JQuery!
34
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
The idea behind JQuery is
to execute (chained)
function calls on a set of
DOM elements. This is why
JQuery is so easy to learn
and to use. You don’t even
have to know how to
program JavaScript!
35
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
But can you build a large
HTML5 client that consists
solely of JQuery plugins
which just operate on the
DOM-tree?
36
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
You will end up with lots of
code blocks that all iterate
over the same DOM tree.
For a large client, we think
you need to bring more
structure to your code.
37
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So we tried Google Closure
Library. Google Closure
Libary is to JavaScript what
the JDK is to Java:
a mature standard library.
38
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And it helps you to
structure your code by
providing a namespace
system.
39
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
BTW, you can’t compare
JQuery and Google Closure
using simple examples. It
isn’t a question of writing
five lines of elegant code.
The question is wether you
can write thousands of lines
of complex code ...
40
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
I have to admit: 10 years
ago I hated JavaScript.
The code we received from
web agencies was such a
mess. It was slow. The
JavaScript interpreters
inside the browser were
broken. It was impossible to
see the beauty behind the
beast ...
41
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Today most people are
trying to structure
JavaScript code like Java
code.
42
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
I think this is wrong:
JavaScript may look better
now, but it is bloated in the
same way that Java is ...
43
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Let’s stop the bloat:
We are already using a
functional programming
language on the server side
(Clojure).
Of course, we want to
program in the same style
on the client side!
44
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
What do I mean by
”functional programming“*?
- First class functions
- Just returning values
- Causing no side effects
- Functions as parameters
- Function combination
*(Yes, this definition is too simple)
45
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
JavaScript makes it all
possible.
46
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And: Google Closure comes
with a library of functions
that enables you to work
with collections of data in a
functional programming
style.
47
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Check goog.functions:
48
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
49
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Check goog.array:
map, reduce, every, filter,
flatten, some, repeat, etc.
These functions don’t alter
their input.
50
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Implementation started ...
51
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
First we implemented a key/
value store API on top of
the HTML5 Local Storage API.
It behaves very much like
the Google App Engine
Datastore. We can store
arbitrary maps identified
by a :key and a :kind.
52
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
This key/value store on the
client side (we call it event-
db) automatically syncs with
the Google datastore on the
server.
Like this:
53
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
54
Google App Engine
Browser
Auto-Sync
event-db API
XHR/JSON Notification
Datastore
Local Storage API
TheDeadline HTML5 UI (rendering)
Notification
Data-
Access
(Maps/JS-
Objects)
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
A small step for mankind,
but a huge step for
TheDeadline:
Now we just use the event-
db API to access the user
data. We don’t need to
worry about XHR anymore ...
55
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Cool thing:
Throughout the whole
TheDeadline-system we just
pass around a very simple
datastructure: maps of key/
value pairs. No complex DB-
mappings needed. NoSQL.
Just filter, map, reduce.
Easy transformations.
56
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
The Google Datastore is a
distributed key/value store.
Clojure works with key/
value structures.
JSON is build on key/value
structures.
57
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
From this perspective is
functional programming the
opposite of object-oriented
programming:
- Simple data structures
- Powerful functional
operations on these data
structures
- No state (well, almost)
58
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We try to write as much
functional code as possible.
But the UI must maintain
some state.
59
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So sometimes object-
orientation can be useful:
A Widget Library is a good
example. Google Closure
comes with such a library,
which you can extend by
building your own UI
components.
60
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
When you have to
encapsulate state, you can
write a component.
For rendering the client-
side UI we are using Google
Closure Templates.
Like this:
61
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
62
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Google Closure Templates
are used like function calls:
You pass the data to be
rendered as parameter.
Like this:
63
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
64
The application of the Soy
template:
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Just a reminder:
This code runs on all
platforms. Computers and
smartphones.
65
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Compare this with the work
you have to do when writing
proprietary clients for each
platform. And I can tell you:
This is much more fun!
66
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Now we have a nice HTML5
client. You can use it on
several devices at the same
time. You can use it offline
and sync later.
Uhh. But what happens when
you have concurrent
modifications?!
67
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
You need a data model that
is able to store versions of
your user data!
68
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Relational databases are not
well suited for data
versioning. Try to version a
large graph of entities
distributed over several
tables. Good luck!
69
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Good to have a schema-free,
NoSQL, key/value store!
(No matter what Michael Stonebraker says.)
70
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Our solution is almost a
functional data structure:
We store every change as an
operation on an entity. We
can replay all operations.
We could easily provide
undo-operations. We can
restore every state change.
You can see it in our todo
history:
71
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
72
The history shows all
operations that were
applied to a todo entity.
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
A schema-free database like
Google’s datastore helps a
lot to implement such a
model.
73
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And to make and keep the
code really elegant, a
dynamic, functional
programming language like
Clojure helps, too!
74
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
What else are we doing on
the server side with
Clojure?
75
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We are trying to make
modern applications more
intelligent.
76
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
TheDeadline contains a
rule-based expert system.
77
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
We are using the expert
system for decision support:
We want to provide the
right information to the
right person at the right
time in real-time in a
project management
situation.
78
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
When you have lots of rules,
you don’t want to make
decisions in cascading if-
then-else clauses.
79
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
The expert system is a
Clojure-based
implementation of a
classical production system
like OPS5 or CLIPS.
80
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
81
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So, on the server side we
are processing large
datasets: We generate facts
from the user data and run
them through our expert-
system, which then
generates actions for the
users based on our rule-set.
82
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And again: Clojure really
helps us to implement stuff
like this.
83
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Conclusion
84
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
So when you want to start a
company, it is very likely,
that you have to build for
mobile platforms from the
beginning. Like Eric Schmidt
said: Mobile first.
85
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Instead of building several
apps for proprietary
platforms use HTML5 as an
open standard. (This saves
time and money, too).
86
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
If you want to be successful,
stay away from relational
databases. Use schema-free
databases to build
versioning data structures.
You will need them to
resolve concurrent
modifications of user data.
87
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Become a JavaScript master.
Use a mature library. Your
HTML5 client will become
big and complex.
88
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
Start thinking in a
functional way. Not
everything is an object...
89
TheDeadline GmbH & Co. KG
Presentation @ HackFwd Build 03
Release 0.1
And: Have fun!
Starting a company can be
so much fun. And maybe you
sign-up for HackFwd?!
I‘d love to see more Clojure
Hackers building their
dreams!
90
Thank you.
TheDeadline:
http://www.the-deadline.com
Corporate Blog:
http://www.hackers-with-attitude.com
Corporate WebSite:
http://www.freiheit.com
Self:
http://www.smartrevolution.de
http://www.twitter.com/smartrevolution

More Related Content

What's hot

01 introduction to entity framework
01   introduction to entity framework01   introduction to entity framework
01 introduction to entity frameworkMaxim Shaptala
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Chris Richardson
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated Mark O'Brien
 
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...VibrantGroup
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Automated Testing for CA Plex and 2E
Automated Testing for CA Plex and 2EAutomated Testing for CA Plex and 2E
Automated Testing for CA Plex and 2ECM First Group
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaSalesforce Developers
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Konstantin Gredeskoul
 
Why your APIs should fly first class
Why your APIs should fly first classWhy your APIs should fly first class
Why your APIs should fly first classLibbySchulze
 
angular js and node js training in hyderabad
angular js and node js training in hyderabadangular js and node js training in hyderabad
angular js and node js training in hyderabadphp2ranjan
 
Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs VMware Tanzu
 
Selenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiSelenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiUnmesh Baile
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for MicroservicesVMware Tanzu
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013Danijel Malik
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version ControlNowell Strite
 

What's hot (20)

01 introduction to entity framework
01   introduction to entity framework01   introduction to entity framework
01 introduction to entity framework
 
Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)Microservices pattern language (microxchg microxchg2016)
Microservices pattern language (microxchg microxchg2016)
 
Ashish Baraiya
Ashish BaraiyaAshish Baraiya
Ashish Baraiya
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated
New CA 2E 8.7 (Synon) and CA 7.1 , Invigorated
 
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...
Jboss Application Server training-course-navi-mumbai-jboss-course-provider-na...
 
Leveling Up Deployment Infrastructure
Leveling Up Deployment InfrastructureLeveling Up Deployment Infrastructure
Leveling Up Deployment Infrastructure
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Automated Testing for CA Plex and 2E
Automated Testing for CA Plex and 2EAutomated Testing for CA Plex and 2E
Automated Testing for CA Plex and 2E
 
Test Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and MochaTest Automation With Cucumber JVM, Selenium, and Mocha
Test Automation With Cucumber JVM, Selenium, and Mocha
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
 
Why your APIs should fly first class
Why your APIs should fly first classWhy your APIs should fly first class
Why your APIs should fly first class
 
angular js and node js training in hyderabad
angular js and node js training in hyderabadangular js and node js training in hyderabad
angular js and node js training in hyderabad
 
Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs Documenting RESTful APIs with Spring REST Docs
Documenting RESTful APIs with Spring REST Docs
 
Selenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiSelenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbai
 
TDD for Microservices
TDD for MicroservicesTDD for Microservices
TDD for Microservices
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013
 
Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
Salesforce CLI
Salesforce CLISalesforce CLI
Salesforce CLI
 

Similar to Mallorca Presentation Using Clojure and HTML5 for Next-Gen Apps

High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development WorkflowVũ Nguyễn
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014Oliver N
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1benDesigning
 
33 Software Development Tools that Drive Dialexa’s Success
33 Software Development Tools that Drive Dialexa’s Success33 Software Development Tools that Drive Dialexa’s Success
33 Software Development Tools that Drive Dialexa’s SuccessDialexa
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTManuel Carrasco Moñino
 
Microsoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesMicrosoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesNicklas Andersson
 
Ibm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsIbm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsMark Roden
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateAdam John
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teamsJamie Thomas
 
How to develop a Flutter app.pdf
How to develop a Flutter app.pdfHow to develop a Flutter app.pdf
How to develop a Flutter app.pdfSmith Daniel
 
Automating Screenshot Testing Component Library
Automating Screenshot Testing Component LibraryAutomating Screenshot Testing Component Library
Automating Screenshot Testing Component LibraryApplitools
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-eehomeworkping3
 
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"..."Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...Edge AI and Vision Alliance
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitcbenDesigning
 
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013asheshbadani
 
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)Sejong Park
 
Ten Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevTen Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevNiklas Heidloff
 
What is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfWhat is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfShaiAlmog1
 

Similar to Mallorca Presentation Using Clojure and HTML5 for Next-Gen Apps (20)

High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014
 
Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1Hacking the Kinect with GAFFTA Day 1
Hacking the Kinect with GAFFTA Day 1
 
33 Software Development Tools that Drive Dialexa’s Success
33 Software Development Tools that Drive Dialexa’s Success33 Software Development Tools that Drive Dialexa’s Success
33 Software Development Tools that Drive Dialexa’s Success
 
Rapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWTRapid and Reliable Developing with HTML5 & GWT
Rapid and Reliable Developing with HTML5 & GWT
 
Microsoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight ExperiencesMicrosoft Webday 2008 - Silverlight Experiences
Microsoft Webday 2008 - Silverlight Experiences
 
Ibm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applicationsIbm worklight - going from xpages mobile to native mobile applications
Ibm worklight - going from xpages mobile to native mobile applications
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New Update
 
Going open source with small teams
Going open source with small teamsGoing open source with small teams
Going open source with small teams
 
How to develop a Flutter app.pdf
How to develop a Flutter app.pdfHow to develop a Flutter app.pdf
How to develop a Flutter app.pdf
 
Automating Screenshot Testing Component Library
Automating Screenshot Testing Component LibraryAutomating Screenshot Testing Component Library
Automating Screenshot Testing Component Library
 
MVP with GWT and GWTP
MVP with GWT and GWTPMVP with GWT and GWTP
MVP with GWT and GWTP
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-ee
 
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"..."Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...
"Using TensorFlow Lite to Deploy Deep Learning on Cortex-M Microcontrollers,"...
 
Open frameworks 101_fitc
Open frameworks 101_fitcOpen frameworks 101_fitc
Open frameworks 101_fitc
 
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013
Red Hat OpenShift Enterprise 2 Launch Webcast Slides Dec 3, 2013
 
Gradle(the innovation continues)
Gradle(the innovation continues)Gradle(the innovation continues)
Gradle(the innovation continues)
 
Ten Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to DevTen Minutes Bluemix Pitch from Dev to Dev
Ten Minutes Bluemix Pitch from Dev to Dev
 
What is Codename One - Transcript.pdf
What is Codename One - Transcript.pdfWhat is Codename One - Transcript.pdf
What is Codename One - Transcript.pdf
 

Recently uploaded

Karim apartment ideas 02 ppppppppppppppp
Karim apartment ideas 02 pppppppppppppppKarim apartment ideas 02 ppppppppppppppp
Karim apartment ideas 02 pppppppppppppppNadaMohammed714321
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
Karim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppKarim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppNadaMohammed714321
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptJIT KUMAR GUPTA
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioRMG Project Studio
 
CAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfCAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfAlasAlthaher
 
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - MorgenboosterAI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster1508 A/S
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Associazione Digital Days
 
The spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyThe spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyChristopher Totten
 
guest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssguest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssNadaMohammed714321
 
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDin
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDinGeneral Simple Guide About AI in Design By: A.L. Samar Hossam ElDin
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDinSamar Hossam ElDin Ahmed
 
guest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssguest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssNadaMohammed714321
 
Niintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxNiintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxKevinYaelJimnezSanti
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine CharlottePulte
 
Sharif's 9-BOX Monitoring Model for Adaptive Programme Management
Sharif's 9-BOX Monitoring Model for Adaptive Programme ManagementSharif's 9-BOX Monitoring Model for Adaptive Programme Management
Sharif's 9-BOX Monitoring Model for Adaptive Programme ManagementMd. Shariful Hoque
 
NBA power point presentation final copy y
NBA power point presentation final copy yNBA power point presentation final copy y
NBA power point presentation final copy ysrajece
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024digital learning point
 
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道yrolcks
 
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfsimpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfLucyBonelli
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designersPixeldarts
 

Recently uploaded (20)

Karim apartment ideas 02 ppppppppppppppp
Karim apartment ideas 02 pppppppppppppppKarim apartment ideas 02 ppppppppppppppp
Karim apartment ideas 02 ppppppppppppppp
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
Karim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 pppppppppppppppKarim apartment ideas 01 ppppppppppppppp
Karim apartment ideas 01 ppppppppppppppp
 
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.pptMaking and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
Making and Unmaking of Chandigarh - A City of Two Plans2-4-24.ppt
 
Interior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project StudioInterior Design for Office a cura di RMG Project Studio
Interior Design for Office a cura di RMG Project Studio
 
CAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdfCAPITAL GATE CASE STUDY -regional case study.pdf
CAPITAL GATE CASE STUDY -regional case study.pdf
 
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - MorgenboosterAI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
AI and Design Vol. 2: Navigating the New Frontier - Morgenbooster
 
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
Giulio Michelon, Founder di @Belka – “Oltre le Stime: Sviluppare una Mentalit...
 
The spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenologyThe spirit of digital place - game worlds and architectural phenomenology
The spirit of digital place - game worlds and architectural phenomenology
 
guest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssssguest bathroom white and bluesssssssssss
guest bathroom white and bluesssssssssss
 
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDin
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDinGeneral Simple Guide About AI in Design By: A.L. Samar Hossam ElDin
General Simple Guide About AI in Design By: A.L. Samar Hossam ElDin
 
guest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssssguest bathroom white and blue ssssssssss
guest bathroom white and blue ssssssssss
 
Niintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptxNiintendo Wii Presentation Template.pptx
Niintendo Wii Presentation Template.pptx
 
Piece by Piece Magazine
Piece by Piece Magazine                      Piece by Piece Magazine
Piece by Piece Magazine
 
Sharif's 9-BOX Monitoring Model for Adaptive Programme Management
Sharif's 9-BOX Monitoring Model for Adaptive Programme ManagementSharif's 9-BOX Monitoring Model for Adaptive Programme Management
Sharif's 9-BOX Monitoring Model for Adaptive Programme Management
 
NBA power point presentation final copy y
NBA power point presentation final copy yNBA power point presentation final copy y
NBA power point presentation final copy y
 
10 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 202410 Best WordPress Plugins to make the website effective in 2024
10 Best WordPress Plugins to make the website effective in 2024
 
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
怎么办理英国Newcastle毕业证纽卡斯尔大学学位证书一手渠道
 
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdfsimpson-lee_house_dt20ajshsjsjsjsjj15.pdf
simpson-lee_house_dt20ajshsjsjsjsjj15.pdf
 
10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers10 must-have Chrome extensions for designers
10 must-have Chrome extensions for designers
 

Mallorca Presentation Using Clojure and HTML5 for Next-Gen Apps

  • 1. Mallorca, 24 September 2010 Presentation @ HackFwd Build 03, Release 0.1 TheDeadline GmbH & Co. KG Using Clojure, NoSQL Databases and Functional-Style JavaScript to Write Next- Generation HTML5 Apps
  • 2. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 2 Since 1999 I have been running a successful software development company. In 2009 we started building TheDeadline with Clojure. We are a HackBox! And I am a Board Member of HackFwd: Eat your own dogfood! > whoami Stefan Richter Apple II Pascal, C64, 6502 VAX, Unix, C, 4GLs, Smalltalk Lisp, Scheme Unix, C/C++, 4 GLs, Windows NT, VB (!) University studies and work as a programmer in research institutes Working as a professional programmer Running my own company 20102005199819951990198719831966 Linux, Java, Python, Ruby Objective-C, C/C++ Common Lisp, Clojure, JavaScript
  • 3. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Please pardon the colors. 3
  • 4. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 The Web is dead. 4
  • 5. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Okay. We all know that more and more people are accessing the internet via mobile devices (smartphones). 5
  • 6. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 By accident, Apple ”invented“ the app economy. 6
  • 7. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 People are buying specialized apps which are bound to a specific platform (iPhone/iPad, Android, etc.). 7
  • 8. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 The Wired magazine calls these platforms ”walled gardens.“ 8
  • 9. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Because: These apps use the internet for data transmission and networking, but they are not on the web. 9
  • 10. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 It seems like people are building more and more stuff for ”walled gardens“!? 10
  • 11. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Do we really have to build for ”walled gardens“? 11
  • 12. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 No. Because it is a waste of time to build apps that run on just one platform. 12
  • 13. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And it is a waste of time to implement the same app for different platforms. 13
  • 14. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We (TheDeadline-Team) had the same problem: We needed mobile clients for iPhone/iPad and Android. 14
  • 15. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 But then we would have to maintain at least three different platforms: Web, iPhone, Android. 15
  • 16. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So, every feature would require three times the effort. 16
  • 17. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Or: Our team would become three times slower. 17
  • 18. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Our solution: Build an unified HTML5 client that runs in all modern web browsers as well as on both iPhone and on Android. 18
  • 19. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 As you all know, HTML5 is basically a set of browser APIs and HTML extensions. Some of them can be used to build a web client that feels like a native client. 19
  • 20. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 20
  • 21. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 HTML5 can do much more (video, 2D canvas, etc.), but we don’t need it for our core app. 21
  • 22. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 What an ”HTML5 client“ is depends on the type of app you are building. 22
  • 23. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 My definition of an HTML5 client: - App runs mostly inside the browser (JavaScript) - App can be used offline - Syncs data automatically with server - Feels more like a native app, but no WIMP interface (use CSS3) - Supports only modern browsers, no IE6/IEx fallbacks ;) 23
  • 24. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So, what parts of the HTML5 standard do we need to implement this? We need: - Client-side storing of data - Client-side caching of UI - Optional: - New stylable HTML5 elements - CSS3 media queries 24
  • 25. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We are using the Local Storage API to store all user data locally on the client side. 25
  • 26. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We are using the Caching API to cache the static UI parts on the browser-side. 26
  • 27. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 27 Google App Engine Clojure AppEngine SDK for Java Datastore TaskQueues Compojure Browser JavaScript JQuery (mostly) Before: a request/response style web-application. HTTP/SSL HTML/CSS/JS
  • 28. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Almost everything was rendered on the server. (Okay, we had some AJAX, too. But not much.) 28
  • 29. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 For the server-side rendering, we are using Compojure and Hiccup. 29
  • 30. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 On the next slide, you can see how nice it is to have your application code, HTML and CSS in one place. It is also a good example of how to use multimethods for UI rendering. (You don‘t need a web-framework when you are using Lisp). 30
  • 31. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 31
  • 32. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 You see, we are not only strong supporters of the NoSQL movement, we want to suggest a new movement: The No Templates movement. ;) 32
  • 33. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Too bad that we can’t use this on the client side. So, how can we render the UI on the client side? 33
  • 34. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Most people would shout: JQuery! 34
  • 35. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 The idea behind JQuery is to execute (chained) function calls on a set of DOM elements. This is why JQuery is so easy to learn and to use. You don’t even have to know how to program JavaScript! 35
  • 36. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 But can you build a large HTML5 client that consists solely of JQuery plugins which just operate on the DOM-tree? 36
  • 37. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 You will end up with lots of code blocks that all iterate over the same DOM tree. For a large client, we think you need to bring more structure to your code. 37
  • 38. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So we tried Google Closure Library. Google Closure Libary is to JavaScript what the JDK is to Java: a mature standard library. 38
  • 39. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And it helps you to structure your code by providing a namespace system. 39
  • 40. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 BTW, you can’t compare JQuery and Google Closure using simple examples. It isn’t a question of writing five lines of elegant code. The question is wether you can write thousands of lines of complex code ... 40
  • 41. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 I have to admit: 10 years ago I hated JavaScript. The code we received from web agencies was such a mess. It was slow. The JavaScript interpreters inside the browser were broken. It was impossible to see the beauty behind the beast ... 41
  • 42. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Today most people are trying to structure JavaScript code like Java code. 42
  • 43. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 I think this is wrong: JavaScript may look better now, but it is bloated in the same way that Java is ... 43
  • 44. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Let’s stop the bloat: We are already using a functional programming language on the server side (Clojure). Of course, we want to program in the same style on the client side! 44
  • 45. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 What do I mean by ”functional programming“*? - First class functions - Just returning values - Causing no side effects - Functions as parameters - Function combination *(Yes, this definition is too simple) 45
  • 46. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 JavaScript makes it all possible. 46
  • 47. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And: Google Closure comes with a library of functions that enables you to work with collections of data in a functional programming style. 47
  • 48. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Check goog.functions: 48
  • 49. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 49
  • 50. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Check goog.array: map, reduce, every, filter, flatten, some, repeat, etc. These functions don’t alter their input. 50
  • 51. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Implementation started ... 51
  • 52. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 First we implemented a key/ value store API on top of the HTML5 Local Storage API. It behaves very much like the Google App Engine Datastore. We can store arbitrary maps identified by a :key and a :kind. 52
  • 53. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 This key/value store on the client side (we call it event- db) automatically syncs with the Google datastore on the server. Like this: 53
  • 54. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 54 Google App Engine Browser Auto-Sync event-db API XHR/JSON Notification Datastore Local Storage API TheDeadline HTML5 UI (rendering) Notification Data- Access (Maps/JS- Objects)
  • 55. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 A small step for mankind, but a huge step for TheDeadline: Now we just use the event- db API to access the user data. We don’t need to worry about XHR anymore ... 55
  • 56. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Cool thing: Throughout the whole TheDeadline-system we just pass around a very simple datastructure: maps of key/ value pairs. No complex DB- mappings needed. NoSQL. Just filter, map, reduce. Easy transformations. 56
  • 57. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 The Google Datastore is a distributed key/value store. Clojure works with key/ value structures. JSON is build on key/value structures. 57
  • 58. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 From this perspective is functional programming the opposite of object-oriented programming: - Simple data structures - Powerful functional operations on these data structures - No state (well, almost) 58
  • 59. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We try to write as much functional code as possible. But the UI must maintain some state. 59
  • 60. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So sometimes object- orientation can be useful: A Widget Library is a good example. Google Closure comes with such a library, which you can extend by building your own UI components. 60
  • 61. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 When you have to encapsulate state, you can write a component. For rendering the client- side UI we are using Google Closure Templates. Like this: 61
  • 62. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 62
  • 63. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Google Closure Templates are used like function calls: You pass the data to be rendered as parameter. Like this: 63
  • 64. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 64 The application of the Soy template:
  • 65. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Just a reminder: This code runs on all platforms. Computers and smartphones. 65
  • 66. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Compare this with the work you have to do when writing proprietary clients for each platform. And I can tell you: This is much more fun! 66
  • 67. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Now we have a nice HTML5 client. You can use it on several devices at the same time. You can use it offline and sync later. Uhh. But what happens when you have concurrent modifications?! 67
  • 68. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 You need a data model that is able to store versions of your user data! 68
  • 69. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Relational databases are not well suited for data versioning. Try to version a large graph of entities distributed over several tables. Good luck! 69
  • 70. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Good to have a schema-free, NoSQL, key/value store! (No matter what Michael Stonebraker says.) 70
  • 71. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Our solution is almost a functional data structure: We store every change as an operation on an entity. We can replay all operations. We could easily provide undo-operations. We can restore every state change. You can see it in our todo history: 71
  • 72. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 72 The history shows all operations that were applied to a todo entity.
  • 73. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 A schema-free database like Google’s datastore helps a lot to implement such a model. 73
  • 74. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And to make and keep the code really elegant, a dynamic, functional programming language like Clojure helps, too! 74
  • 75. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 What else are we doing on the server side with Clojure? 75
  • 76. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We are trying to make modern applications more intelligent. 76
  • 77. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 TheDeadline contains a rule-based expert system. 77
  • 78. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 We are using the expert system for decision support: We want to provide the right information to the right person at the right time in real-time in a project management situation. 78
  • 79. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 When you have lots of rules, you don’t want to make decisions in cascading if- then-else clauses. 79
  • 80. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 The expert system is a Clojure-based implementation of a classical production system like OPS5 or CLIPS. 80
  • 81. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 81
  • 82. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So, on the server side we are processing large datasets: We generate facts from the user data and run them through our expert- system, which then generates actions for the users based on our rule-set. 82
  • 83. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And again: Clojure really helps us to implement stuff like this. 83
  • 84. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Conclusion 84
  • 85. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 So when you want to start a company, it is very likely, that you have to build for mobile platforms from the beginning. Like Eric Schmidt said: Mobile first. 85
  • 86. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Instead of building several apps for proprietary platforms use HTML5 as an open standard. (This saves time and money, too). 86
  • 87. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 If you want to be successful, stay away from relational databases. Use schema-free databases to build versioning data structures. You will need them to resolve concurrent modifications of user data. 87
  • 88. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Become a JavaScript master. Use a mature library. Your HTML5 client will become big and complex. 88
  • 89. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 Start thinking in a functional way. Not everything is an object... 89
  • 90. TheDeadline GmbH & Co. KG Presentation @ HackFwd Build 03 Release 0.1 And: Have fun! Starting a company can be so much fun. And maybe you sign-up for HackFwd?! I‘d love to see more Clojure Hackers building their dreams! 90
  • 91. Thank you. TheDeadline: http://www.the-deadline.com Corporate Blog: http://www.hackers-with-attitude.com Corporate WebSite: http://www.freiheit.com Self: http://www.smartrevolution.de http://www.twitter.com/smartrevolution