Collective Intelligence in Action

Don’t you hate it when you spend months (or years) working on a pet project / book / mad take over the world idea, then somebody comes out with something even better?

Yep, it’s just happened to me. Years working on the idea of the ‘Wisdom of Crowds’ (even prior to web 2.0 in the shape of Red-Piranha). Month’s working on a Masters Dissertation on applying Web 2 techniques to the Finance industry (pdf link). And somebody comes out and does it even better.

Not just better. But much much better.  The sort of better as in ‘If I had this earlier, I’d have just copied it and changed the words around a bit’. The book is available from Manning as ‘Collective Intelligence in Action‘. A free, first chapter (Understanding Collective Intelligence) is available here (pdf).

Collective Intelligence in Action

So what’s it about? We’ve all heard about the Wisdom of Crowds idea. But what if you need to actually implement it on your website? This book shows you how to (using both concepts and practical code, as well as the theory behind all of it that I was missing). It includes

  • Intelligent, learning search, using Lucene.
  • Extracting data from blogs using web-crawling.
  • Executing Real time feedback on facebook-like sites.
  • Scalable data-mining techniques to manage the torrent of information
  • Making personalised recommendations based on all of the information.

Disclaimer:Manning provided me with a free review copy of the book – but no strings attached. And , maybe if I’m nice enough to the Author (Satnam), I can persuade him to talk about making millions using JBoss Drools and Complex Event processing in the book.

Web2 with Java:Struts2, Spring MVC, Flex, JavaFX and Google Web Toolkit

Originally posted on the O’Reilly Books OnJava blog. 

My fellow Java Developers. Two years ago I wrote an article on ‘Web 2.0 and Enterprise Java – move over Struts‘ looking at what was likely to replace Struts 1 (then and now a de facto web standard). How did our predictions fare?

Remember that article (and this one) isn’t looking for technical best, but which is going to be a best investment of your time to learn (in a mercenary commercial sense). And if you’re deciding which to use in a project , which framework is going to be easiest to support in 5 or 10 years time?

Broadly speaking, the frameworks we talk about break into two types: those that treat the web as a set of pages, and those that treat the web as a set of components (think Visual Basic, Delphi or Oracle Forms act-a-likes).

So , what has changed in the last 2 years:

  1. The rise of Spring. Not only has it gone mainstream, but the Spring MVC, Spring Webflow and Spring-JavaServerFaces are very powerful and widely used web frameworks. A sign of how things have changed is that for Sruts 1 the Spring guys wrote the integration for the (then) bigger Struts framework. For Struts 2 , the integration was provided by the Struts community. With the forthcoming Spring 3 release the framework is increasing momentum; More annotations and less XML in Spring MVC; Rest Web Services out of the box, support for Dynamic languages like Groovy and Spring Webflow becoming a more ‘just use it where you need it’ solution.
  2. Adobe Flex and OpenLaszlo – Flash graphical interfaces on the Web, built using Java. I don’t think these will be *the* mainstream choice but I do think the will be more than a just a niche. And for design led companies, nothing else (not even Microsoft Silverlight) can come close in terms of a user ‘wow’ factor.
  3. JavaFX and Applets done right (Jim Weaver has a good article on this). More of a competitor to Adobe Flash as both are rich content in the browser using an easily obtainable plugin. JavaFX will appeal to developers because of it’s Java like syntax. I hope I’m wrong, but for rich web content, would you put your money on Sun (an Engineering led company) or Adobe (an almost apple-like design led one)?
  4. Frustration with JSF (Java Server Faces). For the last 3 years I’ve thought that ‘*this* is the year of JSF. I’m still waiting not because of lack of demand (as web apps become more complicated and use more Ajax they become more like the JSF component based model). It’s now uphill for JSF as I (and a lot of other Developers) have given up. I’m still waiting for the ‘EJB 3′ moment when JSF becomes more simple and more usable. Remember , we ‘re not talking about technically best, but which is going to be in widespread use.
  5. Google Web Toolkit (GWT). Looking at it one way , GWT is JSF done right – a component based web framework , but one that is fast and has a lot of community support. Even then it took me a long while to warm to GWT – I’ve bad memories of web-components that hide their internals (remember Microsoft Interdev 10 years ago?) . What got me over the hump was thinking of GWT as a compiler not to Assembly or bytecode , but to Javascript and HTML.

