Вы находитесь на странице: 1из 6

#122 Get More Refcardz! Visit refcardz.

com

Functional Programming with Clojure


CONTENTS INCLUDE:
n
Motivations
n
Language Foundations
REPLs
Simple Concurrency on the JVM
n

n
Function Catalog
n
Interoperability
n
The Clojure Ecosystem and more... By Tim Berglund and Matthew McCullough

MOTIVATIONS LANGUAGE FOUNDATIONS

It all started with John McCarthy, the year 1958, and a Code Is Data
small language named Lisp. Why are we, five decades later, The fact that Clojure’s unconventional syntax asks you to type
discussing a sudden springing-to-life of incarnations of this in the AST directly has a surprising implication: namely, that
programming language predated only by Fortran? It turns all Clojure code is data. In fact, there is no formal distinction
out that Lisp never really died. It was merely in hibernation all between code and data in Clojure. When code is represented
those years, “pining for the fjords” of the Java Virtual Machine, in text files, it exists as a set of nested forms (or S-expressions).
powerful CPUs, and abundant RAM. That When these forms are parsed by the
day has arrived. In fact, the multi-core reader (which is like a part of the
architecture and ever-harder concurrency compiler), they become Clojure data
problems computer science is currently structures, no different in kind than the
aiming to solve are a perfect fit for a Lisp data structures you create yourself in
dialect. Rich Hickey realized this and Clojure code.
www.dzone.com

began work on a language we now know


We call this property homoiconicity. In
as Clojure (pronounced: \klö-zhər\).
a homoiconic language, code and data
In just a few short years, the Java Virtual are the same kind of thing. This is very
Machine (JVM) has gone from a platform different from a language like Java,
solely running the Java language, to in which variables and the code that
becoming the preferred platform for the manipulates them live in two separate
execution of hundreds of cutting edge conceptual spaces.
programming languages. Some of these
languages, such as Groovy, Scala and As a result of Clojure’s homoiconicity,
Clojure are vying for the community’s every Clojure program is a data structure,
respect as the most innovative language   and every Clojure data structure can
Figure 1: Parsing of a Clojure syntax tree potentially be interpreted as a program.
on the Java Virtual Machine. Let’s
explore why Clojure is one of those frontrunners and why it The data structure that is the program is available for the
deserves a place in the tool belt of any leading edge JVM program to modify at run time. This arguably allows for the
Getting Started with Clojure

developer. most powerful metaprogramming possible in any language.

Don’t let yourself think Clojure is only for the elite, or for Data Types…?
solving a narrow class of programming problems. It is a Since all Clojure code is a Clojure data structure, we don’t
general-purpose dynamic language of the JVM, appropriate
for a broad variety of tasks by any developer willing to learn a
few potentially unfamiliar—but accessible—concepts.

Why the strange syntax? Get over 90 DZone Refcardz


Lisps are often ridiculed as having a plethora of parenthesis,
but they serve a very useful purpose. They reduce all ambiguity
FREE from Refcardz.com!
and require no lengthy set of evaluation precedence rules;
deepest parens execute first. For the benefit of the developer,
the frequency of parentheses in Clojure were engineered down
to the barest minimum Lisp has ever seen.

Clojure’s simple syntax rules are a direct benefit of the code


being a direct version of the abstract syntax tree (AST).
Following the execution of the code becomes a matter of
traversing that tree, which is often a simple recursion to the
deepest pair of parentheses, then proceeds outward. For
example, Figure 1 shows a basic math problem’s Clojure syntax
and evaluation.

DZone, Inc. | www.dzone.com


2 Getting Started with Clojure

speak of data types and data structures the way we do in a from the imperative languages you are used to. Conceptually,
conventional language. Instead, we speak of forms. Forms are Clojure separates identity from value. An identity is a logical
text strings processed by the Clojure Reader. entity that has a stable definition over time, and can be
represented by one of the reference types (ref, agent, and
Form Name Description Examples atom). An identity “points to” a value, which by contrast
String A string of characters, “angry monkey”, is always immutable. We could bind a name to a value as
implemented by “Mutable state follows—this is analogous to assignment in Java—but there is
java.lang.String. considered harmful” no idiomatic way to change the value had by that name:
Number A numeric literal that 6.023E23, 42
=> (def universal-answer 42)
evaluates to itself. #’user/universal-answer
=> universal-answer
Ratio A rational number. 22/7, 1/3, 24/601 42
=> ; Doing it wrong
=> (def universal-answer 43)
Boolean A boolean literal form. False true, false #’user/universal-answer
and nil evaluate to false; true
and everything else evaluate
to true. In the example above, 42 is the value bound to the name
universal-answer. If we wanted the universal answer to be able
Also returned by predicate
to change, we might use an atom:
functions.

