Author Archives:

Fail a Maven build when conflicting or unused dependencies

Currently teaching my Maven course, and a couple of questions have come up about how to fail a build when a pom either has conflicting dependencies, or has (through a smidge too much copy-n-paste) even just unused dependencies. Good questions both.

For the first of these, dependency conflicts, Read the rest of this entry

Further work on the Restful Objects spec.

The Restful Objects spec – a hypermedia API for domain objects models – is getting ever closer to a v1.0.0 release. Right now it’s at 0.69.0 (pdf) (yes, there have actually been 69 versions, though some of the earliest ones are lost in the mists…)

Read the rest of this entry

Updating Visual Studio project references from NuGet packages.config (2)

Here’s a small refinement to the script I wrote a while back to update VS project references from the packages.config file:

function Sync-References([string]$PackageId) {
  get-project -all | %{
    Write-Host $proj.name; 
    $proj = $_ ;
    get-package -project $proj.name | ? { $_.id -match $PackageId } | % { 
      Write-Host $_.id; 
      uninstall-package -projectname $proj.name -id $_.id -version $_.version -RemoveDependencies -force ;
      install-package -projectname $proj.name -id $_.id -version $_.version
    }
  }
}

You can then use it to update selected packages, eg:

Sync-References FluentAssertions

Apache Isis refactorings

For the last week or two I’ve been doing some refactoring deep in the bowels of Apache Isis, working on simplifying some of the infrastructure there.

One of the major changes in the next release Read the rest of this entry

Restful Objects (.NET) screencasts

For those interested in the work I’ve been doing on Restful Objects, you might be interested to see that Richard Pawson has recorded some screencasts on the .NET implementation of Restful Objects.

I’ve linked to them from the Restful Objects website.

The Apache Isis impl of Restful Objects currently lags behind the .NET impl, though not too far behind. Check out Isis’ online demo to see the current state.

Apache Isis 0.2.0-incubating released

Just a quick announcement that last week we put out our second release of Apache Isis from the incubator, namely 0.2.0-incubating.

The main theme in this release is to try to simplify things a little, so that would-be users can more easily grok what Isis is about:
Read the rest of this entry

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 Isisonline 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.

Read the rest of this entry

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):

Read the rest of this entry

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.

Read the rest of this entry

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.

Read the rest of this entry

Updated Apache Isis Presentations

If you’re thinking of introducing Apache Isis to your co-workers, you might be interested to know that Isis already has an “Introducing Apache Isis” presentation slide deck (in ODP,  PPTX or PPT, PDF slides or notes).  You are free to use this as you will.

Read the rest of this entry

Apache Isis Online Demo

Apache Isis Online Demo screenshotWe’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…

Read the rest of this entry

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:

Read the rest of this entry

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…

Read the rest of this entry

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.

Follow

Get every new post delivered to your Inbox.

Join 126 other followers