Restful Objects spec v0.60
Work continues on the Restful Objects spec, which aims to define a set of RESTful resources, and corresponding
representations, for accessing and manipulating a domain object model.
Recent significant changes include a full description of how to use view models to encapsulate the domain entities while preserving the RESTful HATEOAS principle, and support support for blobs/clobs, in other words media types such as application/pdf, image/jpeg etc.
Feedback always welcome.
Filters don’t fire when bouncing off web.xml for error handling
Here’s a nice little gotcha for ya!
A fairly common pattern is to use a filter that wraps the (Http)ServletRequest and (Http)ServletResponse in an app-specific wrapper; this can be used to hold user credentials and state etc. In essence it is:
Read the rest of this entry
JQueryMobile demo app walk-thru
In the previous post I showed some screenshots of the simple JQueryMobile app that is hosted by the Apache Isis‘ online demo app, demonstrating one way of using the built-in Restful API. In this post, I want to look at the JQueryMobile code in a little more detail.
The app consists of a single html page, index.html, along with a number of supporting Javascript files. We start by bring in the Javascript libraries, most notably JQueryMobile and JQuery:
Read the rest of this entry
JQueryMobile on the Apache Isis’ REST API
We’re currently working towards 0.2.0 of Apache Isis (incubating), and one of the most significant new areas of functionality is the REST API that it automatically provides through the json-viewer component. As you can probably guess from the name, this viewer provides a REST interface which exposes JSON representations of the domain object models.
However, JSON representations do not a user interface make; instead the idea is that the developer will write either custom or generic UIs to consume those representations. As an example of such an app (and by way of learning a little more Javascript) I’ve put together a very simple mobile app using the recently-released JQueryMobile framework.
Updating Visual Studio project references from NuGet packages.config
(Among other things), NuGet offers an alternative way of managing project references in Visual Studio.
The usual flow is to right-click on References, and choose “Manage NuGet Packages”. The NuGet dialog then pops up, showing available packages. Once you’ve selected a package, NuGet will:
- download the package to your repository (if required)
- update the VS project file (.csproj or .vbproj etc)
- update its own packages.config file.
What if things get out-of-sync, though, eg you’ve moved your repository so that all the reference hints in the .csproj file are wrong? It’d be nice to be able to use the info in the packages.config to automatically resync the .csproj file.
Here’s one brute-force way to do this (from within the Package Manager console in VS):
DB unit testing with dbUnit, JSON, HSQLDB and JUnit Rules
In this week’s run of my TDD course, I thought it would be interesting to write a little fixture to make it easier to use dbUnit. My original thought was just to teach dbUnit about JSON, but it turns out that Lieven Doclo has done that already. So I decided to go a step further and also combine dbUnit with JUnit Rules, and provide automatic bootstrapping of an HSQLDB in-memory object store.
JMock 2.6 – JUnit Rules and automocking using an @Mock annotation
I’ve been using Mockito a lot this year at work, but I still prefer JMock. However, JMock could do with trimming some of its boilerplate, and I also thought it would be a good idea to use JUnit 4.7′s org.junit.rules.MethodRule.
I was about to go implement something to support Mockito’s @Mock annotation, but thought I’d browse the jmock.org website first. It looks like Steve and Nat are ahead of me, and that JMock 2.6 will have the sort of support I need.
Updated Apache Isis Presentations
Apache Isis Online Demo
We’ve finally got around to putting together an online demo of Apache Isis for would-be users to quickly grok what Isis is all about. If you don’t fancy reading any further but just want to play, you can find it here.
Read the rest of this entry
jQTouch and Restful Objects (Apache Isis)
I’ve started looking into using jQTouch to build a custom UI against a Restful Objects back-end hosted in UI. These are my own notes; apologies but I haven’t annotated them…
Restful Objects v0.51 uploaded
Since my last post there’s been a couple more updates to the Restful Objects spec.
Restful Objects defines a set of RESTful resources, and corresponding representations, for accessing and manipulating a domain object model. The most up-to-date version of this specification may be downloaded from http://restfulobjects.org; as of now I’m up to v0.51.
Noteworthy changes since my last post include:
Restful Objects v0.47 uploaded
I’ve just uploaded an update – v0.47 – to the Restful Objects spec, which you can download from http://restfulobjects.org.
Noteworthy changes in this version include:
- restructured the first few chapters, in particular explicitly addressing how RO spec allows client/server to evolve separately, and refining the previous discussion about resources that represent private state vs those that represent shared state
- separated out Restful Objects’ use of existing standards vs its use of custom query parameters and standard json-properties in its representations
- moved the chapters defining the domain object representations into the chapters that define the domain object resources; the hope is that it makes the document easier to follow
- added a new “Error” representation
As ever, any constructive feedback is welcomed.
Restful Objects criticism
The Restful Objects spec drew some criticism on twitter today. I’m quite happy to get feedback so long as its constructive. Of course, the ‘net being the ‘net, that ain’t always the case. Oh well. [UPDATE: the replies to this post so far *have* been constructive... my thanks]
Since 140 characters isn’t really enough to drill down into issues and concerns, I thought I’d post some of the criticism here and attempt to answer the points. It’d be nice to think I may get some comments against this post which could help develop the spec, rather than summarily dismiss it. Whether that happens, we shall see.
Anyway, on with the criticism…
More on the Restful Objects spec