Character A single character literal, \z, \3, \space, \tab, \ => (def universal-answer (atom “what do you get when you multiply six
implemented by newline, \return by nine”))
#’user/universal-answer
java.lang.Character. => (deref universal-answer)
“what do you get when you multiply six by nine”
Nil The null value in Clojure. nil
Note that we access the value of an atom using the deref
Keyword A form beginning with a colon :deposed, :royalty
that evaluates to itself. Also a function. To change the value pointed to by an atom, we must
function that looks itself up in be explicit. For example, to change the universal answer to
a map. be a function instead of a number or a string, we use the
reset! function:
Symbol A name that refers to str-join, java.lang.
something. Symbols may be Thread, clojure.core, +,
function names, data, Java *source-path* => (reset! universal-answer (fn [] (* 6 9)))
#<user$eval11$fn__12 user$eval11$fn__12@d5e92d7>
class names, and namespaces. => ((deref universal-answer))
54

Set A collection of unique #{:bright :copper The double parentheses around the deref call are necessary
elements. Also a function that :kettles},
looks up its own elements. #{1 3 5 7 13} because the value of universal-answer is a function. Wrapping
that function in parentheses causes Clojure to evaluate it,
Map A collection of key/value {:species “monkey” returning the value 54.
pairs. Note that commas are :emotion “angry”},
optional. Also a function that {“A” 23, “B” 83} Note that the number, the string, and the function above are
looks up its own keys. values, and do not change. The symbol universal-answer is an
identity, and changes its value over time.
Vector An ordered collection with [1 1 2 3 5 8]
high-performance indexing In traditional concurrent programming, synchronizing access
semantics. Also a function
to shared variables is the limiting factor in creating correct
that looks up an element by
its position. programs, and is an intellectually daunting task besides.
Clojure provides an elegant solution in its reference types. In
List An ordered collection, also ‘(13 17 19 23), addition to refs, we have atoms and agents for concurrently
known as an S-expression, or (map str [13 17 19 23])
managing mutable state. Together these three types
sexp. The fundamental data
structure of Clojure. When form a significantly improved abstraction over traditional
the list is not quoted, the first threading and synchronization. You can read more about
element is interpreted as a them here: http://clojure.org/refs, http://clojure.org/atoms,
function name, and is invoked.
http://clojure.org/agents.

Note that all Clojure data structures are immutable, even things Sequences
like maps and lists that we normally think of as mutable. Any Clojure’s Aggregate forms (i.e., String, Map, Vector, List, and
time you perform an operation on a data structure to change Set) can all be interpreted as sequences, or simply “seqs”
it, you are actually creating a whole new structure in memory (pronounced seeks). A seq is an immutable collection on which
that has the modification. If this seems horribly inefficient, don’t we can perform three basic operations:
worry; Clojure represents data structures internally such that
• first: returns the first item in the sequence
it can create modified views of immutable data structures in a
=> (first [2 7 1 8 2 8 1 8 2 8 4 5 9 0])
performant way. 2

Mutability in Clojure • r est: returns a new sequence containing all elements


Clojure invites you to take a slightly different view of variables except the first

DZone, Inc. | www.dzone.com


3 Getting Started with Clojure

=> (rest [2 7 1 8 2 8 1 8 2 8 4 5 9 0]) After obtaining the prerequisites:


