Skip navigation

Category Archives: Uncategorized

SpringSource recently released version 3.2.1 of the Spring framework. I switched from 3.2.0 and found my Maven builds were failing. It seems some of the dependencies between Spring modules/projects has changed. 

I had to make explicit mention of the spring-web and spring-jdbc projects. spring-web has the RequestMethod and RequestMapping classes I needed and spring-jdbc had some DataSource classes.

If you are going to switch to 3.2.1-RELEASE from an earlier version you might want to dump out the dependencies first just to make spotting the missing ones easier.

mvn dependency:tree

 

Big Data is going to become important.

Big Data is getting a lot of coverage at the moment. Like the Internet before the web, it sounds great but few people can see how they can use it, especially here in Australia. I believe that is going to change quite soon.

Few argue that Big Data does not have great potential for unlocking information from raw data which until recently has been too large to actively maintain. I imagine few existing corporations can see uses for Big Data in their own organisations though. The exception to this is the link between social media and marketing, collecting feedback and targeting specific customer groups. Social media seems to be the poster child of Big Data.
Unless corporations take a step back to look at their data with a view to finding new ways to utilise it or are forced to reconsider their data because of new compliance requirements, they are unlikely to see an immediate need for Big Data solutions.

I have been a follower of Big Data for the past 12 months, I believe that Big Data could be suffering from being sold short. I see Big Data, Hadoop in particular, as a platform for organisations to adopt a more mature approach to data, not as a solution to a single problem. Such a platform makes a single source of truth possible, lends itself to integrating with existing and future systems and adds the potential of Big Data analytics to an organisation.

Cloudera are working hard to package Hadoop and it’s ecosystem in an Enterprise ready distribution. Their upcoming CDH4 release will have improved security and availability, a proper management tool and the pick of the available eco system.

In theory all data processing or storage applications could run on such a platform but the cost (in time) of managing distributed processing could prove too high a barrier to many low-latency applications.

Latency is one of the first arguments for not using Hadoop, closely following by security and ease of use. I think Hadoop is maturing enough to answer these arguments with Enterprise ready solutions.

The initial response to latency concerns is to use an architecture similar to one Oracle would have you buy, an integration of a data warehouse, a NoSQL database and a Hadoop cluster. This combines low-latency responses for known questions and a platform to allow batch processing for new or unknown questions.

