35
The DEVELOPER No 3/2013 Pitfalls of grid computing Trond Arve Wasskog Page 14 Java 8 to the rescue!? Fredrik Vraalsen Page 4 Tim Berglund Page 18 JAVAZONE SPECIAL EDITION FOR DEVELOPERS AND LEADERS Configuring Laptops is HARD JavaZone 11-12 SEP page 8 See

Developer3 2013

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Developer3 2013

1

The DEVELOPERNo 3/2013

Pitfalls of grid computing

Trond Arve WasskogPage 14

Java 8 to the rescue!?

Fredrik VraalsenPage 4

Tim BerglundPage 18

JAVAZONE SPECIAL EDITION FOR DEVELOPERS AND LEADERS

Configuring Laptops is

HARD

JavaZone

11-12 SEPpage 8

See

Page 2: Developer3 2013

3

Then a much harder problem presents itself. Code is written to run on comput-ers, but it always has to in-teract with humans in some way. In order to create usa-ble software you have to understand the users - even when the only users are other developers (maybe just yourself).

And users are not so predictable. They don't seem to fol-low any sensible rules at all. The classic image of the prototypical developer is an in-trovert thinker who enjoys spending hour after hour alone in front of his computer. But since 1971 - when the book Psychology of Computer Programming was fi rst released (still a good read) - we have known that programming is fi rst and foremost a human activity. And if you want to do a human activity well you have to interact with other humans, you can only go so far on your own. Understanding the human mind matter as much as technology when creating great software.

Similarly you can't possibly learn the craft well without being exposed to other programmers with different ideas, different approaches, and different skillsets. You need to listen, to get inspired. And most importantly: You need to get feedback on your own understanding, your thoughts and your ideas - even though this might be terribly fright-ening and sometimes painful for your self-esteem. As a developer I value working with people. Through com-munication we learn what problems need to be solved, and together we grow ideas of how to best do that. And as a team we have the dicipline needed to do it correctly. Inspiration to grow as a developer also comes from other people - through blogs, sosial networks, colleagues, user groups, conferences etc. When I go to a developer confer-ence I get a unique opportunity to talk to a diverse set of people, which can all give me something valuable.

If you don't take advantage of this opportunity you are miss-ing out. Programming is a human activity - if most of your focus is on the machine you are probably doing it wrong!

Torbjørn MarøActing CTO of PSWinComblog.kjempekjekt.com

ARTICLES

Java 8 to the rescue!? ............................................................................................. p. 4

JavaZone 2013 ................................................................................................................... p. 8

Get connected:

An introduction to the Neo4j Graph Database .......... p. 10

Pitfalls of grid computing ........................................................................... p. 14

Confi guring Laptops is Hard .................................................................. p. 18

A Maturity Model for Continuous Delivery .................. p. 24

Android and testing ............................................................................................ p. 28

ElasticSearch:

Analytics, real-time, NoSQL, search ........................................ p. 32

NDC London ..................................................................................................................... p. 34

Programming with immutabiLity in Java .......................... p. 36

Akka - Distributed Concurrency in Java ............................. p. 44

COURSES

Course descriptions .............................................................................................. p. 49

Course overview Oslo ........................................................................................ p. 62

Course overview London .............................................................................. p. 64

As you start out to become a programmer your focus is on the technical details. On getting your programs to do what you intend. In the beginning this is challenging, but the computer follows predictable rules, and with some effort you soon get the hang of it.

A Human Activity Contents

NO

RDIC ECOLABEL

241 Printing company

672

The DEVELOPER N o 3 2013 JavaZone Edition

and meet your target group!For more information about advertisement, please contact Charlotte Lyng at +47 93 41 03 57 or [email protected]

Advertise in The Developer

1

The dEvELoPErNo 1/2013

N E W S A N D I N F O R M AT I O N F O R D E V E L O P E R S A N D L E A D E R S

TransiTioning suCCEssfuLLy

from ThE iT sidE To BusinEss

by howard podeswa page 20

CoffEEsCriPTby Jøran lillesand and eirik liedpage 4Rabekkgata 9, Moss - Norway

[email protected] l +47 69 20 69 20

SMS - simply the world’s most effective communication method

15 years’ experience

13 APIs for easy integration

SMS wholesale worldwide

Dispatch of about 700,000 SMS per day

Online monitoring of all events worldwide 24/7

Business customers in more than 100 countries

Direct third-line support to our developers

Single point of contact for worldwide SMS distribution

For more information:

www.vianett.com

We love SMS!

Donation

Love SMS

Survey

Posisjonering

Merge

SMS

Loyalty Club

Password

Positio

nin

g

Voting

Vo

ting

Mobile

marketing

Marketing

Password

Reminders

Warnings

Ordering

Confirmation

SMS

Billing

MMSHLR

Verifying

Donation

Reminders

Survey

Posisjonering

Merge

SMS

Loyalty Club

Payment

Positio

nin

g

Voting

Vo

ting

Mobile

marketing

Marketing

Password

Password

Booking

Ordering

Confirmation

SMS

Billing

MMSHLR

Verifying

sCrolling both WaysWinrt for the ios developerby iris Classonpage 8

Developer_1_2013.indd 1 11.02.13 15:53

dEvELoPErN E W S A N D I N F O R M AT I O N F O R D E V E L O P E R S A N D L E A D E R S

TransiTioning suCCEssfuLLy

from ThE iT sidE To BusinEss

by howard podeswa page 20

1

The deveLoPerNo 2/2013

Code for kidsPage8

Power rabbitbyalvaro videlaPage 10

PLaying with drones and streams

bjørn einar bjartnesPage 4

ndC sPeCiaL edition FOR DEVELOPERS AND LEADERS

NORWEGIAN DEVELOPERS CONFERENCE 2013

oslo Spektrum, osloJune12-14Pre-workshops, 10-11 June

John Zablocki

dominick baier alvaro videla Jon Skeet giovanni asproni

helge grenager Solheim

Jørgen vinne iversen

bryan hunter Stuart lodge,

mark Seemann torstein nicolaysen

vidar Kongsli

alan Smith michael heydt

russ miles Jon mccoy

contributors:

Developer_2_2013_10mai.indd 1 15.05.13 14:24

Member of Den Norske Fagpresses Forening

Publication schedule 2013: 15. November

Uncredited photos are from Shutterstock, except portraits.

Print run: 13,000 Print: Merkur Trykk AS

Editor: Kjersti Sandberg

Marketing Manager: Charlotte Lyng

Publisher: Norwegian Developers Conference ASBy Programutvikling AS and DeveloperFocus LtdOrganisation no.: 996 162 060

Address: Martin Linges vei 17-25, 1367 Snarøya, NorwayPhone: +47 67 10 65 65E-mail: [email protected]

Page 3: Developer3 2013

4

The last couple of years have seen a lot of exciting languages emerging in the Java ecosystem and vying for the JVM throne. Java the platform is arguably stronger than ever. Java the language however is starting to show it's age. The last major new language feature was generics in Java 5, almost 10 years ago.

Java 8 to the rescue!?By Fredrik Vraalsen

5

This is about to change, big time. Java 8 is poised to bring the largest language changes Java has ever seen. Will we finally be delivered to the promised land of functional programming? Can we stop worrying about learning Scala or Clojure or the other new kids on the block? Let's take a brief look at what's coming.

LAMBDAS, ANONYMOUS FUNCTIONS, SAMS, OH MY!The main new feature in Java 8 is Lambda expressions, also known as anonymous functions. Lambdas let you define stand-alone functions without having to wrap them in a class definition. An obligatory Hello World example:

Runnable helloWorld = () -> System.out.println("Hello world");

© S

hutt

erst

ock

Page 4: Developer3 2013

6 7

contain any built-in immutable collection implementations, and it's often impractical or burdensome to define immuta-ble data models. Furthermore, Scala and Clojure provide very good support for higher level concurrency mechanisms, such as actors and software transactional memory (STM).

CONCLUSIONMany of the missing pieces will no doubt be supplied as people start tailoring libraries and frameworks to Java 8, such as better immutability support and more high-level concurrency mechanisms. Java 8 will also open the world of functional programming to a host of new developers, which is a good thing.

However, Java 8 won't be released for months yet and it will likely be years before we can put it into production in enterprise systems. It seems natural to ask: Is it not time to switch to one of the other existing and proven languages on the Java platform, that already provide all these features and much more?

Fredrik is a developer and consultant, currently at Knowit but soon to be Iterate. The last couple of years he's become interested in functional programming and in particular how to apply what he learns to his daily job as a Java developer. He's held training courses in Scala and also dabbled in Clojure, and likes to speak at conferences.

Here we define an anonymous function, which consists of an (empty) parameter list, an arrow symbol, and finally the function body. We then assign the function to a variable of type Runnable.

Nowhere in our code did we define a run() method, however we can still assign and call our anonymous function as if it was a normal Runnable instance:

helloWorld.run();// Prints out "Hello world"// to the console

How is that possible?

Lambdas can be defined and used in place of functional interfaces. These are interfaces with just a single abstract method (SAM). Any lambda with the same signature (input and return types) as the SAM can "masquerade" as the implementation of that interface. In our example, the function has no input parameters and a return type of void, which is the same signature as the run() method of Runnable.

The good news is existing APIs which use single- method interfaces can utilize lambdas from day one. The impli-cations are many. Imagine replacing pretty much every anonymous inner class you have ever implemented with lambdas? This simplifies writing listeners, callbacks, filters, and much more.

As we have seen, Lambdas can be assigned to variables. They can also be passed as parameters

to other methods or functions, and functions can create and return new functions as their results. This is the definition of higher-order functional programming.

STREAMSHigher-order functions enable us to abstract away control flow. Java 8 introduces the new Stream API to take advan-tage of this. Manually writing loops to iterate through a collection will be a thing of the past!

Here's an example of filtering and transforming a list of Person-objects:

List<Person> people = ... List<String> namesOfAdults = people.stream() .filter(p -> p.getAge() >= 18) .map(p -> p.getName()) .collect(Collectors.toList());

The arguments to the filter() and map() functions are anony-mous functions which take individual Stream elements as input, in this case a Person object, and return a boolean and a String, respectively.

Using the new Stream API involves the following steps:1. Obtain a Stream from some source, such as a Collec-

tion or I/O.

2. Perform one or more intermediate operations on the elements in the stream (filter, map, etc).

3. Perform a terminal operation, such as collecting the resulting elements into a new collection or computing the sum of a set of numbers.

Since the Stream API abstracts away the actual control flow (loop implementation), we can substitute different implementations. For instance, to spread the computation across multiple threads, simply replace the call to stream() with parallelStream() like so:

List<String> namesOfAdults = people.parallelStream()...

Parallelism for "free"! Of course, there is still no such thing as a free lunch. There are overhead costs involved, so use with care.

SCRATCHING THE SURFACEWe've just barely scratched the surface of the changes in Java 8. In addition to lambdas we will get a host of other new features. Interfaces can have default methods with imple-mentations in the interface itself. This allows for extend-ing interfaces without breaking existing implementations. Method handles can be used instead of anonymous func-tions in a number of cases, making the code more concise. And of course there are many API changes that utilize the new functionality. THE COMPETITIONSo how does Java 8 fare against the competition?

Let's compare with Scala. Scala is a new-ish languages on the JVM (it's actually been around since 2004). It's a hybrid language, combining object-oriented and functional paradigms. Like Java it's also a statically typed compiled language.

Here's an implementation of the list transformation exam-ple above in Scala:

val namesOfAdults = people filter(_.age >= 18) map(_.name)

That's quite a bit more concise than the Java code, while arguably improving readability by removing unnecessary cruft. This is partly achieved through a powerful collection API, and partly because of strong type inference, which let's you avoid repeating type information everywhere (the compiler can figure it out!).

IMMUTABILITYAnother strength of Scala and other languages such as Clojure are their support for working with immutable data structures. In this day and age of multi-core and distributed systems, shared mutable state is often referred to as the root of all evil. Functional programming promises to allevi-ate a lot of the pains related to concurrency and parallelism, but you need support both for functions and immutability.Java is missing the latter to a large degree; it does not

One day workshop 10th September at IT Fornebu

GIT & GITHUB FOUNDATIONS with Tim Berglund & Matthew McCullough

www.programutvikling.no

Spring and Hibernate training with certified Spring trainer Mårten Haglind

www.programutvikling.no

DEEP C For C and C++ programmers with experiencewith Olve Maudal

www.programutvikling.no

Page 5: Developer3 2013

by Inger renate Moldskred stIe

the conference gathers speakers from all over the world to give us new perspectives and ideas to bring back

to our workplaces ans lives; and to our programming. This years conference will be a mix of parallel, enlightening sessions

and culinary food. And as you gain access to the grand music happening, The AweZone Festival at Rockefeller, the experience is complete.

Food galoreThe travelling chefs in Flying Culinary Circus, land once again in Spektrum to serve us

tasty food from all corners of the world; serving American, French, Italian and Japanese food. In addition there’ll be a salad bar, a dessert restaurant and a street food/street art-restaurant, whatever that is. Come and find out, and find your favourite. I know which ones I’ll favor.

The restaurants, sponsored by Webstep, Accenture, Kantega, Steria, Miles, Computas and Kodemaker; together with javaBin, are all placed in the center of Oslo Spektrum in the Expo area and are open during the day. The Expo will be the place to be during

session breaks; the place to get fed and entertained, basically. And maybe you’ll find interesting new connections as well.

aweZone FestIvalThursday night we’ll all gather and walk up to Rockefeller and John Dee for a grand sound experience; The AweZone Festival. Four bands and two partner bands will fire up your dancing feet with a variety of music.

Bigbang enters the Rockefeller stage with music from their latest released album The Oslo Bowl, with inspiration from Los Angeles and Norwegian folk; an album made in a tribute to Oslo and it’s ability to inspire great art about anxiety and alienation.

“To tribute a city’s problematic sides is something LA is good at, and it is time we start appreciate the deeper soulful qualities a city like Oslo has,” the rock band states.

Also playing at the main stage is Lemâitre, a young Norwegian duo consisting of Ulrik Denizou, with background in rock/indie bands and Ketil Jansen, with background in electronic music; performing entertaining, visceral and thought provoking multimedia show in light, visuals and sound.

In good tradition, we’ll be presented with music from partner bands on Oslos ultimate rock stage.

JavaZone 2013 brings you a zesty mix of music, food and enlightenment.

Feed your mind,body and soul

John dee: The quintet While You Slept play atmospheric rock from their debut album Push/Pull. PhoTo: Vilde indrehuS

John dee: djerv, with lead vocalist Agnete Kjølsrud, play a mix of aggressive rock and metal. PhoTo: Jørn Veberg

dJervwys

The Flying Culinary Circus chefs Trond Svendgård (left to right), Tor Jørgen Kamprud Arnesen, hans Kristian larsen and Mathias Spieler bugge fly in to serve us culinary foods from the corners of the world. FACSiMile: FCCirCuS.CoM

Playing at John Dee are While You Slept, a quintet from Oslo playing atmospheric rock; music ranging from wonderful harmonies to pulsating guitar riffs, balancing the beautiful and the raw. In contrast, we’ll hear Djerv with their aggressive rock, borderline metal and with black metal references.

Feed your mind and body at JavaZone, and remember to bring your friends and colleagues/partners to AweZone to soothe your souls. n

Rockefeller Main StagePartner BandsLemâitreBigbang

John Dee Live ClubWhile You SleptDjerv

bIgbang

rockeFeller: Ketil Jansen and ulrik denizou, a young norwegian duo: lemâitre. PhoTo: FredriK A. hAnSSon

PrograM:

leMaItrÉ

rockeFeller:øystein greni,

nikolai hængsle eilertsen and olaf olsen in bigbang

perform music from their new album

The Oslo Bowl, a tribute to the capital.

PhoTo: KnuT brY

Playing at John Dee are While You Slept, a quintet from Oslo playing atmospheric rock; music ranging from wonderful harmonies to pulsating guitar riffs, balancing

contrast, we’ll hear Djerv with their aggressive rock, borderline

While You Slept

Ketil Jansen and orwegian

nSSon

8 9

Page 6: Developer3 2013

10 11

Graph databases like Neo4j excel at managing billions of densely connected, variably structured entities. Using a graph database, subject matter experts, developers and data architects can model, store and query complex data close to its native form. Given that many of the most important questions we want to ask of our data require us to understand the types, number, and qualities of the many different relationships that connect entities, this is a tremendously important capability in today's data technology landscape.

Graph database applications cover a wide spectrum of business and technical use cases. Today, Neo4j is being used in business-critical applications in the domains of social networking, recommendations, datacenter man-agement, logistics, entitlements and authorization, route fi nding, telecommunications network monitoring, fraud analysis, and many others.

THE PROPERTY GRAPH DATA MODELFigure 1 shows an example of the kind of graph data that can be stored in Neo4j.

Figure 1: An example graph

The graph shown here is an example of a property graph. The property graph data model represents entities as nodes, and the connections between entities as named and directed relationships. Both nodes and relationships can have properties, consisting of name-value pairs, as-signed to them. These properties can be used to repre-sent things such as the attributes of an entity, or the strength or weight of a connection. In addition, labels can be attached to nodes in order to group them, add them to indexes, and apply schema constraints to them.

PERFORMANCE AND FLEXIBILITYNeo4j is intended to be a drop-in replacement for a rela-tional database. It has all of the transactional and high availability characteristics of its relational brethren, but with the added benefi ts of orders of magnitude improve-ments in performance for join-intensive data queries, and increased fl exibility when modeling and storing complex, variably structured data.

