Ernest Micklei's Blog

things I create and problems I solve, to remember and share

Methods as objects in Go

In an earlier post, I discussed an example of using plain functions as objects. Today, I investigated solutions for using Methods as objects. As I understand it, Go methods are functions that are “bound” to a named type that is not a pointer or an interface. package main import "fmt" type T struct { S string } func (t T) GetS1() string { return t.S } func (t *T) GetS2() string { return t.

go-restful first working example

In a previous post, I discussed the design of go-restful which is a package for building REST-style WebServices using the Google Go programming language. Today, I completed the implementation of that package which provides the basics: Creating a WebService with Routes (mapping between Http Request and a Go function) Each Route requires information about the Http method (GET,POST,...), URL Path (/users..), Mime-types and the function it binds to Functions get passed in a Request and a Response The Request is used to access Path and Query parameters , Headers and request content (XML, JSON,.

First class functions in Go

Today, I played with functions as objects in the Go programming language. If functions are first class citizens in Go then it must be possible to store them in fields of a struct, pass them as arguments to other functions and use them as return values of other functions. So I visited for putting together a simple program that demonstrates this. package main import "fmt" func CallWith(f func(string), who string) { f(who) } type FunctionHolder struct { Function func(string) } func main() { holder := FunctionHolder{ func(who string) { fmt.

go-restful api design

I have been using JAX-RS for many REST-based service implementations in Java. As part of my journey into the Google Go programming language, I am exploring designs for such REST support using the standard net/http package in Go. JAX-RS provides a set of Annotation classes which can be used to add meta-data to classes, methods and method arguments. In JAX-RS these annotation are used to specify the mapping between a Http Request to a Java method and its arguments.

renderShark - lean application server for renderSnake

I started working on this “yet-another-web-server” project for one of the most important reasons: because its fun. I got inspired for doing this after reading about the Netty framework and all the positive reviews that people write. My requirements for this server are provide a minimal MVC framework that uses renderSnake to render HTML pages (distributed) Http session management using JBOSS Infinispan, a modern caching solution use Netty , a well-designed fast server framework which I will use for its HTTP support components are wired together using Guice, a lean dependency injection library support for a minimal feature set to run Web applications GET, POST Redirects,Forwards Sessions, Cookies Error Handling (404,500,., a showcase for renderSnake

For the past month, I have been working on a new iPad Web application that recently was launched at This application provides easy access to the complete product catalog of the Dutch online webshop Because it is targeted to owners of tablet devices such as the Apple iPad, I decided to embrace the upcoming JQuery Mobile framework (JQM), an open-source Javascript library that provides an unified UI to various mobile devices.

Getting from HTML design to renderSnake components

rendersnake is a Java library for creating components and pages that produce HTML using only Java. Its purpose is to support the creation of Web applications that are better maintainable, allows for easier reuse, have testable UI components and produces compact HTML in an efficient way. This blog post explains how to start from a carefully designed rich HTML page and create new or use the components available in the library.

Using renderSnake to build the presentation layer in Spring-MVC

renderSnake is a open-source library for creating components that produce HTML using only Java. By defining Java classes for HTML components and pages you can exploit all the language features (e.g. inheritance, composition, type-checking) and IDE tooling (e.g. refactoring, unit-testing, references search, debugging,…). In addition, renderSnake is designed to produce compact HTML in an memory efficient way. The "V" in MVC Basically, renderSnake is responsible for the presentation layer of a Web application. improved

The site gives access to the sources of open-source Smalltalk libraries and frameworks. A big advantage to developers is that they can explore Smalltalk classes without having to successfully load them into one of the Smalltalk dialect platforms. Recently, I have changed much of the Smalltalk generator and HTML/Javascript generated code. Formerly, all Smalltalk source was highlighted using a client-side Javascript library. This resulted in long page loading times because it had to iterate through all DOM elements and replace the HTML content by a post-processing (using regex) result.

Melissa for VA Smalltalk

Melissa is a simple tool that can help in building development and runtime images in a continous integration environment. It is being used extensively to create daily builds for Smalltalk images. This post describes the steps to use Melissa for VA Smalltalk 8+. The intended way to use Melissa is to start with a clean VA image, load the Melissa config app and save it as In order to tell Melissa what to build, you need to start that image passing the command line parameter “-melissa buildscript.