Monday, December 19, 2011

Spring Roo 1.2.0 released - it's growing up...


On Saturday, 12/17/11, SpringSource/VMware released version 1.2.0 of Spring Roo, the Spring rapid application development platform, to the public.

There are a lot of good changes in this release to make Roo quite palatable to Enterprise developers, such as:
  • Multi-POM projects - now you can create web, service, database, and functional tiers and tie them all together with a parent POM.  You can even scaffold web interfaces based on models from other projects.
  • Scaffolded service support and repository support - now, instead of using the Active Record pattern (entities contain their own persistence methods) you can write your own services and repositories.  Or, let Spring scaffold them for you.  As usual, all scaffolded service and repositories will automatically contain the proper base methods, but you can then extend them and add your own, or push the code in and work with it yourself.
  • A cleaner add-on API - the Roo team has been working toward cleaning up the add-on internals and making it more consistent. Expect more add-on developers to appear after this release, it's really a straight-forward process to develop them.
  • JSF support - while this is the initial version of the add-on, it is rather feature-rich.  Roo supports either Oracle Mojarra or Apache MyFaces, and theming, and uses composed UIs.  In some ways, developing user interfaces with JSF may be easier for newer developers.  Unlike earlier efforts, though, Roo is not mounting JSF via the WebFlow integration.  Scaffolding is supported, as are rich widgets via PrimeFaces (www.primefaces.org).
There is more, including enhancements to GWT and some shell usability enhancements (you can now do a OS escape with the exclamation point and a space such as roo> ! ls).  We're waiting on an updated blog entry from Alan Stewart to detail everything.  For now, though, you can download Roo 1.2.0 from springsource.org/spring-roo.  Srini Penchikala and I have wrapped up writing chapters for Roo in Action, and are readying it for print in early April.  The book covers Roo 1.2.0, and will be helpful for those just starting out.  You can purchase the MEAP online at http://www.manning.com/rimple.

Ken is a writer, podcaster and trainer/mentor at Chariot Solutions. He teaches Spring, Maven, and other subjects, and you can see training courses offered by Chariot at chariotsolutions.com/education.

Friday, December 16, 2011

OpEd: Yammering about Scala, Java, and Winning

This is an opinion piece that represents the views of the author, and does not represent the official stance of Chariot Solutions. But sometimes it is fun to weigh in on the news of the day.

There has been quite a dust up in the blogosphere about Yammer's decision to switch from using Scala to Java. Google "yammer switching to scala" and you'll get a sampling. You can read it for yourself, but the gist of story seems to be that Yammer, the self described "enterprise social network" e.g. private label Twitter, decided to move their development from Scala to Java. The Scala guys at Typesafe heard about this (disclosure: Chariot Solutions is a Typesafe partner), and privately asked Coda Hale, infrastructure architect at Yammer, the reasoning behind the move. Coda responded in another private-but-soon-made-public email. It is a very long and detailed email, but in summary:
"The essence of it is that the friction and complexity that
comes with using Scala instead of Java isn't offset by enough productivity
benefit or reduction of maintenance burden for it to make sense as our default
language."
Then Hale clarified the purpose of his email and Yammer clarified their official position on Scala.  Yammer's decision has (re)ignited the debate over whether Scala is better or worse than Java.  If you read the comments section of this blog post from Stephen Colebourne, you get the general gist but here is a sampling that I can reprint and still keep this blog "family friendly":

In favor of Scala:
Some pretty serious masochists out there at Yammer. I wonder if their investors now about it.

Not in favor of Scala:
The code and build process was a rat's nest of pain and people should avoid using scala at all costs on any commercial project where these things can become a big issue.
I've used and learned lots of different languages but can't recall anything more painful than scala. Cross compiling and maintaining c codebases with native ui on different Linux/winblows envs was easier and less traumatizing than this. It's fine for academic pursuits and personal projects but you're smoking some serious crack to try and justify it commercially.

Opinion #1: Java is winning (like Tebow not Sheen)

The biggest thing that I take away from this whole incident is that Java is winning.  I don't mean Java is winning vs Scala or that Java is better than Scala.  I mean that Java is, in my opinion, an aging language with many quirks, with a fairly dysfunctional governing body in the JCP, and a yet-to-be-fully-trusted new caretaker in Oracle, full of the baggage of vendor compromises which nearly ruined JEE, and faces many very strong competitors on the JVM itself like Scala, Groovy, and Clojure, and yet -- against all odds and in very Tim Tebowesque form -- is winning over highly skilled engineering shops like Yammer.

I've been a Java programmer for 10+ years and there are many things about Java that irritate me like the slew of boilerplate code that you need in every single class.  But while innovation in the language itself can only go so far while still maintaining backward compatibility, innovation in the wider Java community is still thriving.  Java may not be the best language out there, but the battle tested JVM runtime combined with the countless mature open source tools and frameworks make the Java ecosystem as a whole arguably the richest one on the planet.

For a while I was convinced Java was the new Cobol: a language past its prime which due to its huge popularity will never die out completely, but not on the short list of candidate languages for a green field project.  Now I've changed my mind.  Java has its warts but there is value in maturity, and it still can compete head to head with any language ecosystem out there.

Opinion #2: Scala is winning too

Yes, Yammer moved from Java to Scala, but they make explicitly clear that they like Scala too.  It is just that Java make more sense for them and their specific business needs.  Yammer was able to build an impressive high volume system with a small engineering team using Scala.  One shop moving away from Scala does not constitute a trend.  Scala has a relatively young ecosystem but already some very impressive open source projects like Akka.  I expect the combination of Jonas Boner and Martin Odersky together in a single company to provide a real boost to Scala.

I've never used Scala on a real project but I'm in love with the syntax and what you can do with the language.  I know people who use it all the time and love it as well.  Scala is undeniably more complex than Java but with the complexity comes more power.  Scala isn't better or worse than Java.  It is just different.

Opinion #3: Polygot is hard

I really like the idea of polygot programming: pick the programming language that fits your problem space.  I worked with many large clients that solve every problem with the same Java stack even when it is obviously a bad fit.  But one of the things that Hale mentioned in his email was that the choice for Yammer wasn't between Scala and Java, it was between Scala/Java and Java.  The context switching caused by thinking in multiple languages was a drag on the team.  When you think about it, a programmer is required to know many languages just to build a basic web app using a Java stack: Java, SQL, HTML, Javascript, and CSS.  Adding more languages to the mix makes things that much more complex.  Then you also include build tools, language idioms, and the ecosystem of libraries and frameworks.

I work in both Java and Groovy, and I find those languages similar enough to minimize the difficulty of context switching, but I can imagine switching between diverse languages like Java and Clojure might make my head explode.

Opinion #4: Coda Hale is a humorous writer

Not everyone can write about techie stuff and make it humorous and informative.  Here is a quote from his blog post that made me chuckle:

"The Scala community needs another giant blog post about ways in which someone doesn’t like Scala like I need a hole in my head, and I’d rather suck a dog’s nose dry than lend a hand to the nerd slapfights on Hacker News."

I was pleasantly surprised to find that Hale is speaking at my company's annual technology conference Philly ETE.  That's one session I'll be attending.

And I might just ask him if Scala is better than Java :-)

Monday, November 7, 2011

Groovy Algorithms: Shunting Yard

Groovy's sugary syntax makes coding algorithms -- dare I say it -- fun.  The shunting yard algorithm, invented by Dutch computer scientist Edsger Dijkstra, is used to parse mathematical expressions.  You might have picked up on this already, but computers and people think differently.  We commonly use infix notation to write mathematical expressions.  It is what you learned in school.  For example: "3 * (2 + 3)".  Makes sense to you, but it is inefficient for a computer to process.  Things like operator precedent and nested parenthesis make infix rather messy.  A more efficient format is postfix or Reverse Polish notation.  In postfix, the operands are listed first, and then the operator.  For example: "2 3 + 3 *".  This eliminates the need for parenthesis, and allows you to calculate the expression using just a single stack to hold operands and intermediate results.  Why didn't we learn this in school?  I don't know.  Why aren't we using the metric system yet?  Why doesn't Siri on my iPhone understand anything I say even though it works great in the commericals?  Life's little mysteries.  Back to shunting yard.  Here is my Groovy implementation of it.