Join-intensive queries in a relational database are noto-riously expensive, in large part because joins must be resolved at query time by way of an indirect index lookup. As an application’s dataset size grows, join pains begin to manifest themselves, and performance deteriorates. In Neo4j, in contrast, every relationship acts as a pre-com-puted join, and every node as an index of its associated nodes. As a result, Neo4j turns complex joins into fast graph traversals, which maintain millisecond performance irrespective of the overall size of the dataset.

Neo4j's mainly schema-free data model provides tremen-dous fl exibility when it comes to modeling the variably structured entities that make up a complex domain. No two nodes (or two relationships) need have exactly the same set of properties. More importantly, relationships (the graph database equivalent of joins) are defi ned with regard to specifi c node instances, rather than classes of nodes, meaning that no two nodes need have the same number or kind of connections. In the graph in Figure 1, for example, we see that a WORKS_FOR relationship exists between the node instances representing Sam and Acme, not Person and Company. Contrast this with relational sche-mas, where joins have to be planned up front, and uniformly applied to entire classes (tables) of entities.

AN EXAMPLE: GRAPH SEARCHIn the rest of this article I'll show how you can create a simple graph search application using Neo4j.

First, download the Community Edition of Neo4j suitable for your OS. The examples are based on a milestone pre-view of Neo4j 2.0, which you can download from http://www.neo4j.org/download. (Remember to download a 2.0 version rather than 1.9: the milestone at the time of writing is 2.0.0-M03.)

Extract the distribution and in your terminal navigate to its top-level directory. From here, start the Neo4j server:

• On Linux/Mac issue bin/neo4j start from a terminal• On Windows issue bin\Neo4j.bat from the console

By Ian Robinson

Neo4j is a JVM-based, open source graph database: a fully ACID, online (“real-time”) database management system with Create, Read, Update, and Delete (CRUD) methods that expose a graph data model.

© S

hutt

erst

ock

GET CONNECTED: An Introduction to the Neo4j

Graph Database

By Ian Robinson

Page 7: Developer3 2013

12 13