How has Struts 2 got on in the meantime? I’m not sure. Remember , Struts 2 is very different from Struts 1. Conceptually it’s very similar to Spring MVC (Simple Java Beans based with configuration); Slightly easier to learn and maybe slightly less powerful than Spring (although both are more than capable for most Enterprise web applications.

The ‘I’m not sure’ bit comes from two (non technical) factors:

  1. Struts 2 hasn’t achieved the massive Enterprise developer mind share that Struts 1 did. It’s a better framework, but it’s got more competition.
  2. If you’re using Spring in the middle tier, why not have one less framework and use Spring MVC (instead of Struts 2) in the presentation layer as well?

Back to the previous predictions , how did we get on?

Scenario 1: Adding Ajax to existing Struts Applications. Use AjaxAnywhere – closest to the approach taken in the article Sprinkle Some Ajax Magic into your Struts Web Application. Despite writing this article , I see the frameworks evolving rapidly to the point where you would only take such an approach for adding Ajax to ‘Legacy’ applications.

How did we do? I’d maybe widen the choice of Ajax Libraries (to include DWR , Dojo, Prototype and others) but the basic idea of evolving rather than replacing your Struts 1 app still holds true.

Scenario 2: Need Ajax Now for a new Java Application. Use Appfuse as it gives Struts, Ajax (with DWR) and the possiblity of JSF integration now, all ‘out of the box’.

How did we do? I still recommend AppFuse, as it combines (name-your-web-framework) with Spring Hibernate(and other ORM) and Maven. However I’d now tend towards choosing Spring MVC (unless you’ve a reason to use Spring 2), given that you’re probably already using Spring in the mid tier.

Scenario 3: Medium Term. Use an implementation of JSF (either MyFaces or whatever Appfuse promotes – probably Struts Shale). Struts Shale (JSF) has so far released only ‘overnight’ builds. Apache MyFaces (JSF) tool support and Ajax capabilities are likely to improve over time. Both Struts-Shale and MyFaces are likely to play well with AppFuse , making it a safe bet for investing your time checking it out.

How did we do? Struts2 and Spring both still give you migration route to JSF. But do you want it?

So out of the creative ajax-induced chaos of 2 years ago, I see 4 or 5 clear choices in Enterprise web frameworks: Struts 2 (as a follow on from Struts 1). Spring MVC, due to the huge mindshare Spring has on the mid-tier. Google Web Toolkit , both as a natural home of frustrated JSF developers , and because who’s going to argue with the people who gave us maps and mail? Flex, because Flash apps done well just look so good. And JavaFX, because Applets-haven’t-gone-away-you-know.

In my view, we would have been delighted to have any of these framworks 5 years ago. And each (for different reasons) is likely still to be popular in 5 years time. Your missions now is to pick the one that suits your project needs.

The last Rails For All mail you will ever get, maybe

Most websites do one thing : grab information from the user, and store it in a database.

For these simple websites , using Enterprise Java is like using a sledgehammer to crack a walnut – you’re much better off using a solution like Ruby on Rails. Off course, once you go off the usual path (e.g. to implement complex business rules and workflow) things become a lot more difficult. That’s how we make a living – a post for another day.

So, if you’re a business person looking for a web site ‘that has to be done by the end of the week‘ or a technologist looking to solve the pain of ‘I can’t believe building web sites is still so difficult‘, then it’s worth checking out Ruby on Rails.

Rails for all inon

A good place to start is Rails for All, which has recently moved home to Google Groups, and. The official announcement is below.

Rails For All – No more RFA email Hello everybody, This may be the last email you will get from Rails For All. You loved our email updates you say? Well, we have created two Google groups for your reading pleasure – one for discussions and one for announcements. Good stuff. Tell all your friends.

See you there!

Sincerely,

Robert Dempsey

Founder Rails For All, Inc.

—————

Promoting Ruby on Rails to the developer and business communities

More posts on Ruby

Enterprise Web 2 Book – latest chapters (workflow,rules,search)

This an in progress draft of ‘Financial knowledge capture using Rules , Workflow, Search and Enterprise Web 2.0‘, complimenting the Red-Piranha Open Software project.


Chapter 1 – Introductionnotes

Chapter 2 – Problem Domain good draft

Chapter 3 – Red – Piranha Framework good draft

Chapter 4 – Technical Overviewdraft [new]

Chapter 5 – Financial Workflowdraft [new]

Chapter 6 – Financial Calculator and Business Rulesdraft [new]

Chapter 7 – Adaptive Searchgood draft [new]

Chapter 8 – Future Work and Conclusionnotes

Chapter 9 – Appendicesnotes


Masters / Msc in Web 2?

This post was originally titled ‘Readers Wives Questions’

Mike from Galway writes …

I read your blog regularly so I thought you might have
some insight to a specific topic i’m currently researching in GMIT,
Galway. My current research title is “An Evaluation of the Uses of
Object-Oriented Web Application Frameworks in the Irish Services
Sector”. This basically involves examining the usages of web
technology, services and SOA in service companies, such as [name]
Insurance

I’m in the process of doing a masters myself and I still haven’t got a final title for the dissertation! There are a couple of areas that I think are worth covering:

  • Does innovation stop at the firewall? How are the raft of publically available Web2 / SOA innovations going to be adopted by business?
  • Is SOA too complicated? Why has Google moved from SOAP to a more simple (but still XML-Web based) API?
  • Is Security scaring people off? Do current security solutions (based on simple human based web interactions) cut it with the more complex machine based transactions?
  • Is it a ‘Winner Takes all’? Connecting to a web service takes time and (some) money. Will there be a series of ‘mini microsofts’ in each sector, with nobody willing to (spend money) to connect to the company in 2nd place?
  • Do Business people know (or need to know) what SOA is? What is the ‘killer application’ that we have them knocking at the IT department’s door to do an implementation.
  • Are the skills widely available to do SOA / Web Services implementations? What are the preferred technologies to use?

Anybody else have any suggestions? I’m guessing that Mike would be very interested in hearing from Irish companies currently doing an SOA implementation. Email me at PaulB [at-sign] firstpartners.net , and I’ll pass any contact details onto him. Otherwise, just leave a comment!

What is Adobe Apollo?

Update: Apollo has since been rename AIR – Adobe Integrated Runtime. Personally, I Preferred the ‘Flex’ name.
What is Adobe Apollo? You know, Adobe , the people that give us the PDF reader.
Is Apollo the new Java for this Decade? Will it replace Atlas and .Net? Is Apollo an answer to problems we have in building web sites that all users can see? Will Apollo replace Ajax , Flash and plain vanilla HTML? Does it play well with Ruby and JRuby?

apollo.jpg

I don’t know. And neither does the Financial Times Tech Blog. But it does say

Adobe (and incidentally eBay) looks like it has a winner – if only the company can find a better way to explain what Apollo does.

I do know that Apollo may fix the pain of cross-platform web development. So, I’m over to the Adobe Labs site to find out more. Ajaxian has the demo. Mike Chambers (Adobe product development) has the slides. According to Mike:

Apollo is a cross-operating system runtime that allows developers to leverage their existing web development skills (Flash, Flex, HTML, Ajax) to build and deploy desktop RIA’s.

Translation into plain English:Powerful web pages,easy to build , loads of pretty colours. If it’s delivered as promised

Java and those pesky Google APIs

Recently one or two people disagreed with what I had to say about the impact that the Google, Amazon (and other) API’s will have on Java. Considering the ratio of positive to negative comments (about 3 for and 30 violently against), I obviously need to express myself in a clearer way. The link to the original post is at the end of this article, read on before you consider flaming me.

Amazon Web Services Logo

So , deep breath , here goes.

Compare the the way you develop now , with the way you built software 10 years ago. Do you remember having to manage your own memory? Or the pain of trying to deploy your software on different machines without a JVM? Or the hassle of trying to write distributed software using Corba? Or using a text editor instead of the fine IDE’s (Eclipse, Netbeans or JDeveloper – take your choice) that we have today? Would you consider building your software without a tool like Ant or Maven?

(Shudder). Things have moved on ,and I am very glad they have. Likewise, the way we develop 10 years into the future will be very different. I don’t know what the future will look like, but here’s a simple guess.

The biggest trend today is the move from software running on your computer , to software being delivered over the web. I’m not talking about the buzzwords being thrown about regarding ‘Service Orientated Architecture’ or ‘Enterprise Service Bus’. I’m talking about simple API’s that are available for use over the web today. Like the API’s and products from Google – including their Documents and Spreadsheets, and their Authentication service.

‘Everything should be made as simple as possible, but not one bit simpler’ – Albert Einstein

‘You Ain’t Gonna Need it’ – Anon, XP Mantra

As a good Agile Developer you’d probably agree with these quotes. But what if the most simple way of doing things was not to develop in Java at all? Most people don’t build their own operating system – they use Linux, Windows or OS X instead. Most people don’t write their own Java Server – they use Tomcat, JBoss or your server of choice. The pattern is the same. A small, dedicated core of developers builds the product, and the rest of us say ‘thank you very much’ and use it to get things done.

This range of ‘off the shelf’ solutions is increasing all the time , even before the online services arrived on the scene. As a Java developer , you’ve said ‘thank you’ , downloaded the latest version and integrated it into your solution. The time you save means you deliver other cool features instead. Java is very good at this ‘download and integrate’ process – not only is it a key benefit of Object Orientated Software, but Java has the widest range of solutions available (if you don’t believe me , just check out Sourceforge).

Java can also let us build our solutions (either partly or fully) around the online API’s. Java has great networking and XML handling ability already. In time this will become as normal as the idea of using a JVM. Great – we use these API’s pretty much like we do libraries today, and we can continue developing pretty much as before, right?

Wrong.

Remember, what is the most simple way of doing things? What if the most simple way of doing things was not to use Java but to use a more simple language (like Ruby or PHP) instead? Until now there were a couple of advantages that Java had over these ‘simple’ (and that’s a compliment) languages. When using online API’s these advantages disappear, or worse, become a liability.

  • Scalability and Robustness. Enterprise Java is massively scalable (it’s one of the reasons for it’s complexity). But can even you outscale Google?
  • Security. Enterprises haven’t (yet) learned to trust the security of online applications. This trust will be hard earned over time. But already you can make the argument that you data is safer with Google / Amazon / other service provider than on your average virus-ridden home PC.
  • Language Ties. To use the Java libraries you needed a JVM somewhere in your solution. Once you had a JVM , you might as well write your own solution in Java. But when the product you are extending is hosted elsewhere, you are free to code in the (most simple) language of your choice.
  • Always on. As long as you have a connection to the web, your programs can use the API’s. Scripting languages like Ruby and Python can claim to be even more portable. Not only can they run natively in most environments, they can also be deployed via a JVM if that is your choice (under the guise of JRuby and Jython)
  • Features. Need a feature that you don’t have in your scripting language? Just borrow it from Java by running in the JVM. How can Java win a ‘features arms race’ against that?

So do we face a form of developer apartheid, where a ‘hard core’ of Java Experts develop web API’s that the rest of us use via scripts? Let me know what you think. Like the original blogpost said, it may not be the end of Java, but perhaps the end of Java as we know it.