Monthly Archives: March 2007

Migrating to FreeMarker

… or Adding the red button

AJ mentioned that we have automated the build and release process. After spending much of the morning hearing everyone talking about wanting to push the “big red button” for a release, and hearing how it was “too hard”, to update the html, I decided to go ahead and work out what needed to happen. What an interesting world I discovered.

The webapp in need of the red button is basically a servlet which calls out to the various parts of the world (our various build ). This works fine, but sometimes gets a bit hard to maintain (ok so some things are very hard to maintain). So (rather than doing a huge change), I figured that I could drop in a templating engine, and use the servlet to merge the template. I knew that Velocity is a bit old hat now, so went for a bit of a google, and (after a short diversion into another non-maintained option), I found FreeMarker. Having heard of it in the past, and knowing that it was the tool of choice for WebWork, I thought I’d give it a go.

My first test was to create a hello world web app from scratch.

I ended up with a very basic servlet that I’ve attached.

Basically it creates a configuration:

configuration = new Configuration();

tells the config that templates are found in the templates sub directory of the current class. configuration.setClassForTemplateLoading(this.getClass(), "templates");

retrieves the template:

 template = configuration.getTemplate("start.html");

creates a map of data to merge with the template: 

Map freeMarkerData = new HashMap();

freeMarkerData.put("user", "Mr Man");

 and finally merges the data with the template: 

 template.process(freeMarkerData, response.getWriter());

The hello world spike done (at home), all I needed to do was repeat the process at work with the real servlet. Replacing the html from the magic servlet, one template at a time.

Of course the first template to be created on our deployment applet was the one with the Big Red button.

Dreyfus Model of Skill Acquisition At Ephox

I recently read PragDave's blog talking about the Dreyfus model of skill acquisition. As I am generally interested in going back to first principles, I went to the library and borrowed the book From Novice to Expert: Excellence and Power in Clinical Nursing Practice, which Dave cites. It makes for an interesting read discussing the way in which expert nurses use a mixture of intuition, and observations to come to conclusions, and to guide their treatment of patients.

The book presents the research of Dreyfus into learning, and the five stage progression of learning from Beginner to Advanced used in the Dreyfus model (Orginally mentioned in a 1980 paper by Dreyfus and ,Dreyfus ). 

  • Novice/Advanced Beginner (Advanced Beginner was added in From Novice to Expert), 
  • Competent, 
  • Proficient, 
  • Expert, and 
  • Master (not listed in From Novice to Expert), this is a state that experts enter into from time to time.

It has been obvserved that people display different performance characteristics (especially problem solving techniques) at each level. Novices use basic rules, and often struggle in working out how to best apply the rules to a situation, where as Experts often use a strong sense of intuition gained through experience to guide what they do. The concept is that as one gains more mastery in a skill, they are increasing in their ability to apply abstract rules to concrete situations.

While reading about these levels, I have been trying to apply them to Software Development, and my understanding of myself and the situation I am in currently (of course I am not the first to do so). The Dreyfus model is not the most cutting edge, and a search of will show much of the controversy about this. It does, however, seem to work for me, and has been useful in helping me understand myself and the world.

In self-reflection, I know that I would consider myself as at least nearing the expert status in some areas of software development (particularly in web development). I will often move in an intuitive way when building new features in a test driven way.

I would also see myself as being pretty close to being an expert in the use of IntelliJ. It is a great IDE that I can now intuitively use to navigate through code, write code, and improve code.

When it comes to the Ephox EditLive! codebase, however, I am painfully aware of the fact that I am not an Expert. At best I would approach a degree of being proficient, and this is mainly based on my experience in other areas.

There are probably two main reasons for my not firing on all cylenders currently. We are using Eclipse (I know that it is much closer to IntelliJ than in the past, but I am not yet thriving in this environment) I am still learning the Ephox codebase, and the specifics of this environment. Just as nurses need to adopt to different clinical environments, I am having to adapt to the EditLive! codebase, and the domain of Applet based html editing.

AJ is currently the true expert in the EditLive! codebase. He has been around while most of the code was written, has a strong sense for where the pain points are, particularly in some of the libraries we are dependant on. When working out a solution to a problem he will often use his intuition to guide where he is going with his analysis.

There is more to the Dreyfus model than a way of categorising people. There are some interesting implications for the learning strategies that people should try and apply based on what stage of proficiency they currently are at. The ways in which a beginner moves on to being a novice are very different to what will help a proficient person move on to being an expert. The general learning techniques are:

  • Novices and Advanced Beginners need to learn the basic rules, and be given feedback to help bring behaviour into conformance with the rules. In IT, Pair Programming is a great technique for this.

     Interestingly the Dreyfus article talks about a compentent person being able to the perceive the meaning phrases or aspects — such as a pilot talking about "verging on stall conditions" — and being able to respond to these aspects following guidelines. This seems to dovetail nicely in with the ideas of the pattern movement. So perhaps the advanced beginner should start learning some basic patterns. 

  • Competent people benefit from simulations that help them further develop their application techniques. Being able to apply the patterns that they have learnt, and through the use of simulations know how to apply them.
  • Proficient people learn best through case studies.
  • Experts will also learn through their experience, and continue to learn and develop their understanding, occasionally entering the state of Mastery.