The main class is ExpressionSolver.  The computePostfix method (line 7) shows how easy it is to calculate a postfix expression with a single stack and single pass through the tokens in the expression.  It delegates the work of converting from infix to postfix to the appropriately named ShuntingYardAlgorithm class (line 21).

1:  package org.jadcon.expression  
2:  def infixExpression = '5.5 + ((6 + 2) * 4) - -3 * 1.5'  
3:  def postfixExpression = '5.5 6 2 + 4 * -3 1.5 * - +'  
4:  def expectedResult = 42  
5:  assert computePostfix(postfixExpression) == expectedResult   
6:  assert computeInfix(infixExpression) == expectedResult  
7:  def computePostfix(postfixExpression) {  
8:       def stack = []  
9:       postfixExpression.split().each { token ->  
10:            if (token.isNumber()) {  
11:                 stack.add(token)  
12:            } else {  
13:                 def b = stack.pop().toBigDecimal()  
14:                 def a = stack.pop().toBigDecimal()  
15:                 stack.add(Operator.valueFrom(token).calculate(a, b))  
16:            }  
17:       }  
18:       stack.pop()  
19:  }  
20:  def computeInfix(infixExpression) {  
21:       computePostfix(ShuntingYardAlgorithm.convertToPostfix(infixExpression))  
22:  }  

The ShuntingYardAlgorithm class coverts an expression from infix to postfix.  It requires two stacks: an output stack and a working stack.  The main logic is in the processToken method (line 14) which loops through each token.  Operands go directly on the output stack.  Operators and parenthesis are placed on the working stack to get correctly ordered when placed on the output stack.

1:  package org.jadcon.expression  
2:  class ShuntingYardAlgorithm {  
3:       def static convertToPostfix(infixExpression) {  
4:            def output = []  
5:            def stack = []  
6:            evenSpaceAroundParens(infixExpression).split().each { token ->  
7:                 processToken(token, output, stack)  
8:            }  
9:            while (!stack.isEmpty()) {  
10:                 output.add stack.pop()  
11:            }  
12:            output.join(' ')  
13:       }  
14:       def static processToken(token, output, stack) {  
15:            if (token.isNumber()) {  
16:                 output.add token  
17:            } else {  
18:                 switch (token) {                           
19:                      case "(":  
20:                           stack.add token  
21:                           break  
22:                      case ")":  
23:                           while (stack.last() != "(") {  
24:                                output.add stack.pop()  
25:                           }  
26:                           stack.pop() // pop the left paren and ignore it  
27:                           break  
28:                      default:  
29:                           def operator = Operator.valueFrom(token)  
30:                           while (!stack.isEmpty() &&  
31:                                     stack.last().is(Operator) &&  
32:                                     operator <= stack.last()) {  
33:                                output.add stack.pop()  
34:                           }  
35:                           stack.add operator  
36:                 }  
37:            }  
38:       }  
39:       def static evenSpaceAroundParens(string) {  
40:            def output = []  
41:            string.each { letter ->  
42:                 if (!output.isEmpty() && letter != ' ') {  
43:                      def last = output.last()  
44:                      if (isParen(letter) && last != ' ') {  
45:                           output.add ' '  
46:                      } else if (isParen(last)) {   
47:                           output.add ' '  
48:                      }  
49:                 }  
50:                 output.add letter  
51:            }  
52:            output.join()  
53:       }  
54:       def static isParen(letter) {  
55:            letter == '(' || letter == ')'  
56:       }  
57:  }  

The final class is Operator which is an enumeration of operators.  Groovy makes this code pretty tight using closures.  Even threw in a spaceship comparison operator for good measure (line 24).

1:  package org.jadcon.expression  
2:  enum Operator {  
3:       PLUS('+', 0, { a, b -> a + b }),   
4:       MINUS('-', 0, { a, b -> a - b }),   
5:       MULTIPLY('*', 1, { a, b -> a * b }),   
6:       DIVIDE('/', 1, { a, b -> a / b })  
7:       String value  
8:       int precedence  
9:       Closure calculate  
10:       private Operator(String value, int precedence, Closure calculate) {  
11:            this.value = value  
12:            this.precedence = precedence  
13:            this.calculate = calculate  
14:       }  
15:       def static valueFrom(string) {  
16:            for (operator in Operator.values()) {  
17:                 if (operator.value == string) {  
18:                      return operator  
19:                 }  
20:            }  
21:            throw new IllegalArgumentException("invalid operator ${string}")  
22:       }  
23:       def int compareTo(other) {  
24:            precedence <=> other.precedence       
25:       }  
26:       def String toString() {  
27:            value  
28:       }  
29:  }  

Coding the shunting yard algorithm was fun exercise in Groovyness.

Wednesday, October 26, 2011

Spring Roo 1.2 will be tipping point for RAD Java

I'm going to make a bold statement: Spring Roo is about to do for Spring developers what Ruby on Rails did for Ruby developers - make developer agility, and not mechanical, rigid architectural structures, the focus of daily developer productivity.

There. I've said it. But I have to step back for a minute and disclaim a few things. First, as some of you may know I've been working with Spring and Spring-related projects for a while. I'm also the education director here at Chariot, and Spring has been a mainstay of many of our Java-based consulting projects and course materials - we're also VMware Training Partner. Finally, I'm an author on Spring Roo in Action by Manning, which is undergoing the transformation from draft to publication by early 2012.

With the disclaimers aside, let's dig into my treatise.  First, a bit about what, exactly, Roo is...

Roo in a nutshell

Roo is a developer productivity tool that uses a simple command-line shell to configure projects, install features, and create various objects such as JPA entities, controllers, services, repositories, and tests.  Conceptually, it is similar to Rails, Grails, or even JBoss Seam, in that you use it to bootstrap a project.

Unlike these other frameworks, which lean heavily on dynamically generated code, Roo is a compile-time framework - no "Roo Runtime" exists to interpret your code.  The shell adjusts your code and configuration, based on changes made to annotations in source code (either by the Roo shell, or by the developer).  Roo even generates setters, getters, JPA code, transaction logic, scaffolded controller views, and a lot more.

Monday, October 17, 2011

Akka Scheduler: Actors with Heartbeats

Akka is an excellent platform for writing concurrent applications using the Actor model. Chariot architect Anatoly Polinsky describes the Akka scheduler and how you can use it to create a heartbeat for an actor. From Anatoly's blog:

AKKA Scheduler: Sending Message to Actor’s Self on Start

Akka has a little scheduler written using actors. This can be convenient if you want to schedule some periodic task for maintenance or similar. It allows you to register a message that you want to be sent to a specific actor at a periodic interval.

How Does AKKA Schedule Things?

Behind the scenes, AKKA scheduler relies on “ScheduledExecutorService” from the “java.util.concurrent” package. Hence when AKKA Scheduler needs to schedule “a message sent to an actor, given a certain initial delay and interval”, it just wraps the task of sending a message in a “java.lang.Runnable”, and uses a “ScheduledExecutorService” to schedule it:
service.scheduleAtFixedRate( createSendRunnable( receiver, message, true ),
                           initialDelay,                         
                           delay,                             
                           timeUnit).asInstanceOf[ScheduledFuture[AnyRef]]

“Heartbeat” Actor

Let’s look at the example of scheduling a message that should be sent to an Actor’s “self” as the Actor on start. Why? Because it is a cool use case : )
“Heartbeat” would be an ideal example of such use case => “When a ‘Hearbeat Actor’ starts, it should start sending heartbeats with a given interval (e.g. every 2 seconds)”

Creating a Message