I believe Cloudera are also working on adding low latency processing to the robust, reliable platform that is already available for batch processing. This is based on my observation that CDH4 includes support for alternative processors to Map Reduce, Eli Collins interview on InfoQ (http://www.infoq.com/interviews/collins-hadoop) and their reluctance at a recent event to answer direct questions on low latency processing and the increasing community interest in Storm (https://github.com/nathanmarz/storm#readme), a stream processing framework acquired by Twitter.

When Hadoop can support low-latency stream processing as well as batch processing of all data for Enterprise solutions the idea of replacing existing architectures with ones built on top of a Hadoop platform becomes a real option.

Next time you are deciding what architecture to adopt why not ask yourself if a relatively cheap Hadoop platform may be your solution.

Why trust Cloudera?

Cloudera’s offering is at the heart of both Oracle’s Big Data and IBM’s Big Insights solutions. The creator of Hadoop is one of the founders of Cloudera.

Why build applications on Hadoop?

Imagine a bank with all their data in one shared store. No longer is integration of systems required to service an individual application’s data requirements. Applications can focus on integrating data. No longer does each application have to manage its own data storage, archiving and disaster recovery.

The one shared store I refer to is HDFS, a scalable, low-cost, fault tolerant storage system that maintains itself. A storage system that has distributed processing power is the key to Hadoop’s ability to scale.

Melbourne’s Big Data community is active. What’s happening?
Big Data Analytics Conference Melbourne, 28 – 29 Aug 2012
Big Data Analytics MeetUp Group
Cloudera Developer Training for Apache Hadoop Class
Sep 25 in Melbourne

Recently 60 Minutes in the USA broadcast an article on the iPad and the significant opportunities it was presenting to children diagnosed with ASD. It heralded the arrival of a device that seemed to capture their attention and then helped them demonstrate their learning and in some cases communicate.
Throughout the article there were references to the lack of understanding by parents, teachers and journalists, as to why the iPad was so successful. This struck me as being strange as it made me ask myself if I was the only one who could see clearly many reasons why an iPad could be successful in connecting with those children.
I should make it clear that this is entirely my opinion with no evidence to back it up. However I am a software developer and a parent. I have seen both my children quickly adapt to the iPad, my youngest knowing her way round an iPhone before she was 2 years old. I feel I can make educated guesses on this subject.

Why is the iPad different?
PCs have been around for decades now, tablet computers too. Putting computers to use in education isn’t new either. Many solutions have been tried and failed. Why now? Why the iPad?
The iPad has achieved sufficient performance in three critical factors to make the tablet idea work. The iPad delivers significant power to run complex and engaging applications, it is very easy to use and is priced in a way to make it affordable to families and schools.
The significant of the three is the iPad’s ease of use. As a device it is portable enough to be positioned in front of children as easily as a book. The iPad can be used in the classroom without requiring the room to be arranged to accommodate it. It can be used at the appropriate time and packed away in a moment. This has to be a better experience than trying to position students in front of a desktop computer. It is not needlessly intrusive on the content of the class and can be used in any class not just those run in computer rooms.
Once the student is faced with an iPad its incredibly intuitive interface makes it quick to learn without much instruction. It’s visual and tactile interface mean basic fine motor skills are all that is required to operate it.
Elements on the screen of the iPad are much more like real world concepts than traditional computer interfaces. Users touch an icon to start an application. In the real world this is similar to the concept of pressing a button which children would have been exposed to and be familiar with. To count objects requires that each one be touched, this is the same action as counting objects in the real world. Add to this the motion and sound detection and engaging, intuitive application become possible.
To demonstrate to yourself the learning curve and instruction previously needed to use a PC, try explaining how to use a mouse to someone who has never used a computer!
Why did the children on 60 Minutes take to the iPad?
Quite simply, the iPad is a great sensory experience that can be placed in front of a child. Given that with a few seconds of exploration the child can be rewarded by it responding to their interaction, it is not surprising that many children would be motivated to pay attention to it. The rapid learning curve makes it easy for a child to then master the interaction so that they can pay no attention to using the device but instead be absorbed by the content.
So far this is true for any child not just those with ASD. It is my belief that the fluent control of the iPad that a child with ASD can quickly gain, without having to be instructed or ask for assistance that is new. Now a child that doesn’t seem to communicate can learn to use an iPad without the need to interact with others.
I feel a cautionary tale is necessary here to avoid being carried away by this enchanting tool. Just because the iPad is easy to use does not mean that it will be used productively. For example, when my daughter was only one year old she would play on my iPhone (very similar to an iPad). I found if I wasn’t watching her she would open every application on the phone in turn but not actually use any of them. This demonstrates the need for good applications to utilise the opportunities the iPad presents.
Why should the iPad be so good for educational use?
The iPad should be a good educational tool because of the relative ease and low cost of software development and distribution. Apple have achieved an incredible way for software developers to put their software to market with the AppStore. The booming community in iOS application developers should mean there is no shortage of developers. The limiting factor is going to be the awareness of teachers and institutions to how easy it is to translate their ideas and requirements into applications. What remains is for software developers and educators to communicate to develop these ideas. Unfortunately these are two groups that seldom meet.

A colleague asked me if I knew anything about Specification by example. I knew nothing but thought the name sounded familiar.

It was familiar. It was the title of a Manning book that I had seen in a ‘Deal of the day’ email. My curiosity engaged, I started to find out what it was about.

The idea sounded good and increasingly relevant to my day-to-day activities. I bought the book. Now the book is a review of 50 case studies into the use of specification by example. If you want technical details this is not the book for you. If you are a typical developer this is probably not the book for you. If however you are someone who can influence the requirements specification phase or just someone who wants to better their own process with the hope it will spread outwards from yourself then the book is useful …

… if you already have experience in automated testing. If not, like me the book will basically be entirely theoretical. Not great for a practitioner to use!

I know the theory of automated testing and its uses and benefits but have not been fortunate enough to work somewhere that actually uses it. For me the sticking point in applying what I have learnt from ‘Specification by Example’ is realising how to test business requirements in an automated way. I am aware of Selenium and other such web application testing tools but have never seen a test case.

So how do I get to see Specification by Example working. I need to understand Cucumber as this is a tool for testing business requirements. Oh! I guess I will need to know some Ruby to get started with Cucumber. The trouble is I am a Java developer who works for business clients on corporate machines, i.e. Windows platforms. Most clever web stuff seems to live in the realm of Linux until some helpful community member creates the Windows installer. Fortunately Git seems simple enough and even publishes a very good tutorial for SVN users.

At last some overlap between my experience and the suggested domain.

Well I have Git, which got me Ruby (with Windows devKit) and then Cumber.  Now I just need to try it all out

The problem:

This simple page highlighted a problem on a web application using Prototype javascript library and a unassuming function name.

<html>

<head>
<script src=”prototype.js” ></script>
<script>
 function next(e) {
  alert(“window id is ” + window.id);
  alert(“a id is ” + $(myA).id);
  alert(this.id);
 }

</script>
</head>
<body id=”myBody” >

 <a id=”myA” href=”#” onClick=”next();return false;”>Click</a>
</body>

</html>

It was found that this page behaved as expected in IE (v7) but not in Firefox, Chrome or Safari. The onClick handler did not appear to be called.

Well the problem is due to a name clash we were completely unaware of. next is a function that prototype.js extends html element objects with. Our onClick handler turned out to be calling Element.next instead of our global javascript function.

To see this edit the onClick code,  replacing next() with alert(next).

The onClick handler uses the <a> element as its context and looks for a function in the local context before widening its search all the way up to the DOM global context (where our function is). In non-IE browsers it finds next is a method belonging to the Element object and executes it. In IE it does not find the next method until it finds our global function.

The solution:

Add an observer rather than an onClick function.

$('myA').observe('click', next);

Why? Prototype themselves explain why IE behaves differently.

I am currently wanting to add some security to all the HTTP requests received by our application. The application is based on Spring 3 with Spring MVC controllers. I realise the best way to apply this cross-cutting behaviour is with an aspect.

Now Spring MVC supports interceptors, designed to perform just this sort of thing and the Spring minds that know advocate this simple solution (or at least Jim White does).

MVC interceptors do provide easy access to the model but only in the post handler. This won’t work for introducing security as the controller may have damaged the database inside the controller! So the remaining solution is to use AOP. Using an around method I can get to the model if it is normally an argument of the controller method handling the HTTP request.

More on how this goes when I get it working.

When trying to put together a simple Spring/Hibernate JPA application I discovered (http://maven.40175.n5.nabble.com/adding-hibernate-dependency-missing-transaction-artifact-td137166.html) that the Maven dependency for JTA is missing.

It manifested itself as the following Maven error:

Missing artifact javax.transaction:jta:jar:1.0.1B:compile

I needed to download and include it separately. Thanks to the many who have been here before.

+ Oh yes, I forgot. I downloaded it from here.

When first starting out with Spring 3 and annotations rather than xml configuration there seem to be a number of common steps that need to taken for almost any new project. Spring Roo takes many of these steps for you and avoids the need to use standard configuration and boilerplate code.

Even though you have installed STS (including Roo) you may still not find 200 key-presses gives you a working web application.  Typically, if you start developing your domain objects first, you may find that your new project doesn’t work. Before panicing or trawling through Google search results look at your database setup.

After installing MySql and then trying to run a new Spring MVC project with a very simple persistence layer, I found the following:

  • the default installation does not really support transactions. You should configure Innodb for transaction support.
  • anonymous user accounts seemed to corrupt or interfere with the account logins.

Anyway without going into too much detail I realised I needed a working project just to test my database properties and setup. So my tip is before you use configure yourself a new application to use a database, test the database is as you expect.

Problem:

In STS I right-click on my project and want to add a Maven dependency (using m2eclipse). However it seems whatever I type in the groudId no search results are found.

Solution:

Since installing STS I’ve not indexed the external global Maven repository (central – http://repo1.maven.org/maven2).

In STS, open the ‘Maven Repositories’ view and rebuild the index for Global Repositories>Central.

Just another little trap to slow down simple development.

Design a site like this with WordPress.com
Get started