This query fi nds all of the people who work for the same company as Sam (Sam's colleagues) and who have one or more skills in common with him.

This is Cypher's equivalent of a SELECT statement. Cypher works by fi nding graph patterns in your graph data. Much as a regular expression fi nds character patterns in text, Cypher fi nds node and relationship patterns in a graph. In this particular example, the pattern we're trying to fi nd looks like Figure 4.

Figure 4: A pattern for fi nding colleagues with shared skills

The MATCH clause here specifi es this pattern using Cypher's pattern matching syntax. The fi rst part of the MATCH clause, (company)<-[:WORKS_FOR]-(sam:Person)-[:HAS_SKILL]->(skill), says that we're looking for a node with a Person label, which we'll call sam, with two outgoing relationships: a WORKS_FOR relationship, which connects sam to a node we'll call company, and a HAS_SKILL relationship, which con-nects sam to a node we'll call skill.

The second part of the MATCH clause, (company)<-[:WORKS_FOR]-(colleague:Person)-[:HAS_SKILL]->(skill), says that we're looking for a second node with a Person label that is connected to the company and skill nodes identi-fi ed in the fi rst part of the clause. This second Person node we'll call colleague. Between them, these two parts of the MATCH clause specify the diamond-shaped graph pattern shown in Figure 4.

The WHERE clause anchors the sam node in our pattern to the node in our graph with the label Person and a name prop-erty whose value is ‘Sam’. The RETURN clause then creates a projection of the matched data. The results include each matched colleague's name, the number of skills they have in common with Sam, and a comma-delimited list of those skills.

Executing this query generates the results shown in Figure 5. As we can see, Lucy shares two skills with Sam—Java and Neo4j—while Bill has just one skill in common—Neo4j.

Figure 5: Query results

You can learn more about graph databases at the Neo4j website (http://www.neo4j.org), where there are a wealth of tutorials and use case examples. Or you can read my book, Graph Databases, published by O'Reilly. If you want to discuss graph databases in more detail, grab me during JavaZone—I'll have some copies of the book with me—or tweet me at @iansrobinson.

Once you've started the server, you can open the Neo4j Web UI, which is available at http://localhost:7474.

Click on the Data Browser tab, and in the text box type:

CREATE(acme:Company {name:'Acme, Inc'}),(sam:Person {name:'Sam'}),(lucy:Person {name:'Lucy'}),(bill:Person {name:'Bill'}),(java:Skill {name:'Java'}), (cSharp:Skill {name:'C#'}), (neo4j:Skill {name:'Neo4j'}), (ruby:Skill {name:'Ruby'}), (sam)-[:WORKS_FOR]->(acme),(lucy)-[:WORKS_FOR]->(acme),(bill)-[:WORKS_FOR]->(acme),(sam)-[:HAS_SKILL{level:'Expert'}]->(java),(sam)-[:HAS_SKILL{level:'Beginner'}]->(cSharp),(sam)-[:HAS_SKILL{level:'Intermediate'}]->(neo4j),(lucy)-[:HAS_SKILL{level:'Expert'}]->(java),(lucy)-[:HAS_SKILL{level:'Expert'}]->(neo4j),(bill)-[:HAS_SKILL{level:'Beginner'}]->(neo4j),(bill)-[:HAS_SKILL{level:'Intermediate'}]->(ruby)RETURN acme

This CREATE statement is written using Neo4j's Cypher query language. Let's take a moment to understand it in a bit more detail.

(acme:Company {name:'Acme, Inc'}) describes a node. The node has been given a label, Company, and a single property, name, with the value ‘Acme, Inc’. This newly created node is assigned to an identifi er, acme, so that it can be referenced elsewhere in the statement. This will prove useful when we come to creating the relationships that connect nodes.

Our CREATE statement creates eight nodes in total: one for the Acme company, three for its employees, and four to represent employee skills. Following the creation of these nodes, we then create some relationships. (sam)-[:WORKS_FOR]->(acme) creates a relationship named WORKS_FOR that connects Sam to Acme. Cypher's syntax requires the relationship name to be placed between square brackets. We then use dashes and greater than (>) or less than (<) symbols to represent the relationship's direction. In this example, the WORKS_FOR relationship extends from Sam to Acme. Notice how we've used the identifi ers sam and acme to reference nodes that were created earlier in the statement.

To execute this statement click the Execute button, or type CTRL-ENTER.

Figure 2: Creating data in Neo4j

Once the statement has executed, the display will show a single results row, representing the newly created acme node (see Figure 2). Click on this node (Node 8 in the screenshot) to display details of its properties (at present, it has only one property, name). From here, you can click on the Switch view mode button, which is at the top-right, below the Guide button, and which looks like a three-node graph. This brings up a graphical view of Acme and its three employees. By clicking around, you can expand the nodes and relationships, as shown in Figure 3.

Figure 3: Visualising the graph

Now that we've constructed a (simple) graph, we can start to query it. Switch view mode again (by clicking the list-like button beneath Guide), then type the following query into the text box, and click Execute:

Ian Robinson works on research and development towards future versions of Neo4j. Formerly Neo Technology’s Director of Customer Success, he has worked extensively with clients to design and implement graph database solutions. He is a co-author of Graph Databases and REST in Practice (both from O'Reilly) and a contributor to REST: From Research to Practice (Springer) and Service Design Patterns (Addison-Wesley).

Neo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4jNeo4j

MATCH (company)<-[:WORKS_FOR]-(sam:Person)-[:HAS_SKILL]->(skill), (company)<-[:WORKS_FOR]-(colleague:Person)-[:HAS_SKILL]->(skill)WHERE sam.name = 'Sam'RETURN colleague.name AS name, count(skill) AS score, collect(skill.name) AS skillsORDER BY score DESC

Page 8: Developer3 2013

The sweet spot for grid computing is pure in-memory processing, sending busi-ness logic to distributed data instead of fetching the data for processing. Such applications can crunch several thousands entries per second and scale horizon-tally. Tax Norway (Skatteetaten) has been implementing grid based processing after a successful Proof-of-Concept in 2012. However, there are several pitfalls to avoid that may not be evident. In this article we take a look at two of them.

Pitfalls of grid computing

By Trond Arve Wasskog

15

© S

hutt

erst

ock

MOVING DATA IS EXPENSIVEGrid computing requires that data is present and partitioned in memory. We encountered several pitfalls while moving data to grid computing heaven.

The picture on next page (Fig. 1) out-lines a grid for batch-like processing of data:

1. Documents to be processed arrive as large files that are scooped into the grid

2. Data is replicated between two different data centers for resil-ience and high availability

3. A job is executed to perform the required processing

4. Data in the grid is archived in a database

5. Results are transferred to adja-cent applications such as the data warehouse

14

Page 9: Developer3 2013

16 17

One use case for this mechanism is to have redundancy between data cent-ers localized on different geographi-cal sites. If one data center fails – for example due to power failure, flood or earthquake – the other data center will continue as nothing happened and the application will experience no downtime. Dynamic scalability is another common use case, add-ing or removing nodes in the grid as demand rises and falls. Finally, rolling upgrades can be facilitated, updating application nodes one by one without interrupting normal operation.

As mentioned in the previous section, redundancy comes at a cost. Insert-ing data into the grid is significantly hampered by backups while asyn-chronous backups may result in data inconsistency in case of failure. As an example, the chart below illustrates the insert throughput for a map with no backups, one synchronous backup and one asynchronous backup with Hazelcast 2.4.

A possible unforeseen effect of redundancy is that memory require-ments per node are quadrupled – not doubled – for a backup count of 1, compared to having no backups. In other words, a net data volume of 10 GB per node requires scaling each node for 40GB, not 20GB. Why? Con-sider a configuration of 4 nodes, each carrying 10 GB data. Redundancy requires that each node stores 10 GB backup data as well. In case of a data center failure, all data will be re-partitioned on the remaining 2 nodes. Now, each node carries 20 GB of pri-mary data and 20 GB of backup data,

a total of 40 GB. This was probably not the intention, but necessary to handle data center failure. A configu-ration option to disable redundancy when this happens would be useful. Of course, if the application does not depend on all data being available in memory, a sensible eviction policy could be used to avoid running out of memory.

SUMMARYGrid computing is a powerful platform for achieving extreme throughput and horizontal scalability. However, make sure that you get rid of the nasty habit of moving and storing data all over the place. Also make sure that redundancy is worth the cost; removing the need for redundancy will increase robust-ness and throughput significantly.

The first operation is to parse the incoming data and load it into the grid. Putting single entities is limited to tens per second; a 20M dataset would take 20 days. We need bulk inserts with thousands of entities per second; 5000/sec and the 20M data-set is done in a good hour. Grid APIs typically provide a putAll(…) method for this purpose. Parallel inserts are required to increase load perfor-mance further, but unfortunately loading data is not straightforward to scale horizontally.

As entities arrive in the grid, they are replicated across the data cent-ers for redundancy. To avoid these backups from detaining inserts, they need to have the same throughput as the inserts themselves. Synchronous backups guarantee that both the pri-mary copy and backups are complete before returning control to the client. This will kill your insert performance. Asynchronous backups offer a best effort alternative, usually with no guarantees on consistency or timing. What we really need is for the grid platform to optimize the backups sim-ilar to bulk loading, or support chang-ing from asynchronous backups while bulk loading to synchronous backups during normal operation.

If you need to make sure all data is persisted to an RDBMS, this also has to be optimized. Grid platforms sup-

port transparent persistence via a pluggable MapStore API. Configured as write-through the entities are per-sisted as they arrive. No surprise, this will destroy performance for large vol-umes. The alternative, write-behind, is an asynchronous mechanism for regu-larly bulk storing all entities marked as dirty. Implemented with the JDBC batch API, a write-behind throughput of thousands per second is possible. Additionally, parallel execution is attainable as each grid node saves its own entities simultaneously. The downside of write-behind is reduced consistency control; no guarantees are given that all data is persisted.

Finally, we need to get data out of the grid. Again, we need to use bulk transfer to exceed thousands of enti-ties per second; fetching items one by one does not scale. Instead of pushing data to client endpoints, an Atom feed can be used to stream data to pull-cli-ents. This approach improves robust-ness and reduces temporal coupling as well as providing high throughput.

Each grid node produce its own event feed, which is concatenated and pub-lished as an Atom feed for clients to consume.

Obviously, we are moving large volumes of data around in order to do in-memory processing. This resulted in an overall throughput of 300 entries per second, one order of magnitude less than anticipated. Several changes are planned or already implemented to increase throughput:

• Parallel loading and processing of independent incoming files

• No grid redundancy; if data are lost we can reload from file

• No database archival; both input and output data are available elsewhere

In general grid computing is a good fit when data can be preloaded and/or lives in memory for a longer period and is processed several times. Other-wise, take a look at stream processing platforms like Twitter Storm.

REDUNDANCY GOTCHASGrid platforms support data redun-dancy for high availability, horizontal scalability and fail-over capabilities. A primary node owns the entity, while it is copied to one (or more) secondary nodes using consistent hashing. When a node crashes, the secondary node promotes its copy and becomes the primary node for the entity. Addition-ally, re-balancing is initiated to rec-reate redundancy for the complete data set on the remaining nodes in the cluster. Adding a node to the cluster also results in re-balancing, assigning the new node ownership of its share of data.

Fig. 2

Fig. 1

Fig. 3

Fig. 4

Trond Arve Wasskog er utvikler, arkitekt og CTO i Bekk Consult-ing. Han har jobbet med utvikling på Java-plattformen i hele sin karrière, og satt sentralt både i PoC-en og i MAG-prosjektet.

Page 10: Developer3 2013

If you ever doubted that you depend on your MacBook as if it were your very life, just wait to see what hap-

pens when it breaks. Two- or three-day turnaround at the Apple Store seems like months! You're stuck

answering emails on a tablet and not writing a single line of code. It turns out your laptop is a tremendously valuable repository of programs, code, and configura-

tion you've tuned over years to create a highly productive, sophisticated development tool.

Configuring Laptops is HARD

By Tim Berglund

19© S

hutt

erst

ock

How sophisticated is that tool? When it comes time to onboard a new developer, you get a sense of just how many individual utilities, applications, server components, and customized configuration files it takes to make your environment sing–because you have to do those things to a brand new machine. It can takes days to install and configure it all.

Maybe you don't hire new developers every week, and maybe you've had good luck and haven't had your machine in the shop for years. Still, something is wrong with this picture. Like blacksmiths working for months on a single sword, we invest significant resources in the configuration of our development laptops. Unlike blacksmiths, we can come up with a powerful system for describing every step of our work and storing it in a Git repository.

Page 11: Developer3 2013

20 21

one-off ID integration work for every new deployment.Boxen is an open-source project originally developed by GitHub for our own internal use. GitHub released Boxen under the MIT License [3].

REPOSITORY STRUCTUREBoxen stores all of its configuration information in Puppet files in a single Git repository. This repo becomes the focus for the entire organization's development workstation con-figuration effort, including everything from negotiating new standards to enforcing version upgrades to individual tweaks. Accordingly, the Boxen project provides a template repository on GitHub [4]. The boxen/our-boxen project is a minimum subset configuration repo, which you should copy and use for your own Boxen deployment. This saves you the trouble of creating the relatively complex template repo on your own.

Precisely how to copy the repository is worth a bit of discus-sion. It's a Git repository with the full history of the develop-ment of the sample repo; however, the ongoing development of your Boxen deployment shouldn't maintain any connec-tion with the template repo. You would never want to fork our-boxen or issue pull requests against it. The best thing to do is to clone it to your local development system and change the origin remote to point to the brand new GitHub repository that will hold your central Boxen repo. Usually this is a private repository that you would create under your company's organization account, or a repository in your internal GitHub instance if you use the behind-the-firewall GitHub Enterprise product. However you solve this prob-lem, the you must end up with your own copy of the Boxen template repo, ready to accept commits and pull requests from the team.

If this brief description is beyond your current Git skills, don't fear. There's a line-by-line listing of the commands to execute in the our-boxen README[5].

We will focus our attention on three key directories in the Boxen repository: config, manifests, and modules.

THE CONFIG DIRECTORYThe config directory contains two files: boxen.rb and basic.rb. You'll pretty much want to stay away from basic.rb, as it contains internal definitions only. boxen.rb, however, is where you go to set essential configuration parameters for your Boxen deployment. You'll choose the directory in which Boxen installs itself (and, by extension, under which it installs many other components you'll configure along the way), the name of the GitHub repository Boxen should look to for new configuration, and other key parameters. The configuration file [6] is fairly well-documented inline.

THE MANIFESTS DIRECTORYThe manifests directory contains the site.pp file, which is the primary Puppet source file executed when Boxen runs. You’ll have to have good Puppet skills to modify this file, but it’s where you’ll want to turn first for to set any global configuration that will apply to all machines configured by Boxen.

THE MODULES DIRECTORYThe modules directory is where most of the action is. In the default template, it contains two subdirectories: people and projects. The people directory contains the personal manifests of all the people in the organization. The projects directory contains manifests specific to individual projects under development.

In Boxen, a project is just a coding project in the way you would normally consider the term. A project has a name, a directory, a Git repo, and one or more other projects on which it depends.

An example project manifest found in modules/projects/manifests/reporting-dashboard.pp boxen::project { 'reporting-dashboard: dir => "${dev_src_dir}/reporting-dashboard", memcached => true, mysql => true, cassandra => true, redis => true, java => true, source => 'smartcorp/reporting-dashboard', }

When Boxen runs, it will clone https://github.com/smart-corp/reporting-dashboard to the directory specified in the dev_src_dir variable. This variable could be set in config/boxen.rb, and can then be overridden in a personal manifest, which we'll take a look at in a moment. It will also find the projects called memcached, mysql, cassandra, and so forth, and ensure that they are installed as well.

Each of those projects has a manifest of its own that defines its[-own-] depend-encies, and potentially other custom configuration as well. It might be the case that all of your MySQL develop-ment instances should have InnoDB as the default storage engine. Well, the MySQL project manifest can ensure this either by dropping a customized /etc/my.cnf file on the developer's machine, or my executing MySQL com-mand-line utilities after installing the database. Space does not permit us a detailed explanation of all possible project manifest options here, but you should know that the options are many.

Project definitions are important, but they are no good if Boxen doesn't know which projects to install for which people. Moreover, centralized Boxen configuration might elect to install some standard packages and projects for the whole organization, but ultimately each developer must be in control of which projects (and which other elements of configuration) are deployed to his or her own machine. Boxen does this using the personal manifest. The personal manifest is a file located in modules/people/manifests, named after the individual's GitHub username. Read this example manifest carefully, including the inline comments.

Boxen is that system. In this article, I'll explain how Boxen is put together, how to use it to collaborate around system configuration, and what components you'll have to have in place to deploy it. I will assume you are basically familiar with two of Boxen's core components, Git and Puppet. If you aren't, don't worry–you'll still finish the article with a good understanding of what Boxen is and how it might be able to help you.

BOXEN IS EASYBoxen [1] is a system for describing the configuration of development laptops using a declarative syntax and auto-matically applying that configuration using a single com-mand line operation. It is based on Puppet [2], which emerged as a tool for configuring operational infrastructure like servers and networking equipment. This infrastructure was historically a large set of hand-crafted configuration spread throughout the data center in a form that was difficult to replicate, document, or test. Tools like Puppet emerged to turn that infrastructure into code, so it, too, could be ver-sioned and collaborated-on in a Git repository.

Boxen configuration files use the Puppet syntax, and Boxen ultimately uses Puppet itself turns those files into configu-

rated laptops. But Puppet was designed to configure serv-ers, and the problems of developer laptop configuration are different from server configuration in subtle ways. Develop-ment machines are usually based on a set of organizational standards (i.e., everybody runs JDK 7, Ruby 1.9.3, and we use Homebrew for package management) with individual customization laid on top (i.e., I want the latest version of Gradle, I use ImageMagick, and I want the AsciiDoctor Ruby Gem installed globally, even if nobody else does). Boxen provides a central Git repository with a set of directory conventions used to express these laptop-specific con-figuration needs. It also defines extensions to the standard Puppet configuration syntax to make it easier to configure workstation settings.

Boxen requires users to authenticate themselves before it does any work. Of course your company has its own authen-tication and authorization system for your own network and applications, and Boxen does not require that you integrate with that directory. Instead, it uses the GitHub API to authenticate your GitHub account credentials. Since the rest of your Boxen configuration is probably going to be stored on GitHub anyway, authenticating against GitHub simplifies Boxen deployment, rather than requiring painful,

NOTE: In its current version, Boxen only works on OSX-based laptops, but there is no reason in principle that future contribu-tors couldn't add sup-port for Linux and Windows. Historically, it was built for Mac users to scratch their own itch. We hope Windows and Linux users will catch the bug soon.

Page 12: Developer3 2013

22 23

is the only goal. That infrstructure is designed through a conventional engineering process, it is expressed through Puppet scripts, and Puppet turns it into running servers. Infrastructure is difficult to design, and the process pre-sents all the normal social problems that attend collabora-tive engineering, but there is nothing uniquely social about the process in any sense that wouldn’t apply equally to infrastructure designed without Puppet.

Configuration of development workstations is another mat-ter entirely. Here, the tools must help arbitrate between the conflicting demands of the organization and the individual. The organization might want to standardize on Skitch for screen capture, whereas an individual developer might prefer Glui. The company might want to configure Git to use a the OSX Keychain credential helper, but a corporate trainer who often logs in to Git with nonstandard usernames might prefer the credential.helper configuration parameter to remain unset. There is a tension between the desire for uniform standards and the need for customization.

Boxen stores all of these decisions in a single Git repository. This includes individual manifests and centralized company standards. Thus for anyone to be able to set individual pref-erences, he or she must also be able to modify files that affect corporate policy generally. This very coarse-grained permissions system might seem surprising in a typical enterprise environment, but it is quite intentional here.

A finer-grained approach would put central policy mani-fests in one repository and personal manifests in another. Only a small group of administrators would have access to the central policy manifests, while everyone might be able to modify his or her own personal manifest. Boxen rejects this approach in order to make central policy decisions transparent to anyone who cares to inspect the repository. This puts pressure on central policy makers to reach deci-sions through an open process of negotiation–say, through a Pull Request discussion–rather than fiat decision.

Running a tool that traverses a large set of configuration files and automatically makes changes to your computer requires that the user trust the tool. Any time the tool does something unexpected–like what would happen when pol-icy changes unilaterally–that trust is damaged. Integrating all of the configuration in a single repo helps encourage a culture of consensus-building and careful balancing of the desires of the team with the desires of individuals within that team.

Moreover, Boxen is not embarrassed to express opinions about how system configuration should be done. Having been developed by a Ruby shop, it speaks with a clear Ruby accent: it installs Ruby by default, and chooses the rbenv

[8] tool to manage different versions of Ruby and their associated gem sets. It chooses Homebrew [9] for package management, and creates its own sandboxed install of Homebrew apart from any installation you might already have. It requires that you enable full-disk encryption (the so-called FileVault service) from your System Prefer-ences. None of these opinions is utterly rigid, but they are all defaults you'll find out of the box.

Boxen’s first purpose is to turn your development laptop configuration into code and then turn that code into a run-ning laptop, but it also has a social agenda. It wants you to collaborate openly around the standards and customiza-tions you employ on the development workstations in your organization.

CONCLUSIONBoxen may not be the last word in workstation configura-tion-as-code, but it has the distinction of being the first. It is an open-source project in its early phases of adoption outside its sponsoring company, but it is already a complete and workable system based on the solid foundation of Pup-pet and easily extensible using Ruby and Bash. At present it supports only Mac OSX Moutain Lion or greater, but we are hopeful the community may extend it Linux and Windows in the future. If you’re a Mac shop looking to collaborate around the configuration of your development workstations and automate their creation, you have found the answer.

REFERENCES[1] Boxenhttp://boxen.github.com/http://boxen.github.com/[2] Puppethttp://docs.puppetlabs.com/#puppetpuppet[3] MIT Licensehttp://opensource.org/licenses/MIT[4] template repository on GitHubhttps://github.com/boxen/our-boxen[5] our-boxen READMEhttps://github.com/boxen/our-boxen/blob/master/README.md[6] configuration filehttp://boxen.smartcorp.com[7] Boxen Webhttps://github.com/boxen/boxen-web[8] rbenvhttps://github.com/sstephenson/rbenv[9] Homebrewhttp://brew.sh/

An example personal manifest found in modules/people/manifests/tlberglund.pp

BOXEN WEBBoxen needs a place to go to authenticate the users run-ning it. Anyone running Boxen must have a valid GitHub.com or GitHub Enterprise account, and that account must be a member of an organization configured to use Boxen. Rather than push this authentication configuration and logic to each installation of Boxen, it is centralized in a component called Boxen Web [7].

In addition to providing authentication, Boxen Web a sin-gle URL that displays a friendly page with easy bootstrap

instructions. Anyone championing Boxen inside their organization will have an easy time telling teammates, "Visit http://boxen.smartcorp.com and follow the instruc-tions there"–particularly when those instructions amount to copying a single command-line command and running it in the terminal. Boxen Web gets this job done.

SOCIAL IMPLICATIONSBoxen converts code into running infrastructure. When con-figuring servers with Puppet alone, infrastructure-as-code

class people::tlberglund {

# These are defined as applications under modules/projects/manifests

include projects::training include projects::scriptdoctor

# These are installed by a package manager (homebrew by default) package { 'lame': ; 'gradle': ; 'watch': ; 'imagemagick': ; 'groovy': ; 'emacs': ;

'GPGTools': provider => 'appdmg', source => 'https://github.com/downloads/GPG Tools/GPGTools/GPGTools-20120318.dmg' }

# These are globally installed Ruby Gems ruby::gem { 'Asciidoctor': gem => asciidoctor, ruby => '1.9.3' }

ruby::gem { 'watir-webdriver': gem => watir-webdriver, ruby => '1.9.3' }

# Boxen has a syntax for setting OSX plists boxen::osx_defaults { 'Disable autocorrect': user => $::luser, domain => 'NSGlobalDomain', key => 'NSAutomaticSpellingCorrectionEnabled', value => false; 'Require fn for media keys': user => $::luser, domain => 'NSGlobalDomain', key => 'com.apple.keyboard.fnState', value => 1; }}

Tim is a trainer for [GitHub], a speaker internationally and on the [No Fluff Just Stuff] tour in the United States, and is president of the [Denver Open Source User Group]. He is one of the developers of the [Ratpack] web framework, is co-presenter of the [O'Reilly Git Master Class], co-author of [Building and Testing with Gradle] and author of [Gradle Beyond the Basics]. He blogs occasionally at [timberglund.com], and lives in Littleton, CO, USA with the wife of his youth and their three children.

Page 13: Developer3 2013

25

HOW TO USE THE MODELThe first thing you need to establish is your current level of maturity within each category in the model. This will give you an idea of your strengths and weaknesses. Secondly, you need to prioritise. It is important to focus your efforts on the greatest bottleneck in your delivery process. To identify this bottleneck it can be helpful to visual-ise your value stream and focus your attention on the steps that are most error prone or slow.

Prioritising which level to start enhancing will differ, and you will have to make your own assessment on which category will give the most value. You should try to keep the overall maturity level fairly even as most categories at the same level either depend on or complement each other. Furthermore you should not

skip levels or try to implement them all at once. As in any agile approach you should introduce changes in an incremental and iterative way.

PROCESS & ORGANISATIONEvery organisation is different, and they all have a variety of processes. Yet there are some common cat-egorisations that can be made. Silo organisations are typically a bad idea. People that depend on each others work are not co-located and don't work together. This causes ineffective handoffs, less insight in the whole, misunderstandings and a blame cul-ture. No one can get their own work done before others have completed theirs. Since the silos "own" the stuff they are in charge of, they don't let others touch it. When developers don’t have access to production logs they are unable to see what goes on

in production, and troubleshooting becomes almost impossible.

When organisations begin to adopt Agile the communication with business improves and releases become more frequent. The boundaries between the fractions gets blurred and for the sake of sanity the developers get access to production logs. Gradually the teams become more efficient, and they measure and seek ways to reduce cycle times between deploy-ments. By always having their code production ready they can release at any given moment. With freedom the teams usually self-organise, given that they are cross-functional. Everyone understands that everyone involved in creating the system must work together. Developers and Operations share common goals (DevOps) and eve-ryone works on the system as a whole.

24

A Maturity Model forContinuous Delivery

Continuous delivery has become increasingly popular over the last few years, but implementing it is often seen as difficult and daunting. Many seem to believe that to gain anything from continuous delivery you must implement it one hundred percent. We hold this to be false. The road to continuous delivery is paved with many smaller goals, each of which deliv-ers value in themselves.

By Sveinung Dalatun and Stein Inge Morisbak

© S

hutt

erst

ock

PROCESS &ORGANISATION

TECHNOLOGYQUALITY

ASSURANCEDEPLOYMENT

ROUTINESCONFIGURATION

MANAGEMENTBUILD & CI

ADVANCED

Self organised and cross functional The team can solve any task. Releases continu-ously. DevOps!

Loosely coupled architecture It is easy to replace technology for the be-nefit of something bet-ter (Branch by abstrac-tion).

All testing automatedAlmost all testing is automated, also for non-functional require-ments. Testing of infra-structure code. Health monitoring for applica-tions and environments and proactive handling of problems.

One-click deployEverybody (including the customer) can de-ploy with one click. 0-downtime deploy. Feedback on database performance and de-ployment for each re-lease.

Infrastructure as codeFully automated provi-sioning and validation of environments. Or-chestration of environ-ments.

Build/deploy pipelineSame binary is deployed to all environments. Continuous improve-ment and automation of repeating tasks. Optimi-sed for rapid feedback and visualisation of in-tegration problems.

INTERMEDIATE

Pull-based processMeasurement and re-duction of cycle time. Continuous focus on process improvement. Always production ready code.

Simple technologyIn depth knowledge about each technology; why it is used and how it works. All of the used technologies are easy to configure and script against. Technology that makes it simple to roll back and forth bet-ween database versi-ons.

Automated functional testsAutomated accep-tance- and system tests. Tests are written as part of requirements specification. All stake-holders specify tests.

Automated deploy Same process for de-ploy to all environ-ments. Feature togg-ling to switch on/off functionality in produc-tion. Release and roll-back is tested. Data-base migration and rollback is automated and tested for each deploy. Database per-formance is monitored and optimised.

Application configuration control All application configu-ration in version con-trol. The application is configured in one place.

Continuous integrationContinuous integration of source code to main-line. All changes (code, configuration, environ-ments, etc.) triggers the feedback mecha-nisms. Artifact reposi-tory. Reuse of scripts and tools. Generation of reports for the build. Builds that fail are fi-xed immidiately.

BASELINE

Agile 101 Improved communica-tion with business. Re-leases after each itera-tion. Developers have access to production logs.

Best-of-breed Chooses technology stack based on what is best for each purpose. Chooses preferably Open Source. Avoids products that causes vendor lock-in.

Automated technical tests Automated unit- and integration tests.

Repeatable deploy Documented and parti-ally automated deploy. Database changes are scripted and versioned.

Dependency controlDependencies and li-braries are defined in version control.

CI-server Automation of builds/tests on CI server. Can recreate builds from source code.

BIG CHALLENGES

Silo organisationPeople who in some way depend on each others work are not sitting together. Infre-quent releases. Develo-pers do not have access to production logs.

"Enterprise" infrastructure Technology that can only be configured via a GUI. Large "enter-prise" suites claiming they can solve all your problems.

Manual testingTest department. Tes-ting towards the end, not continuously. De-velopers do not test.

Manual deployDeployments require many manual steps. Manual and unversio-ned database migra-tions.

Manual configurationManual configuration in each environment and on each server.

Manual routines Manual routines for builds. Lack of artifact repository. Lack of reports.

Page 14: Developer3 2013

26

TECHNOLOGYThe transformation must also be supported by the best technology. "Enterprise" infrastructure that can only be confi gured via a GUI and which promises to solve all your problems just doesn't cut it. One must choose each technology carefully and put together a stack which best suits your specifi c needs. Open source technolo-gies are easier to confi gure, script against, and they are a lot easier to understand (!). When your stack is put together in a "loose" fashion it is easy to replace one part with another when something better comes along.

QUALITY ASSURANCETo be able to shorten delivery time you have to ensure that quality assur-ance is built into the process itself in an automated way. Handing your code over to a test department or spend-ing two days of testing each time you release becomes impossible. This doesn't mean you should test less. The mantra of continuous delivery is to automate everything that can be automated, and all the different fl avours of testing are obvious can-didates for automation.

DEPLOYMENT ROUTINESSpeeding up the cycle time from idea to production is what continu-ous delivery is all about. Nothing has any value unless it’s in production. Deployment shouldn't be something you spend a lot of time focusing on. It should “just happen”, and it shouldn't involve any risk. Automate both deploy and rollback, have a feature toggle safety net, and pay special attention to your database. When releasing often you should be able to deploy without downtime.

CONFIGURATION MANAGEMENTHaving configuration scattered all around makes it hard to understand how your application works and makes it diffi cult to pinpoint the cause when trouble arises. Keep it in source con-trol and in one place.

An application bug is not the only thing that can cause trouble in production, a badly confi gured infrastructure can do it just as easily. Therefore, you should treat your confi guration as you would your code, put it in source control, and maybe use a provisioning framework. Make sure you test your infrastructure and use the same confi guration in all environments (dev, test, qa and prod).

BUILD & CIThis category is closely related to the Quality Assurance, Deployment Routines and Confi guration manage-ment categories. While the fi rst pro-vides the feedback, the second the deployment machinery, and the third the infrastructure, Build & CI puts it all together in a pipeline and provide feedback at every stage.

The most basic mechanisms merely runs tests every time code is checked in. A more advanced setup will have the feedback mechanisms triggered by any change in any environment, be they code changes, deployments or confi guration changes.

SUMMARYContinuous delivery is all about reduc-ing risk and making sure business gets their return on investment as soon as possible. It’s about removing focus from repetitive and risky tasks and devoting all you effort into delivering business value.

Hopefully you will fi nd the maturity model valuable and useful in your own environment, and that it can help and inspire you to become better at obtaining your goals. Good luck!

For an online version of the model, see: http://bekkopen.github.io/maturity-model

Stein Inge Morisbak is Practice Lead for Continuous Delivery and Devops at BEKK. He is a true Agile evange-list with more than 10 years of experience in both contributing to, and helping others to become better at producing excellent software together with demanding customers. He is also an experienced speaker at conferences and the founder of DevOps Norway Meetup.

Sveinung Dalatun works as a consultant at BEKK. Currently he focuses on continuous delivery and DevOps, mostly automating stuff to be able to focus on the more important things in life.

© S

hutt

erst

ock

ProgramUtvikling offers the best courses and most fl exible training to the developer community wher-ever you want us to. Our philosophy is to provide “practical, applicable knowledge” by providing the highest quality training with the best instructors.

In addition to our permanent staff we have a number of exciting and well-known instructors such as Herb Sutter, Craig Larman, Billy Hollis, Mike Cohn, Geoff Watts, Gill Cleeren, Sahil Malik and a great staff of excellent Scandinavian instructors.

NDC has become one of the largest conferences dedicated to .NET and Agile development and is hosted by ProgramUtvikling AS.

Training for developers and leadersin Oslo, London or wherever you like

HTML5 • Javascript • Mobile • Agile • Scrum • Design .NET • Java • Architecture • TDD • SharePoint • C++

OSLO - www.programutvikling.no LONDON - www.developerfocus.com

Phot

o: S

hutt

erst

ock

Page 15: Developer3 2013

28 29

So, what are our options for writing Android tests? And, is Android a viable candidate for Test-driven development (TDD)? I will in this article shed some light on four differ-ent frameworks and strategies, and their pros and cons. Finally, I will provide a suggestion of what a test setup could look like.

Note that the described frameworks are my subjective choices, and others may be more suitable depending on the situation.

BACKGROUNDEarlier, when people suggested testing Android code, the answer was a firm “no!”. Problems with testing Android dependencies were common, and a typical pitfall was to only write tests for the Java portion of the application at hand. Because a distinct separation between the Android dependencies and the Java code is hard to achieve, the end result was poor test coverage.

Instrumentation tests are today the most common Android tests. These are Activity tests that hook into the application life cycle through an Instrumentation API. This means that the actual application is run in the Dalvik Virtual Machine (DVM) on either a device or in the emulator during testing.

Of the four frameworks described in the next section, three are based on instrumentation, while the fourth targets another strategy, where tests are run in the Java Virtual Machine (JVM).

FRAMEWORKSAll examples shown will test the simple UI shown in figure 1. The goal is that a button click will trigger the addition of two numbers and output the result to a TextView:

Figure 1

THE ANDROID INSTRUMENTATION FRAMEWORKGoogle provides a large set of tools to test all application components, and the Android Instrumentation Framework is among these.

Figure 2 shows the setup where the view elements defined in the layout file are assigned to variables.

Figure 2

ANDROID and testingWriting tests for Android is a growing trend. The market for mobile applications has expanded, and we now develop large scale applications packed with functionality, in need for a robust test suite.

By Christoffer Marcussen

The

And

roid

robo

t is

repr

oduc

ed o

r mod

ified

from

wor

k cr

eate

d an

d sh

ared

by

Goo

gle

and

used

acc

ordi

ng to

term

s de

scri

bed

in th

e C

reat

ive

Com

mon

s 3.

0 A

ttri

buti

on L

icen

se.

© S

hutt

erst

ock

Page 16: Developer3 2013

30 31

When using the Android Robot or any modi�cation of it, proper attribution is required under the terms of the Creative Commons Attribution license:

The Android robot is reproduced or modi�ed from work created and shared by Google and used accord-ing to terms described in the Crea-tive Commons 3.0 Attribution License.

APPIUMAppium is a framework for cross-platform automation testing. In fact, with some setup modifications, tests written for Android can actually be run against iOS appli-cations as well. It uses the Selenium Web Driver API, which means that tests can be written in any supported language, for example: Java, JavaScript or Ruby. During a test run, Appium receives and translates Selenium com-mands into appropriate native calls, based on the target platform. These are then run using the Android UIAutoma-tor framework.

Figure 8 shows the test setup, and figure 9 shows the test.

Figure 8

Figure 9

ProsCross-platform testing is an interesting idea, and so is the fact that developers can choose from a variety of program-ming languages. Appium also has the same advantage as Robotium, regarding abstractions of Android quirks.

ConsAppium only supports SDK levels higher than 16 (4.1), where an additional framework has to be used for older versions. Developers familiar to Android have to adapt to the somewhat different Selenium syntax. An example is how to do simple tasks such as locating a text field, where the android:id tag cannot be used. One alternative is to find the element using the android:contentDescription tag. Appium also runs in the emulator or on a device, and the same disadvantage as with Robotium and the Android Instrumentation Framework applies regarding time use.

CONCLUSIONRobolectric is by far the most TDD-suitable testing frame-work among the mentioned. If TDD is a priority, Robolectric should definitely be considered. The feedback cycle is short, which is important if a technique such as pair-pro-gramming is to be used. For Java developers, an additional advantage is that it is “business as usual”, as they can use familiar frameworks such as Hamcrest and Mockito.

Test frameworks that use the emulator or a device do have their place in the world of Android testing. While the Android Instrumentation Framework, Robotium and Appium are not as suitable for TDD (which they were never meant for), they provide unique testing of actual activities and components.

Google devotes a lot of resources to improve possibilities for testing mobile applications, which the annual Google Test Automation Conference is a good example of. There is really no reason why testing Android code should be avoided. Though the examples in this article are very basic, each framework is capable of testing complex Android

functionality. Which ones to use depend on the situation, as none of the described frameworks excel in all aspects. The devel-opers’ skill set may be a contributing factor in favor of tools such as Appium. In my expe-rience, web developers may favor languages such as JavaScript or Ruby, which both can be used to write Appium tests.

An example test setup could be to use either Robotium or Appium on a CI-server such as Jenkins, where one is not dependent on a quick feedback cycle. Combined with Robolectric unit tests and maybe a stress-testing tool such as Monkey, the application at hand would have great test coverage.

Figure 3

Figure 3 shows the test. @SmallTest means that this test does not interact with any file system or network. runOnUiThread is needed as UI commands cannot be run in any other thread.

ProsOne of this framework’s advantages is its maturity. It is maintained and updated by Google, and no third-party dependency is necessary. It is also very easy to get started with instrumentation testing in the Android Studio IDE.

ConsIt was mentioned earlier that instrumentation tests run the actual application. This means that an APK (Applica-tion Package File) must be built for each implementation change, which is a time consuming operation. Additional time use is also to be expected if the tests are run in the emulator. An emulator such as Genymotion will contribute to a smoother experience, but the bundling of resources and conversion of .class files to .dex files cannot be skipped.

Another disadvantage is that a basic understanding of Android is necessary to understand the syntax and how to write tests. It is not intuitive that one has to explicitly set the UI operations to run in the UI thread.

ROBOTIUMRobotium can be seen as an extension to the instrumen-tation testing provided by the Android SDK, and focuses on black-box testing. While the Android Instrumentation Framework requires explicit test setup, such as to run in the UI thread, Robotium introduces an abstraction layer in order to simplify and increase readability. Figure 4 shows the Robotium test setup, and figure 5 shows the test.

Figure 4

Figure 5

The Solo tool is used for interacting with the UI. Note that the underlying operations that had to be set explicitly in the Android Instrumentation Framework are hidden.

ProsRobotium’s greatest advantage is that the syntax is read-able and intuitive. The developer can focus on the task at hand, without having to know about necessary Android quirks before creating a test.

ConsBecause instrumentation is still used, Robotium is as time consuming as the Android Instrumentation Framework. It is also not possible to test multiple processes with Robotium, which the Android SDK has support for through UIAutomator.

ROBOLECTRICRobolectric is an innovative tool that removes the need for the Android SDK. This allows for tests to be run in the JVM instead of the DVM, and is achieved by replacing the native Android calls with proxies.

Figure 6 shows the test setup and figure 7 shows the test.

Figure 6

Figure 7

All Android calls in figure 7 such as “setText” and “perform-Click” appear to be native, but are replaced with Robo-lectric’s proxy implementations.

ProsIt is blazingly fast, and the feedback cycle is faster than for any of the other frameworks. Another advantage is that it is combinable with Java testing tools, which are not available in the Android SDK. This could for example be a mocking tool such as Mockito, although Robolectric has built-in mocking functionality.

ConsBecause the JVM is used, the application is not run in the emulator or on a device. One could therefore argue that using proxies instead of the actual appli-cation components is a weakness compared to the instrumentation frameworks. The Robolectric API does not offer full Android SDK support, though it is continuously expanded. It is also not straightfor-ward to use Robolectric in combination with frame-works such as RoboGuice, although it is supported.

Christoffer Marcussen is a developer at Bekk. Besides his daily work with web technologies, he enjoys fiddling with native Android and iOS develop-ment. Christoffer holds a MSc in computer science from NTNU.

Page 17: Developer3 2013

32 33

Shay Banon created ElasticSearch out of a need for a scalable search solution. In short, he extended the highly sophisticated searching and indexing library Lucene with advanced functionality for distribu-tion and clustering. At the same time, he kept all functionality as dynamic and flexible as possible. This has paid off - ES is now a company with a growing community around it and the software is currently in use at com-panies like github, foursquare and StackOverflow (and also at several companies in Norway).

One important feature of ES is that it will store and index whatever you throw at it. It is schema-less and com-pletely dynamic - it will create indices as needed and also let you store sep-arate object types (entities) within an index as you go. At the same time, you can search within specific entities or indices in your system, or across all of them, and also use wildcards for more fine-grained targeting. All of this whilst keeping it very simple to scale your system - you can add new servers at runtime and ES will take care of the rest.

The easiest way to communicate with ES is via its REST-based API. The data format for requests and responses is JSON and as usual, HTTP verbs must be used properly. So all you need to do to store data in ES is to send a JSON object using HTTP PUT. Each field will then be parsed and a data type will automatically

be inferred from the values. (Field types can also be specified manu-ally.) The index data will then be split into a given number of shards and put on other nodes in the clus-ter. Also, each shard is replicated to the other cluster nodes. Replication happens automatically and allows for scalable searching and redundancy. In the event of server crashes your system will keep running as long as the shards on the running nodes form a complete index.

Getting documents is easy as well, but due to the wide range of features related to searching, real-time fetch-ing, filtering and aggregation your search requests will normally be a bit complex - simply because you need to specify more parameters. The docu-mentation will help you explore the various options, but there could have been more information about how to solve typical domain modeling prob-lems. Here the Solr wiki can be very helpful, and experience with Solr or Lucene is nevertheless a huge plus. Since it is based on Lucene, it is natu-ral to regard ElasticSearch as a doc-ument database. The fundamental

data structure is an inverted index, and this leads to a performance pro-file where inserts, lookups, aggrega-tion, filtering and set operations run particularly fast. This makes ES an ideal solution for real-time analyt-ics, where there is a need to quickly compute simple statistics on multi-dimensional, streaming data. The log analysis tool Logstash gives a good example of what ES can do.

The power of ElasticSearch comes with a cost: Complexity. Although a small setup is easy to configure, highly distributed setups are inher-ently complex and you will need to consider a lot of options - and choose the right tradeoffs - all according to your needs. Some of the typical areas where you need to compromise are memory usage (heap size vs garbage collection pauses), cache sizes (mem-ory usage vs response times), com-pression (storage requirements vs response times), replication (redun-dancy vs storage requirements), partitioning (local vs distributed processing) and how to handle split-brain scenarios.

Split-brain scenarios can be particu-larly challenging. In short, a split-brain happens if a group of nodes disconnect from a cluster and form a new, separate cluster. This has to be avoided since there is no way to automatically merge the two clusters afterwards without risking data loss. ES has fail-safe mechanisms to avoid split-brain, e.g. you can provide a

cluster threshold. A simplified expla-nation of the threshold is that at least N nodes must be running in a group of servers before they are allowed to consider themselves a standalone cluster. However, this leads to new compromises and tradeoffs.

In one project, I worked on an ES installation where a non-functional requirement said the system should be operational as long as one node in the cluster was operational. Meeting this requirement would mean that the complete index had to be stored on each node, leading to huge storage needs. Another consequence was that a single node, if cut off from the cluster, would regard itself as a sep-arate cluster, leading to split-brain. Increasing the lower limit on when server nodes could form a cluster would not help since the require-ment was for the system to be able to run on a single node. After consid-ering various options, we reached the conclusion that the requirement could not be met.

It might sound complicated work-ing with ES, buy in my opinion, most of the complexity stems from the problem domain itself, and not so much from the software. Creating a scalable and performing system that supports storage, retrieval and ana-lytics is a hard problem, but ES will give you a very powerful tool to use. My experience with the software has been great and I am looking forward to what the next releases will bring.

ElasticSearch is a newcomer to the world of Java software. The uniquefeature-set ElasticSearch (ES) offers has made it a popular choice forsolving a variety of data processing problems. Let's have a closer look at what ES is and how it can be applied.

Kristoffer Dyrkorn is a Scientist i BEKK. He has been involved in architecture and delivery of various Java-based web applications the latest 12 years. Besides being a dedicated search engine nerd he specializes in systems architecture, integration and performance optimization.

By Kristoffer Dyrkorn

© S

hutt

erst

ock

ElasticSearch:Analytics, real-time, NoSQL, search

33

Page 18: Developer3 2013

34 35

.NET Rocks!The ".NET Rocks! boys- Carl Franklin and Richard Cambell will be hitting the road in the UK and they want you to join in by being their audience.

The fi rst NDC London will be on the 2-6 December and is expanding on the success of the Norwegian Devel-opers Conference in Oslo. The venue is already booked and both pre-con-ference and conference will be at the ICC suites at the ExCel venue.

Kjersti Sandberg, founder of NDC London, says: As NDC London will be the fi rst time NDC goes outside Oslo we will hold nothing back as we aim to create the best developer conference that London has ever seen- boosting the industry like a 'Vitamin injection'. The conference will offer an arena for developers to share, gain and celebrate expert knowledge, and the perfect 'feel good' boost to the ever-evolving developer community”.

To kick-start the developer festival, NDC London will be hosting a series of events prior to the conference, such as a quick dip in security with Jon McCoy and a UK road trip tour with the .NET Rocks! boys.

GET A FREE QUICK DIP INTO THE SECURITY WORLD FACED BY BUSINESSES TODAY Don't miss out on this free morning session with Jon McCoy in London on the 17th of October. Learn how to tackle security issues on the 39th fl oor of the Canada Square building in Canary Wharf- one of the world's most hi-tech business and finance districts. Sign up for this 3 hour free workshop at www.ndc-london.com/level39

DATE: 17th OctoberTIME: 09.00-12.00VENUE: Level39, situated in the 39th fl oor of the iconic One Canada Square building.

EARLY BIRD OFFERWe hope you share our passion and excitement for NDC and will join us in making London's fi rst 'Developer Fes-tival' legendary. For more information or tickets purchase visit: www.ndc-london.com.

Don't forget to get your ticket before the Early Bird offer expires 15th of October.

This year marks the end of the long wait, as New Developers Conference will be continuing in London in December. This means that there are now two opportunities a year for developers to access the wisdom of some of the world's best speakers.

Join NDC London By Charlotte Lyng

.NET ROCKS! UK TOUR:Hang out with Carl and Richard in Bristol on the 24th, London on the 25th and Manchester on the 26th of September whilst they record their show. At each destination the .NET Rocks! will meet and greet a speaker that will be attending NDC London. The venues are currently being booked, to get more information or sign up visit www.ndc-london.com/dnr

Bristol 24 Sep

London 25 Sep

Manchester 26 Sep © C

harl

otte

Lyn

g

Jon McCoy

Page 19: Developer3 2013

3736

THE BENEFITS OF IMMUTABILITYFunctional programming does to variables what structured programming did to goto. Much like how uncontrolled goto statements make programs hard to understand and maintain, uncontrolled mutability also has similar negative effects. By removing mutability we can remove quite a few con-cerns in code. It helps to minimize errors, it's easier to reason the code, and alleviates the pains of concurrency. Let's quickly discuss each of these points.

MINIMIZE ERRORSAs humans we're creative and can comprehend quite a bit of complexity. However, we're not good at remembering many low level details. Along the execution path of a method or a function if we modify the input parameters or alter state, we increase the chances for errors or bugs to creep in. After all we're not good at juggling multiple states in our minds, and what we call as bugs often are a result of our inability to deal with the increased accidental complexity we've introduced in solving problems (see off-by-one error, for example, we discuss later in the article).

EASY TO REASONA code that transforms a given input to a desired output is easier to com-prehend, explain, and reason than the one that mutates variable. Let's con-sider an example, but before you read the code below, grab a stopwatch. As you read the code, measure the time it takes for you to fi gure out what the code below does.

int total = 0; for(int i = 0; i < values.size(); i++) { if(values.get(i) > 3 && values.get(i) % 2 == 0) total += values.get(i) * 2; }

Listing SUB-1: A sample imperative code that works with a list of numbers

How long did that take? Note down.

The constructs used in this Java example is quite familiar to most of us, the format is common in C-style languages which are mainstream today. The style here is imperative in nature. Imperative code have two traits, they often involve mutability and spell out not just what but how the code should work. There are two mutable variables in this example, the variable total and the loop index variable i. The code is short, but has many steps. It produces the total of double of select values that are even and greater than 3.

Totaling values appears to be an operation that's innately mutable, how-ever, we can perform this operation in a declarative/functional style with the help of some library functions as in the next Java 8 example.

fi nal int total = values.stream() .fi lter(value -> value > 3) .fi lter(value -> value % 2 == 0) .mapToInt(value -> value * 2) .sum();

Listing SUB-2: A declarative version of the previous example, written in Java 8

This version is also short, but is in declarative style. In this style, we tell what we want, but not how, we let the library functions fi gure that out. This may be unfamiliar to programmers who've only programmed in mainstream C-style languages, but each line in the code does one thing and builds on the previous step. The code reads much like the problem we're trying to solve, given the values, fi lter elements greater than 3, then fi lter even values, fi nally double the fi ltered values, and total.

36

Assignment-less programming is one of the corner stones of functional programming. For those of us who have mainly programmed with imperative languages, it is hard to fathom cre-ating programs without mutating variables. In this article we will briefl y discuss the reasons to honor immutability and explore some ways to achieve that.

PROGRAMMING WITH IMMUTABILITY IN JAVA from Challenges of Imperative Style to the Possibilities of Functional Style

By Venkat Subramaniam

© S

hutt

erst

ock

Page 20: Developer3 2013

38 39

In the printTotal method we receive a Stream of values and total the double of even values greater than 3. In addi-tion we measure the time the operation would take. In the main function we invoke the printTotal function with the sequential implementation of Stream first and then the concurrent implementation. The time taken by the two operations for a small list of ten values is shown next:

Total: 56 Time: 0.756 seconds Total: 56 Time: 0.105 seconds

The results of the two execution are the same, a total of 56, however, the concurrent version, even for this little sample of data, was faster on my multicore processor.

We discussed some main benefits of immutability. Next, let's take a look at how we an achieve that.

HOW TO HONOR IMMUTABILITYIf you're like me and have programmed for years in C-style languages like C++, Java, and C#, programming with immu-tability would at first seem like a strange idea. We're so used to creating variables and mutating them. Learning to program with immutability may appears to be rather a strange restriction and quite unnatural. However, a few techniques can make immutability more approachable. Let's discuss them next.

USE CONSTRUCTS THAT BIND VALUES RATHER THAN MUTATE VARIABLESThe all too familiar traditional for loop has some serious drawbacks, it has too many moving parts in it. Consider the for statement:

for(int i = 0; i < values.size(); i++)

We first initialize the index variable i, but then have to decide, rather explicitly, the terminating value. Is that < or <=, should we use values.size() or values.size() -1? It's easy to get these wrong (as we often do) and end up with the fondly known bug called "off-by-one" error. The for loop, furthermore, requires us to decide on the iteration step, even though most often we step by one.

More deeply, the variable i is mutated repeatedly as the loop iterates.

On the other hand, the foreach loop in Java 5 does not have this problem and, in addition, has fewer moving parts.

for(int element : values)

The variable element is not altered through the loop, but a new value named element is bound to a new values each time through the loop. This difference is subtle but quite significant.

The code takes the values through a series of transforma-tions, but does not modify any values along the way. Once we get familiar with functions like filter and map, this ver-sion is easier to comprehend. Furthermore, this version is easier to make changes to as well, we can effortlessly inject a step or remove one as we desire.

ALLEVIATE THE PAINS OF CONCURRENCYWith multiple cores becoming a standard on the hardware side and with increased demand on responsiveness of applications, multithreading is not an esoteric feature we can ignore. Shared mutability makes programming concur-rency incredibly difficult. In the seminal book "Java Con-currency in Practice" Brian Goetz covers the complexities of the Java memory model and the impact it has on getting concurrency right. "Programming Concurrency on the JVM" by Venkat Subramaniam discusses the prominent solutions that have evolved on the JVM to solve this tough problem.

Uncontrolled shared mutability is the single most source of problems from the concurrency point of view. The first big step to programming concurrency is to minimize mutability.

Take the example in Listing SUB-1, the imperative version to total the even values greater than 3. Suppose we have a fairly large collection of numbers and want to speed up the evalu-ation of the result. How can we make that code concurrent?

The short answer, with a lot of effort and when we're done the concurrent version would look not much the same as the sequential version.

Now take the example in Listing SUB-2, the functional style to total the even values greater than 3. In this version

we honored immutability, each of the little functions we performed along the way did its part but did not alter any state. This act of programming hygiene on our part has a huge payback, making this version concurrent is effortless in Java 8, as we see in Listing SUB-3.

final int total = values.parallelStream() .filter(value -> value > 3) .filter(value -> value % 2 == 0) .mapToInt(value -> value * 2) .sum();

Listing SUB-3: Concurrent version of code in Listing SUB-2

We simply changed the call to stream() to parallelStream(). In Java 8, Stream is an interface that abstracts a fancy iterator and provides several useful functions (like filter, map, etc.) (see "Functional Programming in Java: Harness-ing the Power of Java 8 Lambda Expressions" by Venkat Subramaniam). A call to the stream() method returns an implementation of this interface that sequentially performs the requested operations. On the other hand, a call to parallelStream() returns an implementation of the interface that executes its operations concurrently. While there is quite a bit of complexity hidden under these implementations, a key step to reaping those benefits was in avoiding mutability in our code.

Let's take a look at the performance gains for the sequen-tial vs. concurrent versions in Listing SUB-4. Let's refactor the common code to make the measurement easy, and to make the timing for this small example significant, we'll add a small delay to the execution.

import java.util.*;import java.util.stream.*;

public class Sample { public static void printTotal(Stream<Integer> values) { long start = System.nanoTime(); final int total = values .filter(value -> value > 3) .filter(value -> isEven(value)) .mapToInt(value -> value * 2) .sum();

long end = System.nanoTime(); System.out.printf("Total: %d Time: %.3f seconds\n", total, (end - start)/1.0e9); }

public static boolean isEven(int number) { try { Thread.sleep(100); } catch(Exception ex) {} return number % 2 == 0; }

public static void main(String[ ] args) { List<Integer> values = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); printTotal(values.stream()); printTotal(values.parallelStream()); }}

Listing SUB-4: Sequential and

concurrent version to total

select values

For example, if we try the following code in Java 8, we will get a compilation error.

The Java compiler will complain as shown next:

The compiler is indicating that the variable i is being mutated and it's quite dangerous to access as such from within a lambda expression. On the other hand, the follow-ing code compiles without any error.

The value of element is effectively final here, it is not being mutated and a new variable/value is created each time through the loop, much like a new variable is created for the parameters of a method each time we call the method.

Using these kinds of constructs that bind new values rather than repeatedly mutate a variable is better from the point of view of honoring immutability and reducing errors.

List<Integer> values = Arrays.asList(1, 2, 3); for(int i = 0; i < values.size(); i++) { Runnable runnable = () -> System.out.println(values.get(i)); //ERROR }

error: local variables referenced from a lambda expression must be final or effectively final Runnable runnable = () -> System.out.println(values.get(i)); //ERROR ^ 1 error

for(int element : values) { Runnable runnable = () -> System.out.println(element); }

Page 21: Developer3 2013

40 41

RELY ON LIBRARY FUNCTIONS THAT FACILITATE IMMUTABILITYOne easy way to avoid mutability is to cover it under the rug, I mean encapsulate it. We could use library functions that can hide or eliminate mutability and at the same time make the code more declarative.

For example, let's say we're given a list of names:

Here's imperative code to determine if the list of name contains Kim:

boolean kimFound = false; for(String name : names) { if(name.equals("Kim")) { kimFound = true; break; } } System.out.println("Found kim?:" + kimFound);

This example is imperative in nature and at least one vari-able was tortured. Alternately we can go declarative and simply ask the collection to get this task done, as in:

That was simple, but what if we want to find if the list con-tains someone with a 3 letter name?

We could do the following, with the full flare of mutability and imperative style:

Or, we could do the following, using the JDK 8 library:

The code is not only concise, it has fewer moving parts, at least in the code we have to view and maintain.

USE MORE EXPRESSIONS AND FEWER STATEMENTSWe use expressions and statements as building blocks when writing code, however, there is a fundamental dif-ference between the two. Statements perform actions but don't return anything. Expressions on the other hand return some result/value back in response to the call. By nature, statements lead to mutability while expressions can easily favor immutability.

Statements are quite evil from the point of view of immu-tability. Statements perform actions, but they don't return anything. So the only way to get any results from them is to take a look at the aftermath of their side-effects. Expressions on the other hand, return result. They don't have to cause any side-effect (unless we force them to). We can easily learn about what they achieved by looking at the result they readily return.

We can easily compose expressions to form a chain of operations, where the result of one expression flows into the next. Statements on the other hand do not compose well. We have to invoke them, fetch the result of their side-effect, and then invoke the next statement or expression.

When creating our own APIs, we can promote immutabil-ity by writing more expressions than statements. Where we have a choice, we should use more expressions than statements. For example, consider a rather simple case of a decision:

String canIVote; if(age > 17) canIVote = "Yes, please vote"; else canIVote = "Not yet!"; System.out.println(canIVote);

Listing SUB-5: Using an if statement to make a decision forces mutability

We first created a mutable variable, canIVote, and within the branches of the if statement modified it. The if state-ment in Java does not return any results. This forces us down the path of mutability to get the result of its action. Let's rewrite this code using the ternary operator in Java.

Listing SUB-6: Eliminating mutability using the ternary operator

The ternary operator is an expression and not a statement. It does its part and returns a result to the caller. We did not mutate any variables in this version. The main point here is not a blanket recommendation to use ternary opera-tors instead of if statements, but a call to think about the nature of these constructs. For example, unlike Java, the if construct in languages like Scala, Groovy, and Ruby are not statements and can be used as expressions.

final String canIVote = age > 17 ? "Yes, please vote" : "Not yet!"; System.out.println(canIVote);

List<String> names = Arrays.asList("Jake", "Raju", "Kim", "Kara", "Paul", "Brad", "Mike");

System.out.println("Found kim?:" + names.contains("Kim"));

System.out.println("Found a 3 letter name?:" + names.stream().anyMatch(name -> name.length() == 3));

boolean a3LetterNameFound = false; for(String name : names) { if(name.length() == 3) { a3LetterNameFound = true; break; } } System.out.println("Found a 3 letter name?:" + a3LetterNameFound);

Page 22: Developer3 2013

42 43

Recursions are quite an effective technique to remove mutability, however, we fear using them due to the possi-bility of stack overflow if the recursion becomes too deep. This can be eliminated using tail-call optimization, a tech-nique using which the recursion can quietly be converted into a iteration under the hood. This technique is discussed in a classic book "Structure and Interpretation of Com-puter Programs" by Harold Abelson, Gerald Sussman, and Julie Sussman. Languages like Scala support tail-call optimization through compilation techniques and Groovy through library support. Java does not natively support tail-call optimization at this time, however, it can be done by applying lazy collections and lambda expressions. For details refer to the "Functional Programs in Java" book in the reference section.

SUMMARYMinimizing mutability is a better way to program overall. It reduces errors in code, makes it easier to understand and maintain code. Code with fewer mutability is also easier to make concurrent and to refactor. As much as possible we should strive to minimize mutability in code, by using more expressions than statements. Further more, by using library functions and recursion, we can minimize mutability even further, even in languages like Java where mutability has unpleasantly become a common place.

REFERENCESJava Concurrency in Practice, Brian Goetz, Addison-Wes-ley, Reading, MA, 2006.

Programming Concurrency on the JVM: Mastering Syn-chronization, STM, and Actors, Venkat Subramaniam, The Pragmatic Bookshelf, Raleigh, NC and Dallas, TX, 2011.

Structure and Interpretation of Computer Programming by Harold Abelson, Gerald Sussman, and Julie Sussman, The MIT Press, Cambridge, MA, 2nd edition, 1996.

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions, Venkat Subramaniam, The Pragmatic Bookshelf, Raleigh, NC and Dallas, TX, 2014 (available in Beta at http://pragprog.com/titles/vsjava8).

USE RECURSIONThere is at least one other way we can remove mutability, by using recursion. If we're not able to easily reach for a library function, then we could try to restructure the code to make use of recursion. Let's take an example to explore this approach further.

Here's imperative code for a guessing game, it asks the user to guess a selected number, guides them along, and finally reports the win, announcing the number of tries.

We have two mutable variables here, attempts and guess, and the code is the all too familiar imperative style. We can eliminate both the mutable variables by using recursion. Here's how:

In this version we moved the attempts variable as a final parameter to the play function and the guess variable as a final local variable. By using recursion we managed to remove the mutability from our code.

Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and Instructional Professor of Computer Science at the University of Houston.

He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences. Venkat helps his clients effectively apply and succeed with agile practices on their software projects.

Venkat is a (co)author of multiple books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer. His latest book is Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions.

You can reach him by email at [email protected] or on twitter at @venkat_s

int target = (int) (Math.random() * 100); System.out.println("I've selected a number, can you guess?"); int attempts = 0; int guess = -1; while(guess != target) { attempts++; System.out.print("Enter your guess:"); guess = new Scanner(System.in).nextInt(); if(guess < target) System.out.println("Aim higher"); if(guess > target) System.out.println("Aim lower"); if(guess == target) { System.out.printf("You got it in %d attempts\n", attempts); } }

public class Guesser { final static int target = (int) (Math.random() * 100); public static void play(final int attempts) { System.out.print("Enter your guess:"); final int guess = new Scanner(System.in).nextInt(); if(guess < target) System.out.println("Aim higher"); if(guess > target) System.out.println("Aim lower"); if(guess == target) System.out.printf("You got it in %d attempts\n", attempts); else play(attempts + 1); } public static void main(String[] args) { System.out.println("I've selected a number, can you guess?"); play(1); } }

Page 23: Developer3 2013

44 45

Akka is the name of a mountain in Laponia,

in the northern part of Sweden.

© S

hutt

erst

ock

MESSAGES OVER METHOD CALLSJava-objects usually communicate by calling methods on each other. This happens synchronously on the same thread using the call-stack of the JVM. So objects are pushed to the stack while waiting for methods they have called to be executed on the same thread as themselves. Various mechanisms can be used to make this interaction asynchronous instead – for example using executors and making objects Callable. To avoid several threads from changing the same data you often need to add locks or other forms of synchronization complicating the code – as you never know how many threads might be calling the same method on the same object simultaneously.

Typical Java lock example:

Akka is based on the Actor model2 . Actors communicate by passing messages to each other. This is asynchronous

by default and a dispatcher with an underlying thread-pool makes sure all messages are received and processed. Each Actor has a mailbox for receiving messages and is only allowed to process one message at a time. Therefore no locking or synchronization is needed, as there will only ever be one thread executing your Actor. A special ask-pattern can be used if you want to wait for a reply.

Examples of sending messages in Akka:

Akka supports remote messages and clustering without changing the syntax for sending and receiving messages. Akka has error handling based on supervision. If one Actor fails its supervisor can decide what action to take (retry, restart, stop, continue, etc.). This article does of course not have room to cover all aspects of Akka – I recommend reading the excellent documentation3 to get an overview.

Akka is a JVM-toolkit and runtime for building concurrent and distributed appli-cations. It is based on ideas from the Erlang programming language and written in Scala – and is part of the Typesafe Platform1. Akka is often mentioned as a framework used on projects written in Scala. However, it can also be used with Java code to greatly simplify concurrent tasks. This article explains how Akka works and shows one example of how it can be used to create a distributed master/worker system in a regular Java project.

AKKA Distributed Concurrency in JavaBy Eivind Barstad Waaler

Page 24: Developer3 2013

46

EXAMPLE – DISTRIBUTED COMPETING WORKERSLet's dive straight into a more complex real life example of how Akka can be used. This example is a modified version of a concept described in the post “Balancing Workload Across Nodes with Akka 2” on the Akka team blog (http://letitcrash.com)4. In the example we have a set of workers “competing” for work. We want the workers to pull work from some shared resource – database or similar. It is important to make sure that every piece of work is only handled once. We can have many workers within the same JVM, but also want the possibility to create new nodes/JVMs with more workers to be able to scale up for more work.

This is implemented with a single master (cluster singleton pattern5) that is responsible for handing out work to work-ers who request it. The flow is given as follows:

1. Master checks if there is any new/available work (scheduled job or similar) and publishes a cluster-wide WORK_AVAILABLE message.

2. All workers that subscribe to the worker channel receive the message – but only the ones that are not currently working respond to the master with a GIVE_ME_WORK message.

3. The master will hand out work to the first workers that respond – thus implementing the competing consumers pattern6. It also places a watch on the worker to be noti- fied of any failure to the worker.

4. One of the following will happen: a. When a worker is done it will send a WORK_DONE message back to the master who removes the watch from the worker. b. If an active worker fails (for example if the node it resides on dies) the master will receive a TERMINATED message so that it can clean up and hand the work over to a new worker.

Message handling for the master:

Message handling for the worker:

In the example work is just randomly generated – and the workers only sleep for a while. But it has been tested with the master fetching work from a database and the workers actually performing it. The beauty of this is that the master does not need to have an overview of all workers – it just publishes a message to anyone who might be interested. At the same time we have multiple workers competing to perform the work – and we can just start more nodes if we need more work done. There is no need to synchronize database access as the master is a singleton processing only one message at a time. The work is performed in a future – making the worker responsive even when work-ing (for example report status or progress to some admin page or similar).

A full runnable example with source code and instructions can be downloaded from GitHub7.

AKKA IN YOUR TOOLBOXThis article was just meant to briefly show some capabili-ties of Akka. Akka contains much more functionality than what has been shown here. With the non-blocking asyn-

chronous defaults it can help you create highly concurrent JVM application that will be able to fully utilize modern multi-core processors, as well as more distributed high-level concurrency as shown in the example above. It has exceptionally strong error handling through its supervisor hierarchy that will help you build robust and fault-tolerant systems. Being a JVM toolkit it can easily be integrated with most databases, frame-works and others tools and languages.

Eivind Barstad Waaler is a consultant at Bekk Consulting in Oslo. He has 15 years of experience as a developer and architect in software projects and has a strong interest for programming languages and paradigms. The last couple of years Eivind has specialized in distributed systems and techniques for handling big data in a scalable way. He will be speaking about Akka at JavaZone 2013.

There are many different tools and techniques available to create concurrent applications on the JVM. Akka might not be the best choice for every project, but it is worth considering in most cases where you need to create a scal-able application of a certain size. Facing a future where more and more companies are looking for scalable ways to handle “big-data” and related buzzwords – I’ll be keeping Akka in my favorite toolbox.

REFERENCES1 http://typesafe.com/platform 2 http://en.wikipedia.org/wiki/Actor_model 3 http://doc.akka.io/docs/akka/snapshot/java.html 4 http://letitcrash.com/post/29044669086/balancing- workload-across-nodes-with-akka-2 5 http://doc.akka.io/docs/akka/snapshot/contrib/cluster- singleton.html 6 http://www.enterpriseintegrationpatterns.com/ CompetingConsumers.html 7 https://github.com/eivindw/akka-cluster-example

47

Java 8

Evolutionary Design and Architecture for Agile Development

Both courses with Dr Venkat Subramaniam.

For a complete course description, time and place,

visit www.programutvikling.no

Page 25: Developer3 2013

48

DESCRIPTIONDuring the ScrumMaster class, attendees will learn why such a seemingly simple process as Scrum can have such profound effects on an organization. Participants gain practical experience working with Scrum tools and activities such as the product backlog, sprint backlog, daily Scrum meetings, sprint plan-ning meeting, and burndown charts. Participants leave knowing how to apply Scrum to all sizes of projects,

from a single collocated team to a large, highly distributed team.

YOU WILL LEARN Practical, project–proven

practices The essentials of getting a

project off on the right foot How to write user stories for

the product backlog Why there is more to leading a

self–organizing team than buying pizza and getting out of the way

How to help both new and experienced teams be more successful

How to successfully scale Scrum to large, multi–continent projects with team sizes in the hundreds

Tips and tricks from the instructors ten–plus years of using Scrum in a wide variety of environments

COURSE DATEOslo: 17 Sep, 9 DecLondon: 24 Sep, 3 Dec

As you watch the product take shape, iteration after iteration, you can restructure the Product Backlog to incorporate your insights or respond to changes in business conditions. You can also identify and cancel unsuccessful projects early, often within the fi rst several months. The Certifi ed Scrum Product Owner; course equips you with what you need to achieve success with Scrum.

Intuitive and lightweight, the Scrum process delivers completed incre-ments of the product at rapid, regular intervals, usually from every two weeks to a month. Rather than the traditional system of turning a

project over to a project manager while you then wait and hope for the best, Scrum offers an effective alternative, made even more attrac-tive when considering the statistics of traditional product approaches in which over 50% of all projects fail and those that succeed deliver products in which 64% of the functionality is rarely or never used. Let us help you avoid becoming one of these statistics.

YOU WILL LEARN Practical, project–proven

practices How to write user stories for

the product backlog

Proven techniques for prioritizing the product backlog

How to predict the delivery date of a project (or the features that will be complete by a given date) using velocity

Tips for managing the key variables infl uencing project success

Tips and tricks from the instructors fi fteen years of using Scrum in a wide variety of environments

COURSE DATEOslo: 19 Sep, 11 Dec

This two day course—taught by author and popular Scrum and agile trainer Mike Cohn—not only provides the fundamental principles of Scrum, it also gives par-ticipants hands–on experience using Scrum, and closes with Certifi cation as a recog-nized ScrumMaster.

Certifi ed Scrum Product Owner Training teaches you, the product owner, how to use the product backlog as a tool for success.

Courses with MIKE COHN

CERTIFIED SCRUMMASTER - CSM – MIKE COHN

CERTIFIED SCRUM PRODUCT OWNER - CSPO – MIKE COHN

OSLO - www.programutvikling.no LONDON - www.developerfocus.com

COURSES for developers and leadersADVERTISEMENT

Page 26: Developer3 2013

50 51

Craig Larman

Jurgen Appelo

AGILE - MANAGEMENT

AGILE AND ITERATIVE DEVELOPMENT - A MANAGERS GUIDE Author and instructor: Craig LarmanThis practical, information-packed seminar summarizes the key research, ideas, and practices of iterative development, aimed at executive and project leadership. This is a high-impact guide for managers and students to agile and iterative development methods: what they are, how they work, how to implement them – and why you should. Whether you’re an IT executive, project manager, student of software engineering, or developer, Craig Larman will help you understand the promise of agile/iterative development, sell it throughout your organization – and transform the promise into reality.

AGILE MANAGEMENTAuthor and instructor: Jurgen Appelo Topics (Learning Objectives) This course is the first course day based on the book Management 3.0, which addresses the following three themes: You will learn about different agile methods, popular best practices, agile adoption strategies, and the role of the manager⁄team leader in agile organizations, second you will learn about creativity in the workplace, tips for intrinsic motivation, and how to form diverse and productive teams, and third you will learn when to manage and when to lead, and how to protect people and resources from any bad effects of self–organization.

AGILE ESTIMATING AND PLANNING Author and instructor: Mike CohnDespite the many worthless plans that weve all seen—which may make us want to skip planning altogether—this Agile Estimating and Planning Training will demonstrate that its possible to create accurate project plans useful for programming testing—and projecting forward from 6–9 months. Our Agile Estimating and Planning Training will teach you how to create practical, useful and reliable plans for your software development projects.

ACCELERATED AGILE: FROM MONTHS TO MINUTES Author and instructor: Dan NorthDuring this course you will learn unusual and counter–intuitive techniques for software delivery and understand the principles behind them. Using a mixture of discussion, instruction and exploration you will start to think differently about agile development, automation and team dynamics. By exploring several architecture and development strategies you will learn how you and your teams can produce and deploy software faster than they thought possible. You’ll never look at TDD the same way again, not to mention copying–and–pasting code.

AGILE FOUNDATIONS FOR BUSINESS ANALYSTS Author and instructor: Allan KellyThis course focuses on the role of requirements in driving generic Agile teams with reference to Scrum project management and XP technical practices. The Business Analyst’s role on an Agile team is described together with the additional tools, techniques and approaches available.

RETROSPECTIVE TECHNIQUES Author and instructor: Geoff Watts The 2–day Retrospective Techniques course will teach the 5 step structure for facilitating a retrospective as described by Esther Derby and Diana Larsen and will also cover a number of approaches to be used in each part of the process. As well as leaving with new techniques for their retrospective toolboxes, attendees will get the opportunity to practice putting together a retrospective agenda and running and⁄or experiencing many of the techniques they will learn about.

For a complete course overview visit www.programutvikling.no and www.developerfocus.com

Mike Cohn

Dan North

Allan Kelly

Geoff Watts

Herb Sutter

Gojko Adzic

EFFECTIVE CONCURRENCY

EFFECTIVE CONCURRENCY Author and instructor: Herb SutterThis course covers the fundamental tools that software developers need to write effective concurrent software for both single–core and multi–core⁄many–core machines. To use concurrency effectively, we must identify and solve four key challenges: 1. Leverage the ability to perform and manage work asynchronously. 2. Build applications that naturally run faster on new hardware having more and more cores. 3. Manage shared objects in memory effectively. 4. Engineer specifically for high performance

AGILE

APPLYING LEAN THINKING TO SOFTWARE DEVELOPMENT - INCLUDING AN INTRODUCTION TO THE KANBAN METHODAuthor and instructor: Allan KellyDemonstrate how Lean thinking can be applied to software development and equip students with practical tools for improving their development processes and environments. This workshop uses lecture material and exercises to teach Lean ideas and provide students with experience of applying Lean techniques. Those responsible for the development of software: Who should attend?: Project Managers, Team Leaders, Development Directors and Managers, Scrum Masters and Architects.

BDD - SPECIFICATION BY EXAMPLE Author and instructor: Gojko AdzicThis three day workshop teaches you how to apply emerging practices for managing requirements, specifications and tests in agile and lean processes to bridge the communication gap between stakeholders and implementation teams, build quality into software from the start, design, develop and deliver systems fit for purpose.

Allan Kelly

Our courses can be customized and tailored to meet your training needs and requirements. We think globally, and will deliver in-house training anywhere you want us to. In addition to our scheduled courses, we offer a number of courses on demand. Please contact us for more information at [email protected] or [email protected]

In-house training anywhere in the world

© S

hutt

erst

ock

Page 27: Developer3 2013

52 53

Lyssa Atkins Michael K. Spayd

BDD - SPECIFICATION BY EXAMPLE Author and instructor: Gojko AdzicThis three day workshop teaches you how to apply emerging practices for managing requirements, specifi cations and tests in agile and lean processes to bridge the communication gap between stakeholders and implementation teams, build quality into software from the start, design, develop and deliver systems fi t for purpose.

TEST-DRIVEN DEVELOPMENT Author and instructor: Venkat SubramaniamThe course has a good balance of interactive lectures and hands–on exercises. The attendees are expected to pair–up and work on the lab exercises. The instructor will assist the attendees as they work on the exercises. The objective of the course is for the attendees to gain an in depth practical knowledge of the concepts so they can put them to immediate use on real projects.

TEST-DRIVEN DEVELOPMENT & REFACTORING TECHNIQUES COURSEAuthor and instructor: Robert C. Martin This course teaches you how to use the principles and practices of TDD to specify requirements and designs using acceptance tests and unit tests. You will learn the intensely granular TDD approach to development using XUnit for unit testing and FitNesse for acceptance testing. You will experience the frequent and regular feedback and progress of letting tests drive the development and design.

TEST – DRIVEN JAVASCRIPTAuthor and instructor: Christian JohansenEven the most seasoned backend programmer is too often on thin ice once a web application’s frontend is in need of development and/or maintenance. Rid yourself of the insecurity by learning to understand and appreciate JavaScript for the highly productive and unusual language it is. The course will take you through JavaScript’s object model and functional elements, giving you a solid understanding of how JavaScript really works. A series of practical assignments puts this understanding to use by implementing reusable code using idiomatic JavaScript patterns. Unit testing and TDD will be demonstrated through-out the course.

Gojko Adzic

TEST-DRIVEN DEVELOPMENT, TESTING

THE WHOLE TEAM APPROACH TO AGILE TESTINGInstructor: Janet GregoryThis three day course explains how testers can become valued agile team members, how they contribute to delivering a continuous stream of business value, and ways to overcome common cultural and logistical obstacles in transitioning to an agile development process. It describes the values and principles that help testers adopt an agile testing mindset, and gives practical alternatives to traditional testing processes, such as defect tracking, metrics, audits, and conforming to quality models. Students will be shown how to complete testing activities in short iterations, and how testers contribute on a daily basis during each iteration and release cycle.

Janet Gregory

Venkat Subramaniam

SCRUM

AGILE DEVELOPMENT WITH SCRUMAuthor and instructor: Arne LaugstølThis course will give an introduction to development in Scrum and agile development. The Participants will learn how to practice Scrum by collaborating as part of a Scrum-team during the labs. The course is aimed at people that is either going to participate in Scrum-teams, or just wants to know more of the concepts of Scrum and agile-development. You don’t need to be a developer to gain a full benefi t from the course.

CERTIFIED SCRUMMASTER CSMAuthor and instructor: Mike CohnDuring the ScrumMaster class, attendees will learn why such a seemingly simple process as Scrum can have such profound effects on an organization. Participants gain practical experience working with Scrum tools and activi-ties such as the product backlog, sprint backlog, daily Scrum meetings and sprint planning meeting. Participants leave knowing how to apply Scrum to all sizes of projects. The course gives you the title of Certifi ed ScrumMaster.

CERTIFIED SCRUMMASTER CSMAuthor and instructor: Geoff WattsLearn the Scrum framework for an agile project and the essentials of working as a ScrumMaster or Scrum team member. Through a fun mix of theoretical explanation, problem exploration and practical exercises, this 2–day course will equip attendees for their fi rst Scrum project or enable them to refl ect on their projects and become more agile.

CERTIFIED SCRUM PRODUCT OWNER CSPOAuthor and instructor: Mike CohnThis course will teach you, the product owner, how to use the product backlog as a tool for success. As you watch the product take shape, iteration after iteration, you can restructure the Product Backlog to incorporate your insights or respond to changes in business conditions. You can also identify and cancel unsuccessful projects early, often within the fi rst several months. The Certifi ed Scrum Product Owner; course equips you with what you need to achieve success with Scrum.

CERTIFIED SCRUM PRODUCT OWNER CSPOAuthor and instructor: Geoff WattsDuring this course you will understand the product owner role with its authority and responsibility, and its interaction with the other Scrum roles. You will be able to create a product vision, stock and groom the product backlog, prioritise the backlog, and systematically refi ne requirements. You will also be able to create a realistic release and track the project progress and understand how you can effectively collaborate with the ScrumMaster and team in the sprint meetings.

EFFECTIVE USER STORIES FOR AGILE REQUIREMENTS Author and instructor: Mike CohnThis course provides you with the knowledge and tools needed to identify and write effective and helpful user stories. Youll learn the six attributes all good stories must exhibit and thirteen guidelines for writing a better user story. The class explores how user role modeling can help when gathering a projects initial stories. During this hands–on course, all participants will have the opportunity to practice identifying user roles and writing stories on a case study

COACHING AGILE TEAMS COURSEAuthor and instructor: Lyssa Atkins and Michael K. SpaydCoaching Agile Teams is a training experience that covers both the being and the doing of agile coaching. There’s a lot to learn, experience and practice! At the end of the course, you will be capable of applying many new tools and techniques, as well as your own mindset changes, to coach agile teams to high performance. As practical as it is provocative, the Coaching Agile Teams course challenges agile coaches to rise to the fullest expression of their role and offer simple, practical ways to get there.

Arne Laugstøl

Mike Cohn

Mike Cohn

Geoff Watts

Geoff Watts

Mike Cohn

Robert C. Martin

Christian Johansen

Test yourself!Take your certifi cation at Programutvikling AS. See programutvikling.no for more information, or call us at 67 10 65 65

Page 28: Developer3 2013

54 55

JAVA

CORE SPRING FRAMEWORKAuthor: Mårten Haglind Instructors: Mårten Haglind and Kaare NilsenIn this four–day bootcamp you learn how to use the Spring Framework to create well–designed, testable business applications in an agile manner. Students build a Spring–powered JEE application that demonstrates the Spring Framework and other Spring technologies in an intensely productive, hands–on setting.

SPRING AND HIBERNATE DEVELOPMENTAuthor: Mårten Haglind Instructors: Mårten Haglind and Kaare NilsenIn this five–day course you will learn how to use the Spring Framework to create well–designed, testable business applications in an agile manner. In addition to that, you will learn how to use Hibernate, to effectively map Java domain model objects to a relation database.

PROGRAMMING JAVA STANDARD EDITION Authors and Instructors: Peet DennyThis course is designed to give programmers a solid grounding in the Java Programming language. Starting with the core syntax and OO concepts, it then progresses to covering class design, arrays and collections, core libraries, exception handling, I⁄O and networking, JUnit testing an introduction to Swing as well as the new Java features (the course is always up to date with the latest versions of Java SE). After taking this course delegates should be comfortable with working from a design on real projects using core Java, will be able to attend more advanced Java courses such as JEE and have a firm grasp of the fundaments required for the SCJP exam.

EFFECTIVE SCALAAuthor and instructor: Jon-Anders TeigenYou will learn how to model rich object–oriented systems using Scala’s integration of concepts from object–oriented and functional programming. We will explore how these two paradigms complement each other to bring you the best of both worlds. During these three days you will go from learning how to explore APIs using Scala’s interpreter to building full blown applications using the Lift web framework.

EFFECTIVE JPAAuthors and instructors: Mårten HaglindThe course gives the attendees a comprehensive kickstart into applying JPA and Hibernate for effective Java persistence. Insights will be provided into O⁄R–Mapping techniques and semantics as well as the programming model and paradigm to enable enterprise developers to instantly and productively apply the technologies involved in a real world setting. Common pitfalls as well as best practices, designs and idioms are discussed.

Jon-Anders Teigen

Mårten Haglind

Peet Denny

Kaare Nilsen

Kaare Nilsen

Mårten Haglind

Mårten Haglind

Espen Evje

XML

EXCHANGING AND MANAGING DATA USING XML AND XSLTAuthor and instructor: Espen EvjeThis course gives a broad overview of XML, in particular of the structure and the syntax of XML documents, and of how to use XML documents in your solutions. You will learn about XML Schemas and about XPATH, and you will get an insight on how to use XML with relational databases.

DATABASE

DATABASE DESIGN, -IMPLEMENTATION AND SQL-PROGRAMMINGAuthor and instructor: Dag Hoftun KnutsenThis course covers all phases of developing a database application: Analysis, design, implementation, SQL-programming and testing. Hands-on exercises will give you practical experience. There is particular focus on how physical database design is important from a performance perspective.

ORACLE SQL- PROGRAMMINGAuthor and instructor: Dag Hoftun KnutsenThis course is a comprehensive introduction to SQL, including coverage of Oracle-specific features. The course includes all aspects of SQL: Data Definition, Data Control and Data Manipulation with particular focus on querying. It also covers principles of database design for performance. Hands-on exercises provide practical experience with SQL, and you will also learn about common errors and pitfalls and how to avoid these.

ORACLE PL/SQL- PROGRAMMINGAuthor and instructor: Dag Hoftun KnutsenThis course provides a comprehensive introduction to Oracle’s procedural language PL/SQL. The course describes the language’s general structure and syntax as well as various ways of applying the language in an application. Programming experience is gained through hands-on exercises.

Dag Hoftun Knutsen

Dag Hoftun Knutsen

Dag Hoftun Knutsen

Wei-Meng Le

Wei-Meng Le

Wei-Meng Le

MOBILE APPLICATIONS

ANDROID DEVELOPER TRAININGAuthor and instructor: Wei-Meng LeeAndroid is Google’s operating system for mobile devices. Using the Android SDK, developers can develop applications on the Android platform using the Java Programming language. In this 5-day course, participants will learn the various techniques to program their Android devices. The first half of this feature-packed course will show you how to get started in Android development, right from the start till deployment. In the second-half of this course, you will explore Android beyond the basics. You will learn about the latest Android designed for tablet devices, and explore the new APIs that allow you to build both smartphone and tablet applications. In addition, you will also learn about networking technologies in Android – Bluetooth, Sockets, as well as push notifications using the Google Cloud Messaging (GCM) Framework.

FUNDAMENTALS OF IOSAuthor and instructor: Wei-Meng Lee The workshop will begin with the basic concepts such as Views, View Controllers, Protocols and Delegates, as well as the tools that help you develop compelling iOS applications – Xcode and Interface Builder. Participants will then dive into the details of programming the iPhone, such as how to invoke the built–in applications and access the hardware of the iOS device. In the second half of this course particpants will learn the advanced techniques for writing iOS applications. You will learn about iPad–specific programming, Location–based Services and network programming.

MOB101 – 3-DAY WRITING CROSS PLATFORM IOS AND ANDROID APPS USING XAMARIN AND C#Author and instructor: Wei-Meng Lee In this 3-day workshop, you will learn the fundamentals of building cross-platform mobile apps targeting iOS and Android devices using Xamarin and C#. Using the Xamarin Studio, you can now write iOS and Android apps using your familiar C# language. When you are ready to deploy your apps, the Xamarin compiler will compile your app into the native binary for each platform. The end result is you have a first class application that is optimized for the respective platform that it is compiled for.

For a complete course overview visit www.programutvikling.no and www.developerfocus.com

NEW

NEW

NEW

Page 29: Developer3 2013

56 57

Kristian Nordal

V. Subramaniam

Robert C. Martin

Eivind Nordby

DESIGN - ANALYSIS- ARCHITECTURES continued

CLEAN CODE: AGILE SOFTWARE CRAFTSMANSHIPAuthor and instructor: Robert C. MartinThis is a two–day hands–on course in which students learn the principles and practices of Clean Code as described in Robert C. Martin’s book: Clean Code: A Handbook of Agile Software Craftsmanship. This course alternates between lecture and exercise so that students can experience, first–hand, the practices and discipli-nes of these fundamental topics.

OBJECT-ORIENTED DEVELOPMENTAuthor and instructor: Eivind NordbyThis is a course for experienced developers who are new to, or wish to strengthen their object-orientedthinking. More than the programming itself, the difficulty in passing to object-orientation is mental. That is whythis course focuses on basic object-oriented thinking and basic design principles. Of course, there are plenty ofpractical exercises.

Craig Larman

Eivind Nordby

Robert C. Martin

Kevlin Henney

Juval Lowy

DESIGN - ANALYSIS- ARCHITECTURES

AGILE DESIGN AND MODELING FOR ADVANCED OBJECT DESIGN WITH PATTERNSAuthor and instructor: Craig LarmanDuring this popular, high–impact, and hands–on course you will learn to design with patterns, apply visual modelling in an agile modelling approach, and a suite of related advanced design topics, including the design of packages. This course is based on acclaimed industry leader Craig Larman’s extensive experience coaching and applying OOD since the mid 1980s.

ANALYSIS AND DESIGN WITH SCRUMAuthor and instructor: Eivind NordbyThe course targets developers who need to catch the users’ needs and transform them into distinct development tasks and into a solution capable of adapting to continuous requirements changes. The workflow is Scrum based, and UML is used for analysis and design ahead of programming in each sprint. Bundled with object-orientation, this gives a powerful, practical, developer oriented approach to problem solving.

ARCHITECTURE SKILLS Author and instructor: Kevlin HenneyThe Architecture Skills course introduces a broad curriculum for software architects. The course introduces development process models, architectural styles, requirements techniques, sufficient modelling techniques, design patterns and testing practices. This course includes a number of practical exercises so that attendees can see how the different activities fit together. There is also plenty of opportunity for discussion.

AGILE ARCHITECTURE AND DESIGNAuthor and instructor: Robert C. MartinThis course is a deep dive into the well–known SOLID principles of Agile and Object Oriented Design. Students will learn the characteristics of sound Object–Oriented designs and architecture, and patterns and practices that create them. Principles include: The Single Responsibility Principle, The Open Closed Principle, The Liskov Substitution Principle, The Interface Segregation Principle, The Dependency Inversion Principle, and many others. Special attention is paid to Component oriented design, and the principles and patterns of large–scalecomponent architecture.

THE ARCHITECT’S MASTER CLASSAuthor and instructor: Juval LowyThe class agenda reflects these three elements: development process and project leadership skills, technology, and finally analysis and design. Students will see how to approach rarely discussed topics such as allocation of services to assemblies, allocation of services to processes, transaction boundaries, identity management, authorization and authentication boundaries and more.

DOMAIN-DRIVEN DESIGN (DDD) HANDS-ON IMMERSION Author: Eric Evans Instructor: Kristian NordalThis course is written by Eric Evans and conducted by Kristian Nordal from Arktekk, which is certified by Eric Evans. The course will be held in norwegian. This intensive course will aid participants in striking a healthy balance between digging into their subject matter and addressing technological issues, which, while unavoidable, cannot be allowed to dominate the development process for commercially viable systems. We weave together lecture, discussion and classroom exercises, including hands–on coding projects. In discussions, attendees have the oportunity to discuss their own experiences and relate their own work to the principles and techniques presented in the class.

EVOLUTIONARY DESIGN AND ARCHITECTURE FOR AGILE DEVELOPMENTAuthor and instructor: Dr. Venkat SubramaniamThe course has a good balance of interactive lectures and hands-on exercises. The attendees are expected to pair-up and work on the lab exercises. The instructor will assist the attendees as they work on the exercises. The objective of the course is for the attendees to gain an in depth practical knowledge of the concepts so they can put them to immediate use on real projects.

HTML5 – JAVASCRIPT

JAVASCRIPT FOR PROGRAMMERS Author and instructor: Christian JohansenThis three day workshop will introduce you to HTML5 with a brief backstory, before diving into the APIs one by one. As well as going through code and showing practical demonstrations, where possible, we’ll also talk about the alternatives and polyfills for old browsers that dont support ”awesome” out of the box.

TEST – DRIVEN JAVASCRIPTAuthor and instructor: Christian JohansenEven the most seasoned backend programmer is too often on thin ice once a web application’s frontend is in need of development and/or maintenance. Rid yourself of the insecurity by learning to understand and appreciate JavaScript for the highly productive and unusual language it is. The course will take you through JavaScript’s object model and functional elements, giving you a solid understanding of how JavaScript really works. A series of practical assignments puts this understanding to use by implementing reusable code using idiomatic JavaScript patterns. Unit testing and TDD will be demonstrated through-out the course.

WRITING AMBITIOUS WEBAPPS WITH EMBER.JSAuthor and instructor: Joachim Haagen SkeieThis course is well suited for programmers that have felt the pain of either messy client–side code, or the pains that come with the server–side MVC model. You want to learn how to build scalable, testable and cleanweb applications that you can come back to and understand in 6 months, and you are willing to accept and overcome the learning curve to get there!

GIT & GITHUB FOUNDATIONS Authors and instructors: Tim Berglund & Matthew McCulloughOur Foundations class helps you, as a newcomer to Git and GitHub, fully grasp the concepts and application of distributed version control so that you can effectively begin using this productivity-enhancing suite of tools. During this live training course, we’ll explore the foundations of Git and GitHub through practical every-day commands and processes. We’ll conclude with workflow ideas and practical tips that will get you on the road to mastery of this revolutionary version control system.

JAVASCRIPT AND HTML5 FOR DEVELOPERS Author and instructor: Christian WenzJavaScript has shown an impressive comeback over the past few years. The static, non-functional websites of the past have been replaced by smart web browsers which offer a runtime environment for actual applications. This course intends to bring you up to speed with today’s efficient and effective JavaScript.

J. Haagen Skeie

Tim Berglund M. McCullough

Christian Johansen

Christian Johansen

Christian Wenz

Page 30: Developer3 2013

58 59

SHAREPOINT

SHAREPOINT 2010 AND OFFICE 365: END TO END FOR DEVELOPERS AND DESIGNERSAuthor and instructor: Sahil MalikThis 5 day course is packed with information that will load you with enough skills to work productively on any SharePoint project. It covers development aspects or UI design concepts in depth. This course is designed for technical audience or the architect who needs to learn all aspects of the product, for the developer, designer, and the administrator.

SHAREPOINT 2013 AND OFFICE 365: END TO END FOR TECHNICAL AUDIENCE Author and instructor: Sahil MalikThis 5 day course is packed with information that will load you with enough skills to work productivelyon any SharePoint project. It covers development aspects or UI design concepts in depth. This course is designed for technical audience or the architect who needs to learn all aspects of the product, for the developer, designer, and the administrator. The course has been written, and is delivered by Sahil Malik. You can expect plenty of real world insight that you don’t get in “canned courses”.

SHAREPOINT 2013 AND OFFICE 365: ONLY THE NEW STUFF Author and instructor: Sahil MalikThis 3 day course is packed with targeted information that will bring your skills up to date on SharePoint 2013. Thiscourse is designed for technical audience or the architect who is already familiar with SharePoint 2010 and isinterested in getting targeted information, or the delta between SharePoint 2013 and Share-Point 2010. The coursehas been written, and is delivered by Sahil Malik. You can expect plenty of real world insight that you don’t get in“canned courses”.

Sahil Malik

Sahil Malik

Sahil Malik

C++

C++ FOR EMBEDDED DEVELOPERSAuthor and instructor: Mike TarltonThis course introduces the C++ language for general use. The course is suitable for programmers who do not need to have in–depth knowledge of embedded programming concepts or concurrency issues. The course is also useful for Hardware Engineers needing to learn C++, for example to move onto using SystemC. It is assumed delegates have a working knowledge of the C programming language.

ADVANCED C++ PROGRAMMINGAuthor and instructor: Hubert MatthewsThis course is designed to introduce delegates to more advanced use of C++. It will cover techniques and idioms that allow for more effi cient and safer use of the language as well as the concepts that make C++ different from other languages. Modern C++ techniques and facilities such as the STL are used throughout to introduce developers to the full power of the C++ language.

C++11 PROGRAMMING Author and instructor: Hubert MatthewsThis course is designed to upgrade delegates to C++11, the new C++ standard. C++11 is designed to make programming in C++ easier and more effi cient for both the developer and the machine. It will cover all of the major features along with idioms for using them effectively, giving you access to the full power of the new language and libraries.

EFFECTIVE C++11 PROGRAMMING Author and instructor:: Scott MeyersSoftware developers familiar with the fundamentals of C++11 are ready to advance from knowing what's in C++11 to understanding how to apply it effectively. This seminar, based on information in Scott Meyers' forthcoming Effective C++11, highlights the insights and best practices of the most accomplished C++11 programmers: the things they almost always do (or almost always avoid doing) to produce clear, correct, effi cient code.

C

DEEP C: A COURSE FOR EXPERIENCED C AND C++ DEVELOPERSAuthor and instructor: Olve MaudalProgramming is hard. Programming correct C is particularly hard. Indeed, even in serious industrial applications it is uncommon to see only correct, well defi ned and conforming code. Why do professional programmers write code like this? Because they lack a deep understanding, they don’t know the history and spirit of this wonderful programming language. C is not really a high level language, it is more like a portable assembler where you always need to consider the underlying hardware.

Mike Tarlton

Olve Maudal

Hubert Matthews

Hubert Matthews

Scott Meyers

PROGRAMMING

INTRODUCTION TO PYTHON PROGRAMMINGAuthors and instructors: Peet DennyThis Python course is an intensive introduction to Python Programming. The objective is to enable students to understand how Python can be used to solve real-world problems through realistic and useful course exercises.

Peet Denny

MICROSOFT

ZERO TO MICROSOFT BUSINESS INTELLIGENCE Author and instructor: Peter MyersThis fi ve day intensive instructor–led training course has been designed to enable students to commence developing and maintaining state–of–the–art integrated Business Intelligence (BI) solutions developed by using Microsoft products. The course consists of numerous hands–on labs that will provide students with the opportu-nity to produce an end–to–end BI solution.

DEVELOPING WINDOWS AZURE AND WEB SERVICES Author and instructor: Magnus MårtenssonAbout this CourseIn this course, students will learn how to design and develop services that access local and remote data from various data sources. Students will also learn how to develop and deploy services to hybrid environments, including on-premises servers and Windows Azure. This course helps people prepare for exam 70-487

Peter Myers

M. Mårtensson

NEW

For a complete course overview, price update, time and place, visit www.programutvikling.no and www.developerfocus.com

Registration Oslo: Tel 67 10 65 65 • [email protected] • www.programutvikling.no

Registration London: Tel +44 0843 523 5765 • [email protected] • wwww.developerfocus.com

Page 31: Developer3 2013

60 61

Arne Laugstøl

MICROSOFT continued

WEB DEVELOPMENT IN .NET - ASP.NET MVC , HTML5, CSS3, JAVASCRIPT Author and instructor: Scott Allen/Arjan EinbuThis course covers everything you need to know to start building applications with the latest Microsoft web development stack. We will use ASP.NET MVC on the server and see how to work with models, views, and controllers. On the client we’ll take advantage of HTML 5, CSS 3, and the best JavaScript frameworks, including jQuery, Modernizr, and more. During the course we’ll also see how to apply test driven development techniques, cover best practices for security, scalability, and maintainability, and see various tips and tricks for building a compelling user experience. Over 150 pages of hands–on lab material included.

70-511 WINDOWS PRESENTATION FOUNDATION - WPF/XAMLAuthor and instructor: Arne LaugstølWindows Presentation Foundation (WPF) is a .NET technology that makes it possible to create compelling applications with modern user experience. The course covers both the basic things and the advanced stuff you need to know, to be able to give the user a “wow” effect. This course will make you able to take the Exam in 70-511 Windows Application Development with Microsoft .NET Framework 4.

70-583 - MICROSOFT AZURE Author and instructor: Sahil MalikThis course is aimed towards the .NET developer who wishes to further their knowledge about Microsoft’s cloud offering – Azure. There are many parts to Azure, Windows Azure (Compute, Storage, Virtual Machine), SQL Azure, AppFabric and DataMarket. This course methodically looks at each piece and shows you practical usage of what you can use today.

CREATING WINDOWS 8 METRO APPS USING C# AND XAML Author and instructor: Gill CleerenIn this 3 day training course, attendees will learn how to build Windows 8 Metro style applications that offer a great user experience and interact with Windows. Developers will learn how to use the power of the XAML language to build their application all the way from the very first idea of the application to the deployment in the Windows Store. Throughout the course, attendees will see the relation between Windows 8 and other XAML–based technologies such as Silverlight or WPF.

ARCHITECTURE CLINICAuthor and instructor: Shy CohenIt is a 5 day highly interactive event where you will learn, improve, and exercise software architecture skills, all based on the IDesign Method – a breakthrough, battle–proven approach to software architecture that has shown up to 80% reduction in the effort and time required for architecting, designing, and implementing software solutions. Through its application, it produces an easy–to–follow blueprint for the construction of a software system, while covering all the important aspects involved.

WINDOWS COMMUNICATION FOUNDATION (WCF) MASTER CLASSAuthor and instructor: Miguel CastroThe training starts by explaining the motivation for WCF, and then continues to discuss in depth how to develop service–oriented applications using WCF. You will see how to take advantage of built–in features such as service hosting, instance management, asynchronous calls, synchronization, reliability, transaction management, disconnected queued calls, security as well as emerging technologies like cloud computing and the Windows Azure AppFabric service bus.

ASP.NET WEB API & SIGNALR: LIGHTWEIGHT WEB-BASED ARCHITECTURES FOR YOU! Author and instructor: Christian WeierLet's face it! The current trends and developments especially in the area of mobile platforms & devices and cloud computing will cause a re-thinking in architectural aspects for many software projects and products. If you ignore this today you may be in big trouble tomorrow. How can I reach a plethora of users and client devices? How can I integrate my systems and application parts in a lightweight and interoperable manner? How am I able to push data in near-real-time fashion from my services to my clients? This course tries to answer these and more questions. Christian Weyer will show you in a pragmatic way how to face the new challenges. See all of this coming to life by using technologies and frameworks like ASP.NET Web API, SignalR, .NET- and HTML5/JavaS-cript-based clients - mobile or not.

Sahil Malik

Arjan Einbu

Gill Cleeren

Christian Wenz

NEW

MICROSOFT continued

C#.NET: UTVIKLING AV APPLIKASJONER I .NET MED C#Author and instructor: Arne Laugstøl. Instructor: Arjan EinbuIn this 5-day course you will learn how to develop applications in the .Net environment. The course will teach you the C# language and how to use the platform to make applications that will run on the desktop with WPF(Window Presentation Foundation) or in the browser with ASP.Net. How to communicate with WCF(Windows Communication Foundation), and accessing data with Linq or Entity Framework is part of the course.

DESIGNING USER EXPERIENCES: PRINCIPLES AND TECHNIQUES FOR DEVELOPERS, MANAGERS AND ANALYSTSAuthor and instructor: Billy HollisThis class is aimed at developers, but it includes design, architecture, and development topics. Technical topics are mostly covered earlier in the class, with design and architectural topics coming later. However, because the class stresses effective design and architecture, design and architecture topics are listed first. This course will also discuss changes to WPF and related technologies in future Microsoft products, as presented at the BUILD Windows conference that takes place before the class.

CLAIMS-BASED IDENTITY & ACCESS CONTROL FOR .NET 4.5 APPLICATIONS Author and instructor: Dominick BaierThis course introduces to the fundamental concepts of identity & access control in .NET 4.5 and covers the integration of these new technologies into the main application frameworks like ASP.NET, ASP.NET Web API and WCF. You will learn about patterns like single sign–on, federation, home realm discovery and identity delegation and how to implement them with .NET. You will learn how to implement authentication and authorization in web applications, SOAP services and HTTP⁄REST based services. You will learn about the SAML and JWT token types and the WS–Federation, WS–Trust and OAuth2 protocols.

MS 70-516 - REAL WORLD LINQ - DATA ACCESS, ENTITY FRAMEWORK AND BEYOND Author and instructor: Scott AllanLINQ not only changes how we build data access components with .NET, but also introduces new flexibility and expressiveness into the C# language. In this course we’ll see how LINQ works at a language level, and also how to use LINQ with XML and the Entity Framework. We’ll look at the tradeoffs to evaluate when building a data access layer with LINQ, talk about LINQ in the context of specific design patterns, and use LINQ features in a domain to implement better business logic. This course is a combination of lectures and hands–on labs.

70-513 - WCF 4.5 WITH VISUAL STUDIO 2012 Instructor: Sahil MalikThis course is aimed at .NET developers interested in developing deep architectural and developer level expertise in WCF 4. In addition, this course will teach you about Windows Server AppFabric and Windows Azure AppFabric. This course also explains good archtecture practises and enables you to take Exam 70–513.

ENTERPRISE DEVELOPMENT WITH NSERVICEBUS Author and instructor: Daniel MarbachThe course teaches you all the ins–and–outs of NServiceBus – the most popular, open–source service bus for .NET – now updated for NServiceBus 3.0. Used in production since 2006, NServiceBus is now used in hundreds of companies in finance, healthcare, retail, SaaS, web 2.0, and more. From basic one–way messaging, through publish⁄subscribe; providing solutions from transactions to cross–machine scale out; this hands–on course will show you how simple distributed systems development can be.

THE CLOUD ARCHITECT MASTER CLASSAuthor and instructor: Shy CohenThe cloud provides many great benefits, but how should one leverage all this goodness? What are the options, benefits, and caveats for using the different services in the cloud? How should teams organize to better develop software for the cloud? How does one architect cloud–scalable systems? This class answers these questions and more, as it goes through the architecture, design, and implementation of cloud components and solutions. In the class you will learn about the different elements of the cloud, cloud architecture and design patterns, how to create robust, scalable, and secure cloud solutions, possible changes to your business model, how to migrate to the cloud, the skills you need to succeed and the supporting processes, and even cost analysis.

Arjan EinbuArne Laugstøl

Billy Hollis

Sahil Malik

Daniel Marbach

Scott Allan

Shy Cohen

Shy Cohen

Miguel Castro

Dominick Baier

Page 32: Developer3 2013

62 63

SHAREPOINT Days Sep Oct Nov Dec Location Price

SharePoint 2010 and Offi ce 365: End to End for Developers and Designers - Sahil Malik 5 24900

SharePoint 2013 and Offi ce 365: End to End for Developers - Sahil Malik 5 09 25 IT Fornebu 24900

JAVA Days Sep Oct Nov Dec Location Price

Core Spring - Mårten Haglind 4 23 11 IT Fornebu 21900

Effective JPA - Industrial strength Java Persistence with JPA 2.0 and Hibernate 2 IT Fornebu 14900

Effective Scala - Jon-Anders Teigen 3 IT Fornebu 18900

Programming Java Standard Edition - Peet Denny 5 21 IT Fornebu 24900

Spring and Hibernate Development - Mårten Haglind 5 23 11 IT Fornebu 24900

HTML5 - JavaScript - CSS3 Days Sep Oct Nov Dec Location Price

JavaScript and HTML5 for Developers - Christian Wenz 3 04 IT Fornebu 18900

JavaScript for programmers - Christian Johansen 3 16 11 IT Fornebu 18900

Practical CSS3 - Chris Mills 2 IT Fornebu 14900

Test-Driven JavaScript with Christian Johansen 3 18 20 IT Fornebu 18900

Writing Ambitious Webapps with Ember.js - Joachim Haagen Skeie 3 25 IT Fornebu 18900

C++ Days Sep Oct Nov Dec Location Price

Advanced C++ programming - Hubert Matthews 4 30 Kongsberg 21900

C++ for Embedded Developers - Mike Tarlton 5 25 Ålesund 24900

C++11 programming - Hubert Matthews - IT-Fornebu 3 02 02 IT Fornebu 18900

C++11 programming - Hubert Matthews - Kongsberg 3 06 Kongsberg 18900

Programming in C++ with Mike Tarlton 4 25 Ålesund 21900

C Days Sep Oct Nov Dec Location Price

Deep C: Et kurs for erfarne C og C++ programmerere - Olve Maudal 2 04 Trondheim 14900

XML Days Sep Oct Nov Dec Location Price

Exchanging and Managing Data using XML and XSLT - Espen Evje 3 09 IT Fornebu 18900

DATABASE Days Sep Oct Nov Dec Location Price

Databasedesign, -implementering og SQL-programmering - Dag Hoftun Knutsen 4 22 IT Fornebu 21900

PROGRAMMING Days Sep Oct Nov Dec Location Price

Objektorientert utvikling - Eivind Nordby 4 03 03 IT Fornebu 21900

EFFECTIVE CONCURRENCY Days Sep Oct Nov Dec Location Price

Effective Concurrency - Herb Sutter (26th-28th March 2014) 3 London 17900

DEVOPS Days Sep Oct Nov Dec Location Price

DevOps - Alex Papadimoulis 3 IT Fornebu 17900

COURSE OVERVIEW OSLO

COURSETITLE

AGILE Days Sep Oct Nov Dec Location Price

Accelerated Agile: From months to minnutes 2 IT Fornebu 8900

Evolutionary Design and Architecture for Agile Development - Dr. Venkat Subramaniam 4 03 09 IT Fornebu 21900

Architecture Skills - Kevlin Henney 3 27 London 18900

Effective User Stories for Agile Requirements - Mike Cohn 1 02 London 7500

SCRUM Days Sep Oct Nov Dec Location Price

Certifi ed Scrum Product Owner - CSPO - Geoff Watts 2 17 IT Fornebu 14900

Certifi ed Scrum Product Owner - CSPO - Mike Cohn 2 19 11 Felix, Oslo 14900

Certifi ed ScrumMaster - CSM - Geoff Watts 2 14 IT Fornebu 14900

Certifi ed ScrumMaster - CSM - Mike Cohn 2 17 09 Felix, Oslo 14900

Smidig utvikling med Scrum - Arne Laugstøl 1 09 IT Fornebu 6500

TEST-DRIVEN DEVELOPMENT Days Sep Oct Nov Dec Location Price

Test-Driven Development & Refactoring Techniques - Robert C. Martin 3 09 IT Fornebu 18900

Test-Driven Development - Venkat Subramaniam 5 14 IT Fornebu 24900

Test-Driven JavaScript - Christian Johansen 3 18 20 IT Fornebu 18900

TESTING Days Sep Oct Nov Dec Location Price

Whole Team Approach to Agile Testing - Janet Gregory 3 04 IT Fornebu 18900

DESIGN - ANALYSIS - ARCHITECTURES Days Sep Oct Nov Dec Location Price

Evolutionary Design and Architecture for Agile Development - Dr. Venkat Subramaniam 4 IT Fornebu 21900

Evolutionary Design and Architecture for Agile Development - Dr. Venkat Subramaniam 4 28 Kongsberg 21900

Agile Desgin and Modeling for Advanced Object Design With Patterns - Dr. Venkat Subramaniam 4 09 IT Fornebu 21900

Architecture Skills - Kevlin Henney 3 27 London 18900

The Architect s̀ Master Class - Juval Lowy 5 London 24900

MOBILE APPLICATIONS Days Sep Oct Nov Dec Location Price

Android Developmer Training - Wei-Meng Lee 5 30 09 IT Fornebu 24900

MOB101 - 3-Day Writing Cross Platform iOS and Android Apps using Xamarin and C# - Wei-Meng Lee 3 04 IT Fornebu 18900

Fundamentals of iOS Programming - Wei-Meng Lee 3 07 IT Fornebu 18900

MICROSOFT Days Sep Oct Nov Dec Location Price

70-513 - WCF 4.5 with Visual Studio 2012 - Sahil Malik 5 02 IT Fornebu 24900

C#.NET: Utvikling av applikasjoner i .NET med C# - Arjan Einbu 5 07 09 IT Fornebu 24900

ASP.NET Web API & SignalR: Lightweight Web-Based Architectures for you! 2 30 IT Fornebu 14900

Claims-based Identity & Access Control for .NET 4.5 Applications - Dominick Baier 2 14 IT Fornebu 14900

Web Development in .NET - ASP.NET MVC, HTML5, WebAPI, and Single Page Applica-tions - Scott Allen 5 09 IT Fornebu 24900

Creating Windows 8 Apps using C# and XAML - Gill Cleeren 3 08 IT Fornebu 18900

Creating Windows 8 Apps using HTML5 and JavaScript - Christian Wenz 3 IT Fornebu 18900

Enterprise Development with NServiceBus - Daniel Marbach 4 29 IT Fornebu 21900

Web Development in .NET - ASP.NET MVC , HTML5, CSS3, JavaScript - Scott Allen/Arjan Einbu 5 14 16 IT Fornebu 24900

WPF/XAML - 70-511 / 10262A Windows Presentation Foundation/XAML - Arne Laugstøl 3 03 19 IT Fornebu 21900

Developing Windows Azure and Web Services - Magnus Mortenson 5 11 IT Fornebu 24900

Zero to Microsoft Business Intelligence - Peter Myers 5 IT Fornebu 24900

www.programutvikling.no

ProgramUtviklingThe offi ce and course rooms are located in the IT-Fornebu technology park approximately 10 minutes away from central Oslo. Address: Martin Lingesvei 17-25, 1367 Snarøya.

Tel.: +47 67 10 65 65 - Fax: +47 67 82 72 31

www.programutvikling.no - [email protected]

Page 33: Developer3 2013

64 65

DeveloperFocus LTD, London by ProgramUtvikling AS

www.developerfocus.com

JAVA Days Sep Oct Nov Dec Location Price

Advanced Java Programming with Martijn Verburg 1 £700

Java Virtual Machine (JVM) with Ben Evans 1 £700

Understanding Advanced Java & The Java Virtual Machine (JVM) with Ben Evans 3 £1495

Object-Oriented Programming in Java - John Denny 5 £1995

Introduction to Python Programming with John Denny 3

SHAREPOINT Days Sep Oct Nov Dec Location Price

SharePoint 2013 and Offi ce 365: End to End for Technical Audience - Sahil Malik 5 25 Holborn Bars £1995

USER EXPERIENCE & DESIGN Days Sep Oct Nov Dec Location Price

Designing User Experiences: Principles and Techniques for Developers, Managers, and Analysts - Billy Hollis 3 Holborn

Bars £1495

EFFECTIVE CONCURRENCY Days Sep Oct Nov Dec Location Price

Effective Concurrency - Herb Sutter (26th-28th March 2014) 3 Holborn Bars £1995

COURSE OVERVIEW LONDON

COURSETITLE

AGILE & SCRUM Days Sep Oct Nov Dec Location Price

Advanced Scrum Master Course - Geoff Watts & Paul Goddard 2 Holborn Bars £1195

Agile Foundations for Business Analysts with Allan Kelly 2 Farringdon £1195

Acceptance Test-Driven Development with David Evans 2 £1195

Agile Estimating and Planning Training - Mike Cohn 1 05 Canary Wharf £700

Architecture with Agility - Kevlin Henney 3 Holborn Bars £1195

Certifi ed Scrum Master - CSM - Geoff Watts 2 08 Holborn Bars £1195

Certifi ed Scrum Master - CSM - Mike Cohn 2 02 Holborn Bars £1400

Certifi ed Scrum Product Owner - CSPO - Geoff Watts 2 Holborn Bars £1195

Certifi ed Scrum Product Owner - CSPO - Mike Cohn 2 Holborn Bars £1400

Effective User Stories for Agile Requirements Training - Mike Cohn 1 04 Canary Wharf £700

Succeeding with Agile - Mike Cohn 2 26 Holborn Bars £1400

Working on a Scrum Team with Kenny Rubin 3 Holborn Bars £1400

Writing Effective User Stories Training with Kenny Rubin 2 Holborn Bars £1195

ARCHITECTURE - DESIGN - SECURITY - MASTERCLASSES Days Sep Oct Nov Dec Location Price

Advanced Windows Security Masterclass with Paula Januszkiewicz 3 Holborn Bars £1495

Architecture Clinic with Michael ‘Monty’ Montgomery 5 07 Holborn Bars £2500

The Architect s̀ Master Class with Juval Lowy 5 Holborn Bars £2500

Project Design Master Class with Juval Löwy 5 Holborn Bars £2500

The Cloud Architect Master Class with Shy Cohen 5 Holborn Bars £2500

Windows Communication Foundation (WCF) Master Class with Miguel Castro(Bør byttes til annet kurs,SignalR) 5 Holborn

Bars £2500

C++ Days Sep Oct Nov Dec Location Price

Advanced C++ Programming - Hubert Matthews 4 Holborn Bars £1795

MICROSOFT .NET Days Sep Oct Nov Dec Location Price

C #.NET: Developing applications in .NET with C# - Gill Cleeren 5 25 £1995

Creating Windows 8 Metro Apps using C# and XAML - Gill Cleeren 3 15 10 Holborn Bars £1495

Design Concepts, Architecture, and Advanced Capabilities for WPF - Billy Hollis 4 £1795

WCF - Windows Communication Foundation (WCF) 4 with Sahil Malik 5 £1995

ASP.NET Web API & SignalR - Lightweight web-based architectures for you! with Christian Weyer 2 13 Holborn

Bars £1195

MOBILE APPLICATIONS Days Sep Oct Nov Dec Location Price

Fundamentals of Android Programming with Wei-Meng Lee 5 Farringdon £1995

Fundamentals of iOSProgramming with Wei-Meng Lee 5 Farringdon £1995

COURSE LOCATION, LONDON

De Vere’s Holborn Bars is one of the UK’s leading conference centres in London. Step through the imposing doors of Holborn Bars and sense you’re entering somewhere rather special – an inspirational place to hold conferences, meetings, training and assessment centres.

Set in its bustling backdrop located near London, makes a lasting impression on guests and delegates while providing a comfortable and inspiring surrounding. You will be provided with cool water & mints in all rooms, freshly brewed tea & coffee with pastries & biscuits during your breaks and delicious lunches with a different menu prepared every day. In the lobby area there are PCs to catch up on some emails during breaks and free internet access is also available.

Arriving by Train and TubeThe property is located on the north side of Holborn, close to its junction with Gray’s Inn Road. It benefi ts from excellent public

transport links with Chancery Lane underground station, Farringdon station and City Thameslink station all in close proximity.

BusYou can get to Holborn Bars by bus from London Bridge mainline station. The 521 Bus route stops opposite just outside the Sainsbury’s headquarters and Holborn Bars is a little further ahead on the other side of the road. ADDRESSHolborn Bars. 138–142 Holborn, LondonEC1N 2NQ

Lucky Byatt,CEO,DeveloperFocus,London

ENROLMENT OPTIONSwww.developerfocus.com - [email protected].: 0843 523 5765

DeveloperFocus

© N

igel

Cox

/ Wik

iped

ia

© M

ark

S/ W

ikip

edia

Page 34: Developer3 2013

66 67

Vi tror at interesser og lidenskap er viktig – både på og utenfor jobb. Nysgjerrige mennesker oppnår rett og slett mer. I BEKK får du mulighet

til å utvikle deg videre, både som menneske og fagperson.

Sjekk ut ulike jobbmuligheter og hele vår faglige bredde på våre nettsider.

JOBB I BEKK ?

www.bekk.no

HOW TO FIND US PROGRAMUTVIKLING MAIN OFFICE, OSLO

ProgramUtvikling AS is located in the IT-Fornebu technology park at Snarøya.

ADDRESSMartin Lingesvei 17-25, 1367 Snarøya.

Our offices and course rooms are situated in the terminal building of the former Oslo airport. The photo shows the car park, bus stop and course rooms. For details of bus times, go to trafikanten.no

Entrance

Parking

Bus stop

FOLLOW US ON

twitter.com/progutvikling www.programutvikling.no/feed/news.aspx [email protected] facebook.com/programutvikling

ENROLMENT OPTIONSwww.programutvikling.no - [email protected] Tel.: +47 67 10 65 65 - Fax: +47 67 82 72 31

VISIONTo provide the world’s best courses for developers and managers.

BUSINESS CONCEPTTo offer developer courses in the field of IT that provide practical and useful expertise.

CLEAR STRATEGYWe have a transparent strategy that aims to provide courses for develop-ers and project managers - and that

alone. We do not attempt to sell products or consultancy services alongside.

COURSES OFFEREDWe hold advanced courses in, for example, C#, .NET, SQL, UML, XML, Java, Maven, TDD and Spring. In project management, we offer the most popular methodologies within agile development, including Scrum and Lean. Our unique combination of custom courses developed in-house

and standard courses means that we can help reduce the number of course days and costs for our customers.

A unique course provider!Within the space of just a few years, we have established ourselves as Norway’s leading provider of courses for IT developers and project managers. We are purely an independent course provider and we do not sell other products or services. Our ambition is to ensure that participants get the maximum out of their course, so they can make substantial practical use of the training in their daily work.

Our vision is to provide the world’s best courses for developers and managers

Page 35: Developer3 2013

Donation

SMSAPI

Survey

Posisjonering

Merge

SMS

Loyalty Club

LOVESMS

Positio

nin

g

Voting

Vo

ting

Mobile

marketing

MarketingPassword

RemindersWarnings

Ordering

Confirmation

SMS

BillingHLR

VerifyingQuest SMS Loyalty Club

Pass

wo

rd

Survey

HLR Contact

update

Rabekkgata 9, Moss - Norway

[email protected] l +47 69 20 69 20

For more information:

www.vianett.com We love SMS!

The fast way to integrate

SMSinto your software

Donation

Reminders

Survey

PositioningMerge

SMSPayment

Payment

Positio

nin

g

Voting

Vo

ting

Marketing

Password

Password

Booking

Ordering

Ordering

Confirmation

SMS

Billing

MMSHLR

VerifyingGet inspired

AskSign up now for a free developer account: www.vianett.com/developer

JavaHTTP

ASP

COM

SMPP

MSSQL

YAP

SMTPFTP

Web Services

C#

Meet us at:

Oslo Spektrum 11-12 Sept.

Returadresse: ProgramUtvikling AS. Postboks 1, 1330 Fornebu