First we need to create a message that will be scheduled to be sent every so often. We’ll call it a “SendHeartbeat” message:
sealed trait HeartbeatMessage 
case object SendHeartbeat extends HeartbeatMessage

Read the full post at: AKKA Scheduler: Sending Message to Actor's Self on Start

Tuesday, September 27, 2011

PhoneGap 1.0 Android Plugin updates

Kevin Griffin has been working with PhoneGap for some time now.  In this new blog post, Kevin discusses new features in PhoneGap 1.0.


With the upcoming release of PhoneGap 1.0 I thought I would point out a couple of nice additions coming for PhoneGap (Android) Plugin developers (and eventually PhoneGap as a whole).
The first addition is the propagation of lifecycle events (onPause, onResume and onNewIntent) to plugins. Plugin developers are now responsible for reacting appropriately if the app has multitasking turned on, but also have access to the lifecycle of the application. Developing the NFC plugin (https://github.com/chariotsolutions/phonegap-nfc) we found this an absolute necessity, so it’s great to see it added in.
Ah the power of Open Source software :)
The second is a new method of loading plugins. To register a plugin now you just need to add your plugin name and class to the plugins.xml (located in res/xml/)

Read more...



Thursday, September 22, 2011

Isobar Create 48 - A Solution to Parking Hassles Using NFC

 Recently, Chariot's Director of Consulting, Don Coleman, participated in the Isobar Create 48 NFC Hackathon in Boston. Below is an excerpt from his blog about his experience and his team's second place finish. 
 
My friend Chris Bernardi invited me to join his team for the Isobar Create 48 NFC Hackathon along with April DiMartino and Marc Neuwirth. The event kicked off on Tuesday around 3 PM at Space with a Soul. Before the hackathon there were some general Near Field Communication (NFC) presentations by Isobar, Nokia and ICS. After the NFC intro, they kicked out the people who came for the presentations so we could get started.
None of us came to the hackathon with the killer application idea. We brainstormed for a while, discarding lots of half-baked ideas and ended up deciding to build an NFC solution to make parking better. We came up with a bunch of scenarios, but decided to limit our initial implementation to garages with entrance and exit gates, so it was easier to track inventory.
April does an excellent job describing our application:
The working title of the app is “I Got Your Ticket Right Here” and is best understood when said with a Brooklyn NY accent ;-) We haven’t worked out a shorter and more appropriate title for it yet. So for purposes of this I will simply refer to it as the Parking app.

Read more...

Thursday, September 1, 2011

Checklists and Document Inspections

John Shepard, one of our architects, blogged some interesting thoughts on what makes a document inspection. Most developers will tell you that code reviews are good, and also tell you they aren't done regularly in their organization. But John goes beyond the scope of code to reviewing other documents such as requirements and technical specifications as well.

"While there is an ongoing debate on whether or not document inspections are useful, my experience is that on larger projects, they are very useful. They help maintain a minimum level of quality and help disseminate information among team members. Rather than continuing that debate here, I'm going to provide a starting point for checklists for those who have decided to use document inspections. While the checklists do end up being different for each project, I find it helpful to have an obvious place to start."

Read the full post here.

Tuesday, August 9, 2011

Full-Text Search For Relational Data

Thanks to internet search engines like Google, Yahoo, and Bing, everyone has become accustomed to searching their data effortlessly. Consequently, as developers of web-based applications, we increasingly find that our customers' requirements include being able to search their application's data in a "Google-like" way.

For a very small subset of applications that only need to do full-text search on a few database columns, there a some very simplistic solutions, ranging from using a SQL 'like' clause on every column to database-vendor supplied full-text search functionality for designated columns.

Frequently, however, these simplistic approaches are not enough, either because the data to be searched is large and complex, because the approach's search functionality is limited, or because database neutrality is desired. For these situations, a more advanced solution is needed. Fortunately, there are now a number of solutions available for all of the most popular platforms, languages, and frameworks, and several hosted solutions that are development stack-neutral.


Lucene and Compass
One of the most popular full-text search projects is Apache Lucene, a Java-based, open-source indexing and searching solution. Lucene itself targets indexing and searching of 'documents', but several other projects, most notably Compass, have adapted Lucene for indexing and searching relational data via integration with Object-Relational Mapping libraries such as Java's JPA, Hibernate, and others.

The combination of Lucene and Compass provides Java developers with an easy way to implement Google-like searching of their relational data, including fuzzy searching (spell-check / 'Did you mean...'), stemming ('fishing', 'fished', 'fish', and 'fisher' all match 'fish'), wildcards, and boolean logic.

For users of the Java JPA ORM, usage of Compass is fairly straightforward. For users of the Grails framework, the Grails Searchable Plugin makes implementation of full-text searching almost effortless. I recently added this plugin to a Grails application with a moderately complex data model, and had my full-text search functionality up and running in a few hours, with fine-tuning taking only a few more hours. As the application's data model has grown, very little time has had to be spent on keeping the search functionality up to date.

There are many other programming languages and platforms in use besides Java, so not surprisingly, Lucene has been ported to many of them, including C, C++, .NET, Objective-C, Python, Perl, and Ruby. The most popular of these, due to the popularity of the programming languages, are Lucene.net, which is a C# port targeted at the .NET runtime, and Ferret, which is a Ruby port targeted at the Ruby on Rails framework.

While Lucene and its variants currently dominate the open-source full-text search landscape, there are other well-known projects, including Xapian.


Hosted Solutions
There may be situations where it makes more sense move your full-text search functionality 'to the cloud'. Several hosted solutions are available, some based on Lucene or other open-source technologies, as well as other, proprietary offerings.

Websolr is a hosted version of Apache's Solr which is itself built on Lucene. Other offerings include Flying Sphinx for Rails (which uses the Sphinx search engine), and IndexTank, which is a proprietary offering.

Both Flying Sphinx and IndexTank are available as add-ons for the popular EngineYard and Heroku Ruby-based hosting platforms.

I recently tried out IndexTank on Heroku. IndexTank itself targets indexing and searching documents, but the Tanker gem does a great job of integrating IndexTank with Rails' ActiveRecord ORM. IndexTank's documentation doesn't mention it, and while not available "out of the box", IndexTank does support both fuzzy searching and stemming. All you need to do is send an email to their customer support address, and ask to have it turned on.

If your application can benefit from full-text search, there are plenty of interesting choices, regardless of your platform or programming language.

Wednesday, August 3, 2011

Groovy Script to Tame Gmail Attachments

I like Gmail but it has a big short coming: you can't sort mail by attachment size. This means that if you are running out of space in your Gmail account, you can't easily find large attachments like that 25MB video that your friend sent you of his kid's graduation or other large attachment that you really would like to get rid of. There are sites like findbigmail.com that will help you find large attachments, but the downside is that you have to trust them and allow them to read all of your email. I'm a little paranoid so that wasn't something I was willing to do.

I also like Groovy and so I wrote a little Groovy script that finds large attachments in Gmail and gives them a custom label so you can easily find them. The script uses JavaMail which depends on the JavaBeans Activation Framework (activation.jar). Both jars need to be in the classpath along with the Groovy jar.

The first part of the code makes a connection to Gmail.