I am going to be taking some of the lessons learnt form the Dreyfus model, trying to create situations where I can learn in appropriate ways. As I would see myself as at least nearing the proficient stage, I will be pushing myself towards learning through the use of case studies. For the work at Ephox this will involve questions like:

  • How did you isolate and fix a particular bug? 
  • Talk to me about the integration with Alfresco.
  •  What did you learn through adding "Track Changes" support in the editor?

I believe this will be the best type of learning for me to be doing, and the fastest way for me to move on to a better standard of performance.

Another application point is in documentation. We have a rich Advanced API, with a decent volume of documentation, but it doesn't always make it easy for people to know how to use it.  The advanced Java Developer would be looking for the examples of how to use the EditLive! API.

A final application point I wonder about is the use of the "Guideline for Reporting Critical Incidents" to help gather good case studies for developers to work with.

The Dreyfus Model of learning is a useful tool for software developers, and I think we should try and use these techniques to work towards being better developers of software.

I was pleasantly surprised to see a blog entry pop up in my feed reader mentioning subscription accounts for InvoicePlace. As I was one of the guys who helped write the code that is behind InvoicePlace (using a Java Web stack), I take pride in seeing it move closer to being a great success. InvoicePlace provides a great, simple, easy to use tool to help enter and keep track of invoices. It works really well for people and businesses send invoices, and want to be able to manage these electronically.

I've been sipping the InvoicePlace Champagne for quite a while now (it tastes much better than dog food), starting to use InvoicePlace to bill Growthbase before the name InvoicePlace had formed more than a glimmer in Scott's eye. I found InvoicePlace really useful, and expect that it will continue to grow and evolve in positive ways. Some of the features that I was able to exploit to help manage my invoicing needs in my development version were nice, and I expect that in due time they will be released and made available to the public.

I definitely have fond memories of my time working on the project, and the late nights spent adding functionality, and working hard at trying to push the test coverage and quality up. I look forward to following the continuing progress of InvoicePlace, and will use this site whenever I need to issue invoices.

Integrating EditLive!

As AJ has lamented in the past, the documentation for EditLive! is not quite there yet. EditLive! is a great product (IMHO), which is actually pretty easy to get up and running with. It was only after I started at Ephox that I realised this.

It is for this reason that I am happy to announce that we just published an article on Liveworks showing how to integrate EditLive! into a web page in 4 easy steps.

The article briefly introduces how to integrate a standard version of EditLive! into a web application. The rest of our documentation (the bits that scared me away before I started working at EditLive!), goes into the details of how to customise and configure EditLive!.

My Second Month at Ephox

After posting about my first month at Ephox, AJ pointed out that he thought my attitudes would soon change. Now that I've been at Ephox for two months, I can give some feedback.

First things first. AJ has managed to keep most of his reputation. I am writing before seeing the movie, so I reserve the right to change my mind.

I think that the honeymoon period has ended for me. I am still having a whole heap of fun, but have had some days that have been hard work. This is to be expected, and normal, so I am not about to run away (you can breath easy now Brett).

Of course things would be better if I could be coding on a shiny new Mac, and the team switched to IntelliJ :).

I have felt the pain of supporting a system across multiple operating systems, multiple JVM versions and multiple browsers (IE,Firefox Win, Firefox Mac, and Safari). To add more complicating factors, we also have people embedding our editor into PHP, ASP, ASP.Net, and various J2EE applications. The team has done a GREAT job of ensuring that EditLive! works accross the wide mix of environments, but we do run into issues from time to time. The pain comes in isolating the problems, and seeing some of the workarounds required in order to support different environments, and conflicting requirements. I have never pushed a platform's APIs as much before, or seen code that had to work as hard in order to get the desired effects.

The high point of the job for me at the moment is the creative coding afternoons. It is great being able to play and formulate ideas, and I have seen some really nice projects implemented by others (more and more should be making their way on to Liveworks). I still get real pride in seeing my code in the wild ;).

It is also great to be in an environment where we take support seriously, and strive to help customers as much as we can. I am very much learning from this, as I have never had this kind of support role before. I am happy that I get the opportunity to do some coding (bug fixes), as I am a coder, and like being able to create and write code (although some of the bug fixes have been way more involved than I would have hoped).

I am still eagerly anticipating moving into development, and look forward to the next release, after which I will be rotating out of support into a full time development role. I will be entering this with some good experience and knowledge of the codebase, and look forward to when I can write my reflective blog entry about this time.

First EditLive! post

After a bit of thrashing around, I just got EditLive! working as my blog editor with wordpress.  I'm using AJ's (currently) private wordpress integration to do this.  The lesson learnt with this is that his integration depends on not having the default visual editor enabled.

I am now a happily using EditLive! :), and enjoying the fact that I am using a pre-release version with cool new features that makes adding plugins like Heading HotKeys trivially easy.

Oops…. I’ve added value

One of the many fun things we do at ephox is a fortnightly Creative Coding afternoon. We build interesting fun little projects that scratch our itches.

  My first CCA project was to build a Heading HotKeys plug-in, which AJ has now released to liveworks. It's a nice little plug-in that (as the name suggests really) adds hotkeys for converting text to html headings.  

A feature that I missed, and now have added :).