Resources and Representations
Been continuing to work on the Restful Objects spec, which aims to defines a set of RESTful resources, and corresponding JSON representations, for accessing and manipulating a domain object model.
I’ve just uploaded the current draft (v0.22) up to the Restful Objects site. There have been numerous changes since the last version, not least of which is the set of resources that it defines (see left).
Another change is that the spec now explicitly indicates that it is agnostic as to the nature of the server-side state that it exposes, in that it may be used either to expose domain entities (Customer, Order, Product) or may be used to expose use cases/commands (CheckIntoFlight, CancelOrder). So, irrespective of which view you have of how to do REST, Restful Objects aims to provide useful support.
Anyway, if any of this sounds of interest, head over to the Restful Objects site to download the latest version of the spec.
Restful Objects spec – updated
Have been continuing to develop the Restful Objects specification, which aims to map a RESTful API onto a domain object model.
The restful objects site now highlights the broad concepts, but I’ve moved the main content out into a Doc/PDF so that it’s easy to edit and to print out as a single entity. There’s also a nice little diagram showing the resources defined by the spec:
Soyatec eUML Design Tool
Once upon a time I used to be a fan of the TogetherJ UML design tool (in fact, I even co-authored a book on it that sold, oh, 12 copies), and even though it isn’t fashionable these days I still think there’s a lot of value in UML as a way of expressing designs.
Anyway, for some of the documentation of Apache Isis I was looking around equivalent UML tools that offer similar capabilities to TogetherJ, preferably open source/free. The one that seems to be closest is Soyatec, which offers both a free and a paid-for edition as plugins to Eclipse 3.7 and earlier.
What I like about this tool is that – like TogetherJ – it seems to generate the class diagrams from the Java source code, offering live updates, and uses Javadoc attributes as hints for the rendering. However, it didn’t take long to run into problems.
Restful Objects
Now that we have our first release of Apache Isis out of the door, I’ve been spending some time on Restful Objects, which forms the basis of the JSON viewer within Isis.
The idea of Restful Objects is to provide a standard, generic RESTful interface for domain object models, exposing representations of their structure using JSON and enabling interactions with domain object instances using HTTP GET, POST, PUT and DELETE.
Apache Isis 0.1.2 (incubating) Released
Finally… after 5 (count them) release candidates, and a pretty steep learning curve, last week we finally released the first release of Apache Isis out of the ASF incubator.
Apache Isis is a full-stack open source application development framework, designed to let you rapidly develop domain-driven business enterprise applications using the naked objects pattern. It’s built with Maven and has a quickstart archetype to get you going quickly:
Read the rest of this entry
Apache Code Retreat, 2011
Hmm, it’s high time I did another post, so this one’s just to mention that I’m going to be attending the Apache Code Retreat this weekend, looking forward to meeting face-to-face some of the other Apache Isis committers for the first time. The retreat also includes an open-to-all unconference on the Saturday.
Also hoping to get a little guidance on how to put out a release formally. It’s high time that we released a first version of Isis from the incubator. I’ve been working steadily on the codebase and supporting documentation, as well as an archetype to get you started quickly. Next step is to get a release into the central Maven repo so that it’s easily accessible by all.
I’ll let you know how I get on.
A couple of book reviews…
About my book “Domain Driven Design using Naked Objects”, that is…
- the first review is on I-Programmer Info, not a site I frequent, but which calls itself an “online magazine for programmers”. The material there looks ok, actually, if a little heavy on the adverts
- the second review is on the BCS (Chartered Institute for IT) website. I’ve been a member of the BCS for many years, and there are lots of good specialist and regional groups here in the UK
If you’re wondering whether to buy the book then they’re worth a quick skim.