import javax.mail.*
import java.util.Properties
def emailAddress = "you@gmail.com"
def password = "password"
def server = "imap.gmail.com"
def port = 993
def OneMB = 1024000
def FiveMB = 5120000
def props = new Properties()
props.setProperty("mail.store.protocol", "imaps")
props.setProperty("mail.imaps.host", server)
props.setProperty("mail.imaps.port", port.toString())
def session = Session.getDefaultInstance(props,null)
def store = session.getStore("imaps")
store.connect(emailAddress, password)
println "connected to Gmail"
Then we define the labels that we want to add. Labels in Gmail are called folders in JavaMail.
def bigAttachmentFolder = store.getFolder("1MB+ attachment")
if (!bigAttachmentFolder.exists()) {
bigAttachmentFolder.create(Folder.HOLDS_MESSAGES)
}
def hugeAttachmentFolder = store.getFolder("5MB+ attachment")
if (!hugeAttachmentFolder.exists()) {
hugeAttachmentFolder.create(Folder.HOLDS_MESSAGES)
}
Next the script iterates through all of the emails looking for attachments. If a large attachment is found, it is copied into a folder which in Gmail adds the appropriate label to it.
def folder = store.getFolder("[Gmail]/All Mail")
folder.open(Folder.READ_ONLY)
folder.messages.each { msg ->
try {
def content = msg.content
if (content instanceof Multipart) {
for (i in 0..(content.count - 1)) {
BodyPart bodyPart = content.getBodyPart(i)
if (Part.ATTACHMENT.equalsIgnoreCase(bodyPart.disposition)
&& bodyPart.size > OneMB) {
println "big attachment: ${bodyPart.fileName} = ${bodyPart.size}"
folder.copyMessages([msg] as Message[], bigAttachmentFolder);
if (bodyPart.size > FiveMB) {
folder.copyMessages([msg] as Message[], hugeAttachmentFolder);
}
}
}
}
} catch (Exception ignore) {
println "error processing message, no big deal, moving on"
}
}
println "-----------done------------"
That's it! If you modify the script with your email address and password, and then run it, your Gmail account will get 2 new labels: "1MB+ attachments" and "5MB+ attachments" that will allow you find and delete big attachments quickly. The code is pretty concise, and the JavaMail API looks better in Groovy in my opinion.

Monday, July 25, 2011

Roo In Action Corner - Testing Entity Validations With A Mock Entity

This article references the Manning book Spring Roo in Action, which Ken Rimple is currently authoring.  It is available as a Manning MEAP.

I've been working hard on the more advanced chapters of Roo in Action, and as part of this I've amassed some background material that didn't make it into the book.  This topic, using Spring's Mock Entity support, was one of those topics that didn't get a lot of attention.
In Spring Roo in Action, Chapter 3, I discuss how Roo automatically executes the Bean Validators when persisting a live entity. However, when running unit tests, we don't have a live entity at all, nor do we have a Spring container - so how can we exercise the validation without actually hitting our Roo application and the database?

Monday, July 18, 2011

The Ultimate Power of Spring Batch



Chariot architect Anatoly Polinsky has created an interactive Prezi presentation about the power of Spring Batch. It is an animated blog post because Anatoly is not just a software developer, he's an artist. It is a cool way to get familiar with what Spring Batch does for you and a lot of fun to watch.

Sunday, July 10, 2011

Growing Up with Jenkins/Hudson, Nexus, and Sonar, Part 1

In my previous post I explained why I think you should use Jenkins (or his twin Hudson), Nexus, and Sonar to super-charge your Maven builds. To summarize, Jenkins is a continuous integration server that runs your builds, Nexus is an artifact repository that versions and stores your jars/wars/zips/etc, and Sonar is a metrics server that gathers code metrics and produces nice reports to help you improve code quality. All 3 products are free OSS and really useful. But scaling anything is hard. In this post I'll talk about some of the challenges that you might face when you scale up a Jenkins infrastructure from a few builds a day to thousands of builds a day, and some tips to help overcome those challenges. In the following post, I'll cover Nexus and Sonar tips.

The Demo Went Well, But Now The Honeymoon Is Over

When you first introduce any new piece of infrastructure, your biggest challenge is generally just getting it installed and working at all. That is surprisingly easy with the Jenkins/Nexus/Sonar stack. They install easily. They have good-looking, intuitive UIs and demo really well. They play nicely together. You figure, "Setting up this CI (continuous integration) thing is a slam dunk. I'll be done by lunch." And then you introduce your beautiful new system to the users. Uhhgg. The users. Everything worked fine until they showed up and started breaking it. In this case, the users are the various development teams within your organization that want to #1 build their code with Jenkins, #2 store their artifacts in Nexus, and #3 gather code metrics with Sonar.

Jenkins runs all of your builds so obviously it requires a lot of CPU for compilation, running tests, and static code analysis. You will quickly need multiple boxes to handle the daily load of CI builds. Fortunately Jenkins has support for building a server farm quite easily by running a "master" instance that distributes builds to many "slave" instances. In practice this works very well. Some tips:

Tip 1: Partition your master/slave clusters by something logical like development organization. Don't put all of the builds on a single cluster unless you work for a very small organization. This is important for 3 reasons:



  1. It isolates development organization from each other so you can, for instance, restart or upgrade one cluster without effecting others and keeps "problematic" development organizations isolated (you know how you are...the kind of developer who put infinite loops in your unit tests and stuff like that).


  2. It allows you to configure security differently for each cluster which you may need to do if the groups within your company don't like each other. Hey, you're a DevOps, not a psychiatrist so just go with it.


  3. The Jenkins UI will get very messy very quickly with hundreds of jobs to wade through. It does have filtering features, but it is still slow to render in browsers. IE, I'm looking at you.


Tip 2: Early on, come up with a strategy to automate the creation of new master and slave instances. Two good options are using a provisioning tool like Puppet or Chef, or cloning a VM. One bad option is setting things up manually from memory.

This kind of automation is important because if you are scaling up (adding more and more development teams to your infrastructure) most likely you'll end up: #1 adding more master/slave clusters, and #2 making global changes across your master/slave instances. For example, Jenkins has an awesome plugin community so it is likely you'll be finding new and useful plugins often. Say you have 5 Jenkins clusters partitioned by development organization (a good choice for partitioning). You'll have to install the plugin on all 5 master instances manually. And say you need to change something in the environment. Assume your 5 master instances each have 2 slaves also. Now you've got to make a change in 15 places. Your chances of fat-fingering a change goes way up plus who wants to do all of that typing? So get on board with the DevOps movement, and automate so your infrastructure becomes code.

Problem 1: You configure Jenkins' security permissions to allow the development teams to create / manage their own jobs. This is a problem because if you want any uniformity at all in your builds, then 500 developers all changing their jobs willy-nilly creates a mess in Jenkins. This makes any kind of global changes to Jenkins jobs using a script very difficult, and doesn't allow you to use Jenkins to do any kind of enforcement of standards or provide a software "chain-of-custody" from source repository to production which can be a very big deal in a big company. Just having standards for Jenkins job names is actually very useful, and in a "free-for-all" model no standards can be enforced.

Problem 2: The reverse. You configure Jenkins' security permissions to restrict the development teams from creating / managing their own jobs. Instead only a select number of Jenkins admins can do that task. The Jenkins admins now have new full time job which is very un-fun: manually create jobs all day.

Solution: The crux of the issue is that you want developers to be able to change some fields in a job like the source code URL to their project, but not other things like mandatory builds steps such as quality gates or auditing steps. You also probably want to prevent developers from using Jenkins' cool-but-dangerous feature of allowing a job to run arbitrary script code on the server which obviously could do all kinds of mischief. Jenkins security permissions allow you to either create / manage a job in its entirety or not at all. What you really need is to set permissions on a field by field basis.

I don't have the perfect solution for this problem. For some of you out there, the whole "Jenkins job management" problem isn't a problem at all: just let the developers own their jobs and be done with it. I was on that side of the argument for a while, but experience has beaten me to down to the realization that some controls are actually a good thing.

There are 2 solutions I can think of. One is to create a Jenkins plugin that creates a new job type that is customized to your needs. I don't really like that one.

My suggested solution is to create a simple "Jenkins job management" web application in your favorite rapid application framework (Rails, Grails, etc) that is used by developers to create jobs. This application only allows them to set the fields that are "safe" and behind the scenes does the job creation / maintenance via Jenkins easy-to-use REST API. This is the best of both worlds: self-service creation of jobs but with a measure of control.

Problem 3: The builds run really slow

Solution: There are many, many reasons why this would be true, but there are 3 things I've found helpful aside from just buying bigger hardware.