(7 1 8 2 8 1 8 2 8 4 5 9 0) • Unzip the clojure.zip archive.
• c ons: returns a new sequence containing a new element • Run java -cp clojure.jar clojure.main
added to the beginning A Web REPL
=> (cons 2 [7 1 8 2 8 1 8 2 8 4 5 9 0]) If getting a REPL up and running seems like too much effort
(2 7 1 8 2 8 1 8 2 8 4 5 9 0)
for a first encounter with Clojure, try “Lord of the REPLs”, a
These three functions form the backbone of seq Google App Engine Web application that immediately lets you
functionality, but there is a rich library of additional seq try out snippets of syntax. (http://lotrepls.appspot.com/)
functions in clojure.core.

See here for more details: http://clojure.org/sequences and


http://clojuredocs.org/quickref/Clojure%20Core#Collections+-
+SequencesSequences.

Clojure sequences can be infinite, like the set of all


positive integers:
=> (def positive-integers (iterate inc 1))

Since this sequence would take infinite memory to


realize, Clojure provides the concept of a lazy sequence.
Lazy sequences are only evaluated when they are needed at
run time. If we tried to print the sequence of all primes, we Figure 3: Web Based REPL
 
would need infinite memory and time:

=> (use ‘[clojure.contrib.lazy-seqs :only (primes)]) Simply hit CTRL + Space and choose Clojure from the
=> primes
=> ; requires extreme patience language drop-down.

However, we can efficiently reach into that lazy sequence A similar Clojure-only Web REPL can be found at
and grab the members we need without constructing the http://tryclj.licenser.net/
whole thing:
Documentation
=> (use ‘[clojure.contrib.lazy-seqs :only (primes)]) Docstrings
=> (take 10 (drop 10000 primes))
=> (104743 104759 104761 104773 104779 104789 104801 104803 104827 Clojure encourages every function to have a docstring. This
104831) is similar to JavaDoc comments in Java. A docstring for a
function is enclosed by double quotes and precedes the name
Of course, lazy sequences are not magical. They will
of the function.
require enough memory and computation to generate the
values we request, but they defer that computation until (defn sayhello
“Introduce a friend by name.”
needed, and usually don’t attempt eager computation of the [friendsname]
entire sequence. (str “Let me introduce you to my friend “ friendsname))

REPLs The docstring can be viewed with the doc function:


(doc sayhello)
Running a REPL
A standard tool for experimenting with Clojure is a Read Eval Which outputs:
Print Loop, or REPL. It is an interactive prompt that remembers user/sayhello
the results of previous operations and allows you to use those ([friendsname])
Say hello to a friend by name.
results in future statements. nil

The simple prerequisites are:


If you can’t recall what a function’s name is, but you can
• Java 1.5 or greater JDK
remember some keywords from the docstring, you can search
•A download of the clojure.zip language archive from
for those words in all functions with the find-doc function:
http://clojure.org/downloads
(find-doc “friend by name”)

Which outputs:
user/sayhello
([friendsname])
Say hello to a friend by name.
nil

Source code
If the source for a function is available, it can be shown with a
Figure 2: Clojure’s basic REPL
  straightforward call to source like so:

DZone, Inc. | www.dzone.com


4 Getting Started with Clojure

(source sayhello) Testing (Predicates)


Function Description
which outputs:
nil? True if the parameter is nil.
(defn sayhello
“Introduce a friend by name.”
[friendsname] identical? True if the parameters are the same object.
(str “Let me introduce you to my friend “ friendsname))
nil zero? True if zero, false otherwise.

Note that in some execution environments, it is necessary pos? True if positive, false otherwise.
to first import the repl-utils functions before calling source.
Leiningen and the standard Clojure 1.2 repl have the source neg? True if negative, false otherwise.
function available automatically.
even? True if even, false otherwise.
(use ‘clojure.contrib.repl-utils)
odd? True if odd, false otherwise.
Tooling
min Smallest of the provided numbers.
All the major development tools have Clojure plug-ins bringing
both syntax highlighting and a REPL to the table. max Greatest of the provided numbers.
Emacs
Superior Lisp Interaction Mode for Emacs
http://github.com/nablaone/slime An easily-navigable set of core function
Hot documentation can be found at:
Highlighting and Indentation Tip
http://github.com/technomancy/clojure-mode http://clojuredocs.org/quickref/Clojure%20Core
TextMate
Clojure-TMBundle INTEROPERABILITY
http://github.com/stephenroller/clojure-tmbundle

Eclipse Many new languages are being developed and hosted on the
Counterclockwise JVM for its robust deployment model, excellent performance
http://code.google.com/p/counterclockwise/ characteristics, and rich ecosystem. These languages take
IntelliJ different approaches to interoperating with and embracing
La-Clojure the Java tradition they inherit. For its otherwise alien syntax,
http://plugins.intellij.net/plugin/?id=4050 Clojure has surprisingly clean Java interop, and this is no
accident. The decision to host Clojure on the JVM was not
NetBeans
merely an implementation detail; rather, the JVM is a first-
Enclojure
class part of Clojure’s world. Significant language features
http://www.enclojure.org/
were added to cooperate cleanly with the JVM. Clojure’s Java
interop is implemented without intrusive and abstraction-
FUNCTION CATALOG
leaking wrappers, but instead by direct programming of Java
objects in Clojure code.
The sheer volume of functions available in Clojure can be
overwhelming. However, a combination of ClojureDocs.org and Calling a static method on a class is easy:
docstring referencing can aid in finding one that fits a specific
=> (System/nanoTime)
need. Here are a few excerpts of frequently used functions: 1286079871663966000
=> (Math/E)
Arithmetic 2.718281828459045

Function Return Value


Calling an instance method on a Java object has a special
+ Sum of numbers.
syntax (note that the Clojure String is also a Java object):
- Subtraction of numbers.
=> (.toUpperCase “angry monkey”)
“ANGRY MONKEY”
* Multiplication of numbers. => (.getClass :monkey)
clojure.lang.Keyword
/ Division of numbers.
Creating an OBJECT can be done with the familiar new
mod Modulus of numbers.
function, or with the special dot syntax:
inc Input number incremented by one.
=> (new String “monkey”)
“monkey”
dec Input number decremented by one. => (String. “monkey”)
“monkey”
min Smallest of the provided numbers.
Here is some code illustrating how to import classes and
max Greatest of the provided numbers.
interact with the Swing API:

DZone, Inc. | www.dzone.com


5 Getting Started with Clojure

(ns swing-example power of Lisp and a corresponding DSL to flex their muscles to
(:use [clojure.contrib.swing-utils] produce HTML content with minimal effort.
[clojure.contrib.lazy-seqs :only (fibs)])
(:import [javax.swing JFrame JLabel JButton JTextField http://github.com/weavejester/compojure
SwingConstants]
[java.awt GridLayout]))
Cascalog
; Define a function that builds a JFrame that runs the supplied The Hadoop MapReduce framework has garnered enough
function
; on a button click, then displays the result in the frame attention for Internet-scale data processing to warrant a tool
(defn function-frame [window-title button-text func]
(let [text-field (JTextField.) called Cascalog. It provides a Clojure language interface to
result-label (JLabel. “—” SwingConstants/CENTER) query Hadoop NoSQL datastores.
button (doto (JButton. button-text)
(add-action-listener http://github.com/nathanmarz/cascalog
(fn [_]
(.setText result-label
(str (func (Integer. (.getText text-
field))))))))] THE CLOJURE ECOSYSTEM
(doto (JFrame. window-title)
(.setLayout (GridLayout. 3 1))
(doto (.getContentPane)
(.add button) Clojure is more than just an experiment to bring Lisp to the
(.add text-field)
(.add result-label) JVM. It is a growing component of production applications,
) often focusing on exciting new frontiers of parallel, graph
(.pack))))
navigation, and scalable computing.
; Customize function-frame to calculate Fibonacci numbers
(def fib-frame (function-frame “Fibonacci” Stories abound of Clojure in use at telecommunications firms,
“Fib”
#(nth (fibs) %))) analytics agencies, and social media companies. The following
; Display the JFrame short list can be of use in convincing colleagues that the
(.setVisible fib-frame true) language is worth investigating for applicability to challenging
Important Java Interop Functions and Macros problem domains.

Name Description Example Revelytix: Semantic Emergent Analytics(TM) with semantic


doto Allows many Java =>(def user (doto (User.) technologies and query federation capabilities.
method calls in (.setFirstName “Tim”) http://www.revelytix.com/
(.setLastname “Berglund”)))
succession on a
single object. Akamai: Live Transcoding of Mobile Content
bean Creates an immutable =>(bean user) http://www.mail-archive.com/clojure@googlegroups.com/
map out of the {:firstName “Tim”, :lastName msg29948.html
“Berglund”}
properties of a JavaBean.
FlightCaster: Commercial Plane Delay Predictions
class Returns the Java class of =>(class (Date.))
http://www.infoq.com/articles/flightcaster-clojure-rails
a Clojure expression. java.util.Date

SoniAn: Cloud Powered Email Archiving http://sonian.com


supers Returns a List of the => (supers (class
superclasses and (Calendar/getInstance)))
#{java.lang.Cloneable java.
implemented interfaces
util.Calendar java.lang. GOING FURTHER
of a Clojure expression. Comparable java.lang.Object
java.io.Serializable}

Community
Open Source Tools & Frameworks Clojure has a vibrant community that happily fields questions
Leiningen and offers up a plethora of code examples.
The JVM has many build tools such as Maven, Gradle and Ant
that are compatible with Clojure. However, Clojure has its own Official Sites
build tool that is “designed to not set your hair on fire.” Setting Homepage
it up proves that this goal has been achieved. http://clojure.org/
Source Code
On a *nix platform:
http://github.com/clojure/clojure/
wget ‘http://github.com/technomancy/leiningen/raw/stable/bin/lein’
Blog
On Windows, download the binary distribution: http://clojure.blogspot.com/
http://github.com/technomancy/leiningen
Support, Development, Mentoring
Then get help: http://clojure.com/
lein Documentation, Tutorials
Or create a new Clojure project: Community-authored code examples
http://clojuredocs.org
lein new myfirstproj
http://www.gettingclojure.com/cookbook:clojure-cookbook
Or run a REPL: Community-authored book
lein repl http://en.wikibooks.org/wiki/Clojure_Programming

Compojure Relevance Clojure Studio Training Materials


Clojure has a lightweight Web framework that allows for the http://github.com/relevance/labrepl

DZone, Inc. | www.dzone.com


6 Getting Started with Clojure

Videos Joy of Clojure by Michael Fogus and Chris Houser


Rich Hickey on Clojure Concepts http://joyofclojure.com/
http://www.infoq.com/presentations/Are-We-There-Yet-Rich- Lisp in small pieces by Christian Queinnec
Hickey http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/
Stu Halloway on Clojure Protocols LiSP.html
http://vimeo.com/11236603 SICP In Clojure
Rich Hickey on Clojure at W. Mass Developers’ Group http://sicpinclojure.com/
http://blip.tv/file/812787 Practical Clojure
http://apress.com/book/view/1430272317
Libraries
Build Tool Clojure in Action
http://github.com/technomancy/leiningen http://www.manning.com/rathore/
Statistical Computing Bookmarks
http://incanter.org/ Clojure is still in its formative stages and new resources are
Supplementary Libs popping up all the time. One of the best ways to keep up with
http://github.com/clojure/clojure-contrib/ the additions to its ecosystem is through a hand-crafted list of
bookmarks about this new JVM language.
Web Framework
http://github.com/weavejester/compojure/wiki http://delicious.com/matthew.mccullough/clojure
http://delicious.com/tlberglund/clojure
Books http://delicious.com/tag/clojure
Programming Clojure by Stu Halloway
http://pragprog.com/titles/shcloj/programming-clojure

ABOUT THE AUTHOR RECOMMENDED BOOK


Tim Berglund combines a broad perspective on software architecture and If you’re a Java programmer, if you care about concurrency, or
team dynamics with a passion for hands-on development. He specializes in web if you enjoy working in low-ceremony language such as Ruby or
development using the Grails framework, bringing expertise in the browser, database Python, Programming Clojure is for you. Clojure is a general-
design, and enterprise integration to bear on browser-based solutions. His skill as purpose language with direct support for Java, a modern Lisp
a teacher and his integrative approach to technology, team, and organizational dialect, and support in both the language and data structures for
problem-solving makes him an ideal partner during periods of disruptive technology functional programming. Programming Clojure shows you how to
change in your organization. write applications that have the beauty and elegance of a good
scripting language, the power and reach of the JVM, and a modern,
Tim embraces the Java platform, including both the Java language and its high-
concurrency-safe functional style. Now you can write beautiful code
productivity cousin, Groovy. He also helps clients bring agility to their database development using
that runs fast and scales well.
the Liquibase database refactoring tool, having applied, coached, and lectured on it extensively. He is
committed to applying and helping teams excel with agile methods in all of his engagements.
Through his partnership with ThirstyHead.com, Tim offers public and private classroom training in BUY NOW
Groovy, Grails, and Liquibase, and is available to develop custom courseware by private engagement. books.dzone.com/books/programming-clojure
Tim is a frequent speaker at domestic and international conferences, including the Scandinavian
Developer Conference, JavaZone, Strange Loop, and the No Fluff Just Stuff tour.

Matthew McCullough is an energetic 15 year veteran of enterprise software


development, open source education, and co-founder of Ambient Ideas, LLC, a
Denver, Colorado, USA consultancy. Matthew is a published author, open source
creator, speaker at over 100 conferences, and author of three of the top 10 Refcardz
of all time. He writes frequently on software and presenting at his blog:
http://ambientideas.com/blog.

#82

Browse our collection of over 100 Free Cheat Sheets


Get More Refcardz! Visit refcardz.com

CONTENTS INCLUDE:


About Cloud Computing
Usage Scenarios Getting Started with

Aldon Cloud#64Computing

Underlying Concepts
Cost
by...

Upcoming Refcardz
youTechnologies ®

Data
t toTier
brough Comply.
borate.
Platform Management and more...

Chan
ge. Colla By Daniel Rubio

on:
dz. com

grati s
also minimizes the need to make design changes to support
CON
ABOUT CLOUD COMPUTING one time events. TEN TS
INC

s Inte -Patternvall

HTML LUD E:
Basics
Automated growthHTM
ref car

Web applications have always been deployed on servers & scalable


L vs XHT technologies

nuou d AntiBy Paul M. Du



Valid
ation one time events, cloud ML
connected to what is now deemed the ‘cloud’. Having the capability to support

OSMF
Usef

ContiPatterns an

computing platforms alsoulfacilitate


Open the gradual growth curves
Page ■
Source
Vis it

However, the demands and technology used on such servers faced by web applications.Structure Tools

Core
Key ■

Structur Elem
E: has changed substantially in recent years, especially with al Elem ents
INC LUD gration the entrance of service providers like Amazon, Google and Large scale growth scenarios involvingents
specialized
NTS and mor equipment
rdz !

ous Inte Change

HTML
CO NTE Microsoft. es e... away by
(e.g. load balancers and clusters) are all but abstracted
Continu at Every e chang
About ns to isolat
relying on a cloud computing platform’s technology.
Software i-patter
space

Clojure

n
Re fca

e Work
Build
riptio
and Ant These companies Desc have a Privat
are in long deployed trol repos
itory
webmana applications
ge HTM
L BAS

Patterns Control lop softw n-con to



that adapt and scale
Deve
les toto large user
a versio ing and making them
bases, In addition, several cloud computing ICSplatforms support data
ment ize merg
rn
Version e... Patte it all fi minim le HTM
Manage s and mor e Work knowledgeable in amany ine to
mainl aspects related tos multip
cloud computing. tier technologies that Lexceed the precedent set by Relational
space Comm and XHT

Build
re

Privat lop on that utilize HTML MLReduce,


ref c

Practice Database Systems (RDBMS): is usedMap are web service APIs,



Deve code lines a system
Build as thescalethe By An
sitory of work prog foundati
Ge t Mo

Repo
This Refcard active
will introduce are within
to you to cloud riente computing, with an
ION d units etc. Some platforms ram support large grapRDBMS deployments.

The src
dy Ha
softw
EGRAT e ine loping task-o it and Java s written in hical on of
all attribute
softwar emphasis onDeve es by
Mainl
INT these ines providers, so youComm can better understand
also rece JavaScri user interfac web develop and the rris
Vis it

OUS

HTML 5
codel chang desc
ding e code Task Level as the
www.dzone.com

NTINU s of buil control what it is a cloudnize


line Policy sourc es as aplatform
computing can offer your ut web output ive data pt. Server-s e in clien ment. the ima alt attribute ribes whe
T CO ces ion Code Orga it chang e witho likew mec ide lang t-side ge is describe re the ima
hanism. fromAND
name
the pro ject’s vers CLOUD COMPUTING PLATFORMS
subm e sourc
applications. ise
ABOU (CI) is
it and with uniqu are from
was onc use HTML
web
The eme pages and uages like Nested
unavaila s alte ge file
rd z!

a pro evel Comm the build softw um ble. rnate can be


gration ed to Task-L Label ies to
build minim UNDERLYING CONCEPTS
e and XHT rging use HTM PHP tags text that
Inte mitt a pro blem ate all activition to the
bare
standard a very loos ML as Ajax Tags
can is disp
found,
ous com to USAGE SCENARIOS Autom configurat
cies t
ization, ely-defi thei tech L
Continu ry change cannot be (and freq
nden ymen layed
tion ned lang r visual eng nologies
Re fca

Build al depe need


a solu ineffective
deplo t
Label manu d tool the same for stan but as if
(i.e., ) nmen overlap
eve , Build stalle
t, use target enviro Amazon EC2: Industry standard it has
software and uagvirtualization ine. HTM uen
with terns ns (i.e.
blem ated ce pre-in whether dards e with b></ , so <a>< tly are) nest
lar pro that become
Autom Redu ymen a> is
ory. via pat d deploEAR) in each has L

Test Driven Development


reposit -patter particu s cies Pay only what you consume
tagge or Amazon’s cloud
the curr you cho platform
computing becisome
heavily based moron very little fine. b></ ed insid
lained ) and anti x” the are solution duce
nden For each (e.g. WAR es t
ent stan ose to writ more e imp a></ e
not lega each othe
b> is
be exp text to “fi
al Depeapplication deployment
Web ge until
nden a few years
t librari agonmen
t enviro was similar that will software
industry standard and virtualization apparen ortant, the
e HTM technology.
tterns to pro Minim packa
dard
Mo re

CI can ticular con used can rity all depe that all
targe
simp s will L t. HTM l, but r. Tags
es i-pa tend but to most phone services:
y Integ alize plans with late alloted resources,
file
ts with an and XHT lify all help or XHTML, Reg ardless L VS XH <a><
in a par hes som
etim s. Ant , they ctices,
Binar Centr temp your you prov TML b></
proces in the end bad pra enting
nt nmen
incurred cost
geme whether e a single based on
Creatsuchareresources were consumed
t enviro orthenot. Virtualization
muchallows MLaare physical othe
piece ofr hardware to be understand of HTML
approac ed with the cial, but, rily implem nden
cy Mana rties nt targe es to of the actually web cod ide a solid ing has
essa d to Depe prope into differe chang
utilized by multiple operating
function systems.simplerThis allows ing.resourcesfoundati job adm been arou
efi nec itting
associat to be ben
er
pare
Ge t

te builds commo
are not Fortuna
late Verifi e comm than on
ality be allocated nd for
n com Cloud computing asRun it’sremo
known etoday has changed this. expecte irably, that
befor
They they
etc.
(e.g. bandwidth, elem CPU) tohas
nmemory, exclusively totely
Temp
job has some time
Build
lts whe
ually,
appear effects. rm a
Privat y, contin nt team Every mov
entsinstances. ed to CSS
used
to be, HTML d. Earl
ed resu gration
The various resourcesPerfo consumed by webperio applications
dicall (e.g.
opme page system
individual operating bec Brow y exp . Whi
adverse unintend d Builds sitory Build r to devel common (HTM . ause ser HTM anded le it
ous Inte web dev manufacture L had very far mor has done
Stage Repo
e bandwidth, memory, CPU) areIntegtallied
ration on a per-unit CI serve basis L or XHT
produc Continu Refcard
e Build rm an ack from extensio .) All are
e.com

ML shar limit e than its


pat tern. term this
Privat
(starting from zero) by Perfo all majorated cloud
feedb computing platforms.
occur on As a user of Amazon’s
n. HTM EC2 essecloud
ntiallycomputing platform, you are
es cert result elopers
came
rs add
ed man ed layout anybody
the tion the e, as autom they based proc is
gra such wayain The late a lack of stan up with clev y competi
supp
of as
” cycl Build Send builds
assigned esso
an operating L system
files shou in theplai
same as onelemallents
hosting
ous Inte tional use and test concepts
soon n text ort.
ration ors as ion with r
Integ entat
ld not in st web dar er wor ng stan
Continu conven “build include oper
docum
be cr standar kar dar

DZone, Inc.
the to the to rate devel
While s efer of CI
ion
Gene
Cloud Computing

the not
s on
expand

ISBN-13: 978-1-936502-02-8
140 Preston Executive Dr. ISBN-10: 1-936502-02-X
Suite 100
50795
Cary, NC 27513

DZone communities deliver over 6 million pages each month to 888.678.0399


919.678.0300
more than 3.3 million software developers, architects and decision
Refcardz Feedback Welcome
$7.95

makers. DZone offers something for everyone, including news,


refcardz@dzone.com
tutorials, cheat sheets, blogs, feature articles, source code and more. 9 781936 502028
Sponsorship Opportunities
“DZone is a developer’s dream,” says PC Magazine.
sales@dzone.com
Copyright © 2010 DZone, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, Version 1.0
photocopying, or otherwise, without prior written permission of the publisher.

Вам также может понравиться