The 1st thing is to profile your build. I wrote a simple AspectJ aspect (using load time weaving) to profile Maven builds and give timings for each Maven plugin that ran. That helped break down a 45 minute build into the different steps and help explain why it was taking so long.

The 2nd thing is to take all of the build steps that can be deferred until later and process them asynchronously. A CI job needs to run compilation and it needs to run tests to provide immediate feedback. You can't defer those steps. But there are many others that you potentially can defer. For example, Maven site generation is slow. Running Sonar metrics can also be slow. So instead of running the Maven site and Sonar stuff during your build, run them asynchronously. This takes a little engineering but you are a software engineer, right? You could write a simple Jenkins plugin that puts a message in a queue after each successful build. Then have a process outside of Jenkins -- potentially on a different server -- read the queue, and run things like Maven site and Sonar. You can potentially make your builds much faster using this technique, and I've used it successfully.

The 3rd thing is to pay attention to the build time trend information that Jenkins provides, and automatically email developers if their build takes X% more than it used to. I've often see the root cause of a suddenly slower build is that a slow unit test was introduced. Fixing the test improves the build times, and it is much easier to find the offending test if you notice the slow down right away. You can get the build times via Jenkins REST API, so you can write a little script (Groovy anyone?) that is scheduled to run every night and checks the build times to provide rapid feedback if a job suddenly gets much slowers.

Problem 4: No one pays attention to failing Jenkins builds

Solution: This is a real problem. Developers face a barrage of emails daily, and sometimes the job failure email is just one more to ignore. Obviously peer pressure is the main way to make people care about failing CI jobs. There are many Jenkins plugins that provide build notification, but my personal favorite way to get people to care is to bridge the virtual world into the physical world by building a CI orb. A CI orb has both a visual representation (some kind of light -- traffic light, lava lamps, glowing orb) and an audio output ("Joel has broken the build"). Instructions for a cool one that I've personally seen can be found here. The CI orb is not just a gimmick -- it really does work. It is easy to ignore 1 or 2 failing Jenkins jobs out of 50. But it is much harder to ignore a large pulsating red orb next to your boss's cube, or your name being read on a loudspeaker. A CI orb helps your team realize the purpose of CI which is to respond to failures quickly.





In the next post, I'll give you some tips for Nexus and Sonar.

Friday, July 1, 2011

Learnings from Actor Development

I spent a fair amount of time developing actor-based systems recently, specifically with the Scala Actor library. Regardless of whether you are implementing actors with the Scala library, Akka, Lift or Scalaz, some basic gotchas can present themselves until you get a feel for what you're doing. Here are some of them that I've learned the hard way.

Never Refer Directly to Other Actors
Actors are fragile and can die easily. While you typically create a supervisor with a strategy for how to recreate that actor, any other class with a direct reference to that actor that died now has an invalid reference. If you absolutely must have actors with references to others that do not have a supervisory relationship, use a proxy reference instead - if the actor behind the proxy dies, you only have to replace it in the proxy, not in every actor with that reference. Akka solves this problem nicely with ActorRef, where the reference behind it can be recreated without updating anyone holding the reference.

If You Do Have an Actor's Reference, Avoid Synchronous Method Calls Between Actors
Regardless of whether your actors are event- (shared thread pool) or thread-based (each actor has its own dedicated thread), avoid having actors make direct method calls on another actor. It introduces concurrency into classes that are designed to avoid that very situation - the receiving actor can be operating on a thread handling a mailbox message at the same time it is dealing with your call. Use blocking or future-based message sends instead, which allows the receiving actor to handle the request through its mailbox on its own thread. Not to harp on the virtues of Akka too much, but the ActorRef type also prevents this kind of behavior.

Write Business Logic in External Idempotent Functions
Testing actors is difficult, particularly those with side effects. If you are in a supervisor hierarchy, the receipt of a message may lead to the creation of child actors that have their own side effects which may be difficult to account for in a test environment. The goal of unit tests is not to test whether actor interaction works, but that the business logic that the actor performs is sound. Externalize your business logic into functions and partial functions that can be tested outside of actors, and use integration tests to prove only that the actors executing that logic behave as expected as part of an end-to-end functional test.

Beware the Thundering Herd
When you start creating structures of actors such as supervisor hierarchies, it can seem simplest to send generic messages that are passed through the tree. However, as actors react and send their own messages, this can lead to event "storms". This can be addressed using two strategies - 1) use granular messages that target specific events for specific actor instances, and 2) ignore messages of the same type with the same parameter data for a given time period. You can even implement a common trait for all of your actors that gives them the ability to not handle the same message for an externally-configurable period of time. Be judicious in how you use this, though - tune it for the loads of your system.

Garbage Collection
In the case of a supervisor hierarchy that is responsible for configuring servers in a cluster, you may want to implement garbage collecting actors that ensure that each server is pruned of configuration that it currently has but is no longer relevant. The actors in the supervisor hierarchy will take care of that if one was created to represent that particular configuration item, but if no actor already existed to represent that state, only a garbage collector whose role is specifically to clean up a dirty environment can take care of clearing bad data from the target server.

Always Pass Copies in Immutable Messages
Copy any object instance that will be passed in a message, so as to avoid accidentally sharing any state. In almost all cases, you should ensure that your messages themselves are immutable. Dean Wampler and Alex Payne make this point specifically in their book, Programming Scala. This, combined with very granular messages, can seem expensive in terms of resources. But it is worth the cost in memory and performance to ensure that your actor behavior is what you expect at design time.

Semantic Logging
Debugging actors isn't easy. Typically, you have multiple instances of the same class with asynchronous behavior, so it is difficult to discern flow. Create trace level log output for each actor type that displays specific information about it in a clearly-visible manner. Use line breaks and tabbed indentation to make it readable, but note that doing so can make your log files even larger than they already are. This has an unfortunate side effect of forcing you to be very granular in your log configuration as to what logging level is used - package-level logging may be too much information. It may help to put a timestamp into a message, so you can grep the log for specific messages as they flow through actors. Also, log the timestamp of when the actor received and handled it.

Deteriorating Retry
If your actors have side effects where a required resource (network connection, database access) may not be available or may fail, use deteriorating retry logic to allow the actor to send itself a message to try again in an increasingly longer interval. For a good example of this, go to Gmail, disconnect from all networks and watch as it tries to reconnect in longer and longer timeframes.

Instrument via JMX for Runtime Clarity
Register every actor instance with the JVM's MBeanServer, and have their supervisors clean up the instrumentation when they die. Yes, this comes at a performance cost, but you can make the registration asynchronous through a future while you perform other tasks in initialization and startup. While you'll still need to profile the threads involved to find threading issues, having the ability to view actor existence and state in JConsole or VisualVM is a wonderful help in knowing what is happening in your system in production.

Prepare for Race Conditions
As with any asynchronous programming, the timing of actor interactions can be unpredictable. Make your actor interactions recheck state they depend on so that they can reflect an appropriate state of their own. If Actor A needs Actor B to have a specific value for its own state to be appropriate, it should not send only one message to Actor B and assume that the value returned is correct that one time. Keep checking the value (again, possibly with deteriorating retry) until you can be certain you have a correct representation of Actor B's state.

Thursday, June 30, 2011

Associative Arrays in Bash 4

 John Shepard, one of Chariot's architects and newest bloggers, just recently posted this on his blog.
 A little different from our more focused software dev posts, we hope you will find this information useful.


I recently switched my work machine from OS X to Fedora. One of the first programs I noticed was missing was Time Machine. After being unable to get any of the backup software for Linux to behave as desired, a project emerged.

Ignoring most of the details of the backup scripts (all the scripts are available at the end of this post), I'm going to focus on the part working with associative arrays.

The backup program would need some way to keep only one backup per day for previous days. The obvious way to determine which days are affected is to keep a key value pair of dates and backup counts per day. Key value pairs have a few different names such as maps or dictionaries. In bash key value pairs are called associative arrays. 


To declare an associative array use -A
declare -A MY_VARIABLE

To access the value just reference the variable as an array element
KEY="some value"
MY_VARIABLE["${KEY}"]

To access the value, or use zero if there is no value, use a default value
${MY_VARIABLE["${KEY}"]:-0}

And to set a value (here the value for the key is being set to two)
MY_VARIABLE["${KEY}"]=2

For looping, to access all keys
${!MY_VARIABLE[@]}

The entire set of backup scripts is available on github. cleanup_day.sh contains the associative array code.

Tuesday, June 21, 2011

HTML 5 Offline Applications with JQuery Mobile

I can't believe it is a month since our last post.  Vacation got in the way, but our consultants have been blogging on various topics.  There is some catching up to do over the next week.

New to the blogsphere is John Shepard.  John recently posted around JQuery ad HTML5, and what he has been doing with his spare time.


I was recently playing around with JQuery Mobile and was wondering how easy it would be to create an HTML 5 offline application. I'm not very familiar with HTML or JavaScript, so I figured this would be an interesting project.

A simple application was required, so a calculator was semi-randomly selected. (The source for the calculator is available at the end of this post.)

The first step in creating the calculator was to add some HTML that had a text area and some buttons. jQuery Mobile handles a resizing display area and can put buttons in a grid. The hooks into jQuery Mobile seem to be through data-roles and classes. Putting the textarea ....read more

Friday, May 20, 2011

Debugging PhoneGap and JavaScript

This is a "reprint" of a guest blog post on the PhoneGap blog, by our resident PhoneGap expert, Hiedi Utley.  Hiedi tackles debugging JavaScript on PhoneGap.

If you have ever written any JavaScript and tried to get it working on a mobile phone then spent hours banging your head against the wall because it just doesn’t work, this post is just for you. Today, we will be looking at ways to troubleshoot, diagnose, and debug your mobile web project. While I will be focusing on debugging interactions with PhoneGap, the strategies outlined here are really applicable to any JavaScript or mobile web project. Since I have been focusing mainly on iOS development, this post will discuss the debugging of JavaScript and PhoneGap within an iPhone application but the same ideas should work for Android and other platforms as well.

Read more..

Monday, May 16, 2011

Spock It Like You Mean It!

This post was just put up on the blog of one of our architects, Anatoly Polinsky.  Anatoly has a playful take on Spock, a Groovy testing framework, and specifically, abotu connecting Spock with Spring and DbUnit.


So here we go.. Yesterday night we hacked our way into The Ancient Database where besides the data about ancients themselves, we found incredible stats about many different living species of all the planets ancients traveled to.
So what do we do now? Well, we need a way to query/read this data. So we asked Sam to develop a reader ( ancients called it a ‘DAO’ ) to find a number of living species on each planet since the “beginning of time”.
So she did, and called this “species reader” a ‘SpeciesDao’.
We, of course, trust Sam. But in ancient technology, trust is always based on challenging the assumption by testing all the possible permutations. So we are calling Mr. Spock to help us out…
Sam of course used a well known ancient technique ( code name: Spring Framework ) to create a “species reader”, so Mr. Spock will use all the goodies of this technique to inject all the dependencies ( e.g. data source, a reader itself, etc.. ) for a test.

Read more...



Sunday, May 1, 2011

Digital Philadelphia: A vision of Philadelphia as a regional technology center


Here's how to make it happen, says former CTO Allan Frank

By Todd R. Weiss

PHILADELPHIA – (Editor's note: Allan R. Frank, the former CTO of the City of Philadelphia, was scheduled to speak here last Thursday at the 6th annual Emerging Technologies for the Enterprise Conference (ETE). A sick child at home, however, canceled his plans for the day. Frank was kind enough, though, to talk with me by telephone to describe his vision for technology in Philadelphia – which was to have been the subject of his talk. Here are his thoughts.)

From July 2008 to this past February, Allan R. Frank worked as the City of Philadelphia's first-ever Chief Technology Officer (CTO). Yes, the city has maintained a separate Chief Information Officer post for a long time, but the CIO is in charge of the city's IT systems and staff and running IT for its government agencies and processes.
Instead, Frank was brought in to help find ways to use technology to make the city a better place to live, work and do business. His vision, he said, was to find ways of using technology in the city to bring business people, educators, residents and other movers and shakers together in the common good.
Frank took the CTO post after talking with Mayor Michael Nutter and convincing Nutter that someone was needed to help connect the area's technological capabilities with the issues that were central to the mayor and the city. To Frank, that meant showing Nutter how a technology-focused CTO could help the city solve its most pressing problems, from economic development to solving poverty to improving education and more.
Frank said he explained to Nutter how technology could have an impact on a wide range of issues, but that someone was needed to lead the effort.
"I started explaining to the mayor that I saw a tremendous opportunity for the city to take its place as a cornerstone of a regional technology center," he said. By bringing Frank in as CTO, he told Nutter that the mayor would finally have someone "sitting at the table to focus on all of his goals."
"The mayor obviously shared my vision around the opportunity for how technology plays a role in everything in a city," Frank said. "He saw the importance of that outside role."
Frank's vision was to continue what Philadelphia has always been – a city of firsts. Since the 1600s, the first library was set up here, as well as the first hospital, bank, library, medical school and computer – ENIAC.
With that history in mind, Frank said he envisions the city as the "ground zero" for the next wave of technological innovation in the U.S.
"My vision of what I call 'Digital Philadelphia' is asking the question, 'what should it be and what should it look like? This city must be the national model for urban transformation to the 21st century knowledge economy."
The tools are here in the region to make it happen, including such things as an urban core that has been again attracting young people to move downtown and work in the city, he said.
"We're also the home of Comcast," he said. "We could be the next Silicon Valley."
Much of Frank's ideas for the city were born, he said, after President Obama took office, nurtured by Obama's ideas of creating broadband stimulus efforts to help cities expand their technological infrastructures and abilities.
"In the 1960s, Philadelphia was manufacturing textiles," Frank said. "Today we should be talking about putting in fiber networks and technology parks."
There are 154,660 people employed in IT occupations in the Philadelphia region, employing 7.4% of the area's total workforce, he said. That gives the area the 6th
largest concentration of IT workers in the U.S.
Adding to the region's allure as a burgeoning tech center are the world-class universities here that train qualified technical people, he said.
"What about developing tech economic development zones around the city, buildings that are pre-wired for 1-gigabit networks and many more innovations?" he said. "I was trying to frame this vision of Philadelphia as this zone of network incubators, and setting up better ways to work with local tech community."
All of these things have been part of the regional discussion after he joined the city in 2008 and they will continue to be pursued even after he departed from his post to head back into private industry, he said.
"Government can't make all of this happen," Frank said. "It takes the community at large. And it takes the government to be supportive. Digital Philadelphia needs to have executives, citizens and tech companies involved."
Now all of those ideas will be the responsibilities of others. Frank, who has more than 35 years of experience in technology and business leadership, left his CTO role in February to return full-time to The AKA Group LLC, a strategic consulting firm that he founded.
Frank remains, however, on a steering committee to help continue these efforts and he believes in the city and the area, he said. His passions and energy will continue to help push for these changes, he said.
"Over the last couple of years, you can feel the energy here," he said. "Our kids should be staying here in Philadelphia to create for technology companies" so we need to help create a vibrant tech community here to employ thousands of people. "The future of the world is cities."
The power to make it all happen here is right in the region's hands, according to Frank. "What we really have to do is create a freaking wave."

Todd R. Weiss is a longtime technology journalist who worked as a staff writer for Computerworld.com from 2000 to 2008. Now a freelance tech journalist, Weiss contributes regularly to Computerworld, PCWorld.com and other publications. He has also written extensively for Linux.com, ForecastingClouds.com and TechTarget on a wide range of enterprise IT topics from Linux and open source to disaster recovery, cloud computing, virtualization, application development, IT education and mobile and wireless technologies. He began writing about computers in 1996 after a newspaper editor he worked for told him that "no one cares about technology." Apparently, the editor was wrong. Follow him on Twitter.com @TechManTalking or contact him at toddrweiss at gmail dot com.

Thursday, April 28, 2011

Meet your future bosses: Meet the girls of TechGirlz.org


By Todd R. Weiss

PHILADELPHIA – Yes, the halls here at the 6th annual Emerging Technologies for the Enterprise Conference (ETE) are filled with software developers, business people and technology visionaries.
But if you looked a little deeper, you might have met your next boss – and she could still be in elementary school.
In a conference room here this morning, nine girls – ages eight to 15 – met with two visionary women in technology who delivered the keynotes for the event – Stormy Peters of Mozilla and Molly Holzschlag of Opera Software – to get advice, encouragement and
support in pursuing their youthful interests in computers.
The girls were invited to visit by TechGirlz.org, a Philadelphia-area non-profit group begun two years ago to encourage young girls to explore their love of technology even when they think it's too geeky to pursue.
So who are the girls of TechGirlz?
They are young women like Eliana, 12, who one day decided she wanted to create a video game. First she began creating a site for the game using HTML, then she realized she needed to use a programming language to build it correctly. She chose Python after attending several technology camps and talking with others to gaining their expertise.
"I started by teaching myself HTML then I started learning Python," said the bright-eyed girl with braces, hot pink pants and long, curly dark hair. "What got me involved was that ever since I was really little, I was always attracted to video games and computers."
Since then, she's been working hard to further develop the game and continue to add features. She's even exploring the idea of releasing it as an open source project, but she said she's not sure she wants to give up control of the project.
Yes, I did say she's 12.
And those code camps that Eliana's been going to? They're with students who are in high school and college, yet there she is coding with the best of them. "I'm still kind of more like an amateur," she said.
Yeah, right.
I know of companies out there who are desperate today to find and hire good Python coders and here is Eliana, a 12-year-old who is building her own video game from scratch.
Classic.
Then there's Olivia, 12, in a pink shirt and ponytail, who loves to do art and design work on her computer, "making it go from clunky to smooth and shiny."
There was Megan, 13, who said she'd like to find ways of helping to add emotional context to online chat and other electronic communications. The problem, Megan said, is that it's hard to know what people are feeling when they are communicating using chat – are they mad at you or are they happy with you, she wondered? That's a great problem to solve.
Ten-year-old Kayla had another concern – she created a Web site for her business - making healthy homemade doggie treats (www.kaninekookies.webs.com) – and sometimes the technology overwhelms her, she said.
Haley, 8, is on her school's robotics team and likes to use computers.
Meanwhile, Logan, 15, also likes robotics and learning about how to make the devices operate. "It can be frustrating figuring out how to make them do something," she said.

So what advice did Peters and Holzschlag have for the girls?
First, Peters said, if the girls feel overwhelmed by the technology, she reminded them that it's not due to any shortcomings of their own.
"It's not you," Peters said. "It's the way that the people who are telling you about it are talking about it. I always think it's the fault of the person who's trying to tell you about it [if they can't explain it better]."
Asking lots of questions is a great way to learn, Peters added, lauding Olivia for asking what CSS Zen Garden is all about in the field of Web design.
"If you're brave enough to ask what CSS is at a technology conference, then I guarantee that 80% of the other people in the room are also wondering what CSS is," Peters said with a laugh.
Whatever they choose to do as they continue their educations, Peters encouraged the girls to follow what they are interested in and not give up on their dreams of pursuing a technology career.
"What frustrates me is that women are missing opportunities in a fantastic field," she said. "I started in technology because I really liked what computers could do. Now we have computers that can help blind people read, that help people find a movie, that enable people to get jobs and more. I just found computers fascinating and being able to make … them do what I wanted to do was another part of that."

Holzschlag got involved with computers by accident, she said. She was studying Spanish and linguistics at the University of Arizona when she suddenly had to drop out of school due to a long-term illness. For 10 years she was home-bound.
One day, a cousin send her an old Commodore 64 computer and a friend sent her a 300
baud modem. She hooked it all together and went online using an ancient dial-up service back in 1988.
Suddenly she went from home-bound and being isolated to joining a global community, years before the Internet ever appeared, she said.
"It was in that moment that I logged on and saw people from around the world," Holzschlag said. "I didn't know what I was looking at, but I knew that was 'it.'"
She's been involved in technology ever since.
"My life changed … because of that Commodore 64 and a 300 baud modem that somehow came into my life,"she said.

Those are the kinds of messages that TechGirlz.org is working to bring to young girls in the area, said Tracey Welson-Rossman, director of marketing and sales at Chariot Solutions, the Fort Washington, Pa.-based software development consulting company that hosts the annual ETE event.
Welson-Rossman, the founder of TechGirlz.org, said the group's work started last September when groups of 15-20 girls would come to participate in lectures, discussions and demonstrations of technology so they could gain exposure and increase their curiosity about high-tech topics.
The idea is to expose tech-minded girls at a young age to women who are working in technology so they can be inspired and empowered, Welson-Rossman said.
"We've seen research that says that the reason that girls drop out of pursuing technology interests starting in ninth grade in high school is because they think it's geeky," she said. "They think it's not creative. They think you're working in a cubicle and not talking to anybody."
To battle those stereotypes, TechGirlz strives to get to them early and show them how exciting, gratifying and worthwhile technology jobs can be. "One of the other issues is that they think it's not cool for girls to be in technology. And because of that they feel that they can't actually express that they actually like technology."
"So one of our goals is to create a safe place for them to be able to express this part of their personalities, of their interests," through TechGirlz.
About 100 girls are involved in the program so far. TechGirlz is growing its program by making connections with teachers and schools in the metropolitan Philadelphia area and through communications with home-schooling organizations, Scouting groups and others.
Men in technology are also welcome to volunteer and help with the TechGirlz program, Welson-Rossman said. "We also want men to be involved because we need to show all types of role models. These girls are going to be working with men."

Todd R. Weiss is a longtime technology journalist who worked as a staff writer for Computerworld.com from 2000 to 2008. Now a freelance tech journalist, Weiss contributes regularly to Computerworld, PCWorld.com and other publications. He has also written extensively for Linux.com, ForecastingClouds.com and TechTarget on a wide range of enterprise IT topics from Linux and open source to disaster recovery, cloud computing, virtualization, application development, IT education and mobile and wireless technologies. He began writing about computers in 1996 after a newspaper editor he worked for told him that "no one cares about technology." Apparently, the editor was wrong.

If you hold an Emerging technologies for the Enterprise conference in Philadelphia, people will come


Here's why they do attend – for learning, for new ideas, for meeting peers

By Todd R. Weiss

PHILADELPHIA – Almost 500 attendees from all over the U.S., and some from as far away as India and Sweden, are here at the 6th annual Emerging Technologies for the Enterprise Conference (ETE).
What attracted them to attend this year's two-day conference?
And what have they taken away so far?
For Michael P. Redlich, a senior research technician for a U.S.-based petrochemical research organization, this is his fourth year in a row as an attendee.
"It's basically just the wealth of information that's out there, especially in the area of emerging technology," he said. "I never heard of the Akka platform until today so I went to see what it was about. It turned out to be about cloud computing. There's just so much to keep up with that it's hard to keep current."
That's where conferences like this one are a boon, he said. Redlich, who runs a Java user's group and uses the enterprise open source Spring development platform, said he also attended a session on Spring and came out with useful new ideas.
"There were some new things in there that I wasn't even aware of," he said.
Amir Tahvildaran, manager of systems and applications for Drexel University's Math Forum and Goodwin College, said attending the show helps him stay connected to the latest enterprise software developments.
"It's good to keep up on the newest things and technologies that you don't have time to keep up with at work," said Tahvildaran, who is here for his fifth ETE conference. "I hadn't heard of several mobile technologies, such as PhoneGap, or the Arquillian integration testing [tools]."
As Drexel looks at getting involved in more mobile projects in the future, these kinds of technologies could be very useful to explore, he said. "It was nice to come in here. People talk sense about why you would get into mobile."
Linda Kaiser, a IT manager for a Philadelphia-based investment company, was at ETE for the first time.
"I'm here because in my role [as the leader of a small R&D group] I'm generally interested in emerging technologies," Kaiser said. "We are very interested in the mobility topics that they have here at the conference."
One of the best sessions she attended, she said, was about "intentional emergence" and what large, monolithic enterprises can learn from the Web and from open source communities.
Presented by Jim Stogdill, a senior director of architecture innovation with consulting firm, Accenture, the session dove into the visible shifts in organizational structure as our society continues to move from the Industrial Age to the Information Age.
Stogdill talked about "how it impacts real organizations that are used to doing things from the top down" instead of in the reverse, Kaiser said. "We have been using Agile software development methodologies for several years now with varying degrees of success. Some of that has to do with the need for the organization to shift. There are definitely some interesting sessions here."
Steve Gass, a Web developer for Armstrong World Industries in Lancaster who is attending his third ETE show, said he's already learned some intriguing things to take back to work.
"I got a lot of insights into the mobile platform" and how businesses can find ways to connect with customers, Gass said. "It's something I'm just starting with" in his job.
One of the best things he comes away with, he said, is the wide range of ideas he hears from presenters and fellow attendees from a wide range of companies.
"I come for a lot of both technical insights and philosophical insights," he said.
Bruce Momjian, a database architect with EnterpriseDB, said he's been coming to the ETE conference for four years from his home in nearby Newtown Square, Pa., because the topics covered here are things he doesn't deal with every day in his work.
"What's neat for me is that this is a conference that is not in my specialty," he said. "When I come here, I learn about new things, like [the programming language] Erlang and about how to write mobile apps in a Web browser. The cool thing for me is that I get more out of this conference than I do just about anywhere else. It's a different stack."
Another key benefit of the ETE conference, Momjian said, is that it truly highlights some of the best technology innovations being developed right here in his backyard in Philadelphia.
"I learn about what everyone else is doing plus I get to develop working relationships with tech people in the area," he said. ""This gives me a chance to really be visible and to get to know a lot of the movers and shakers in our area. We have a lot of tech people here in Philadelphia, but we didn't have anyone to bring us together until now. That's why I think this is a core conference. I get so much out of this."

What were your reasons for attending this year's conference?
And what did you get out of it?
Please share your stories and lessons learned here in the comments section of the blog below.

Todd R. Weiss is a longtime technology journalist who worked as a staff writer for Computerworld.com from 2000 to 2008. Now a freelance tech journalist, Weiss contributes regularly to Computerworld, PCWorld.com and other publications. He has also written extensively for Linux.com, ForecastingClouds.com and TechTarget on a wide range of enterprise IT topics from Linux and open source to disaster recovery, cloud computing, virtualization, application development, IT education and mobile and wireless technologies. He began writing about computers in 1996 after a newspaper editor he worked for told him that "no one cares about technology." Apparently, the editor was wrong.

Wednesday, April 27, 2011

In a new world of tablet computers and smartphones, on-screen buttons are passé


Design expert: Pay attention to the new rules of designing for touchscreens

By Todd R. Weiss

PHILADELPHIA - As software developers design how the next generations of apps will look and work, they need to transform their ideas about how to best put useful content on the shrinking device screens being used by consumers.
That's because tablet computers, smartphones and other handheld mobile devices dramatically change how consumers can view content on screens that are much smaller than traditional desktop displays. Those differences call for a move away from traditional desktop on-screen buttons that simply don't work well on smaller screens.
What's needed instead, says Josh Clark, an iPhone app consultant and founder of app design firm Global Moxie, is for app designers to carefully focus on the content itself so they can visualize and truly find the most relevant ways to display it.
In a thought-provoking presentation here today at the 6th annual Emerging Technologies for the Enterprise Conference (ETE), Clark described why "Buttons Are A Hack: The New Rules of Designing for Touch."
"When you remove the mouse and keyboard … all that remains is you and the device," he said. That approach gets to the core of the connections between users and their touchscreen devices because they must use the tactile emotions of touch to find what they are seeking. The problem, though, is that not all touchscreen apps today allow users to truly explore touch natively, he said.
One example of this, according to Clark, is the ABC News app for the iPad, which features an Earth globe that can be "spun" with a fingertip to move from story to story for viewing. The problem is it's built for show and doesn't make it easy for users to find the content they are seeking, he said, partly because it only displays two stories at a time in the main screen and there's no usable index.
"It's actively upstaging the content," Clark said. "Whiz-bang graphics don't help us find information. More attention is given to the contraption than to the content."
A better, more intuitive and cleaner approach comes from The New York Times Editor's Choice app for the iPhone, which favors function over form. Instead of trying a flashy, tech interface, the app displays New York Times content in a form that appears like a newspaper page. Critics, of course, panned the interface as boring and traditional, Clark said, but experiments by other designers found that too much change can also be a turn-off for consumers.
Because the New York Times' online brand has been around now for more than 15 years, it's instantly recognizable as a brand to online readers, Clark said. And rather than rework it with an entirely new look and feel, research found that that connection is a boon because it keeps the Times familiar and comfortable for readers.
The lesson learned?
"Don't underestimate the power of hum-drum as you go out and design interfaces," Clark said. "Old ideas are not necessarily old-fashioned."
Another key for app design is to match the touchscreen capabilities to the content you are producing, he said. If the app is for displaying the content of a print magazine, then keep the tactile feel of the paper magazine in mind – visualize how the pages turn and feel so you can keep your users "connected" to the physical magazine as they explore its online content. Automated "page flips" can be a good feature to use, as they allow the user to "see" the pages turning as they read the content, but make the pages turn quickly so you don't lose readers, he said.
"Page flips are window dressing for sure, but they reinforce that you are reading a newspaper or magazine or book," which provides context, connection and familiarity, Clark said. "And familiarity and intimacy invite touch. If you're going to make it look like a book [or magazine] then you have to make it act like one."
That's not always done in app designs, and it needs to happen more, he said.
Even Apple's own calendar app for the iPhone isn't intuitive enough due to its design, according to Clark. Where a user should be able to "swipe" a finger across the calendar screen to turn a page, it's not possible. Instead, they have to click an arrow to move a page ahead or backward.
That's just not right with touchscreens, he said, because they invite intuitive actions such as touching, tapping, swiping – at the expense of those outmoded buttons. "You see this [disconnect] all over the place" in recent app designs, he said.
"Just enough is more," Clark said, accentuating the idea that design just for the sake of design is not enough. The content delivery of today's apps need to focus on the users and how they want to access information through their fingertips and touch.
"Watch a toddler use an iPad," he said. "They just use it. So design for humans. Design for direct interaction. Design for toddlers. Think about how kids would use the app."
All of this is still evolving, Clark said, as touchscreen app development remains in its infancy today. "We're only a year into mainstream tablet app design. Don't assume that anyone else has it nailed yet, especially the big guys."
That means it's great to watch what other app developers are doing, but don't immediately jump in to follow them – they could have gotten it all wrong.
"It's very early and it's dangerous to lock in on half-baked convention" just because you see others doing certain things so far, he said."Understand that you won't get it right the first time and don't give up."

Todd R. Weiss is a longtime technology journalist who worked as a staff writer for Computerworld.com from 2000 to 2008. Now a freelance tech journalist, Weiss contributes regularly to Computerworld, PCWorld.com and other publications. He has also written extensively for Linux.com, ForecastingClouds.com and TechTarget on a wide range of enterprise IT topics from Linux and open source to disaster recovery, cloud computing, virtualization, application development, IT education and mobile and wireless technologies. He began writing about computers in 1996 after a newspaper editor he worked for told him that "no one cares about technology." Apparently, the editor was wrong.