Author Archives:
Giving up on Eclipse Juno
In my last blog I posted about my Eclipse 4.2 Juno setup; as much as a reference for me in case I needed to do a reinstall as anything else.
What I didn’t talk about then was the issues I’ve been having generally with Juno. Read the rest of this entry
Eclipse Juno JEE Setup
My installation of Eclipse Juno seemed to have got its knickers in rather a twist, so just spent a “happy” hour reinstalling the damn thing.
Anyway, here’s what my setup currently consists of:
Responsibilities of the Application Layer in Domain-Driven Applications
It’s standard practice to build enterprise apps in layers: each layer has its own set of responsibilities, providing a separation of concerns. In Evans’ DDD book, layered architecture is one of his named patterns, its intent being to isolate the domain layer from the adjacent layers of application and infrastructure. The presentation layer is, of course, the other standard layer, sitting on top of the application layer:
- presentation layer
- application layer
- domain layer
- infrastructure layer
Of these layers, though, it’s the application layer that seems to cause the most difficulty, Read the rest of this entry
Drop all tables in an MS SQL Server database
Currently working on a JDO DataNucleus object store for Apache Isis, as part of an app that’s gonna be deployed onto MS SQL Server.
Since I’m using DataNucleus to automatically create the database schema, the build-debug cycle is:
- to run the app
- inspect the resultant schema
- drop all the tables
- change the domain object annotations/metadata
and then go round the loop again.
What with foreign-key constraints between tables, step (3) is not exactly trivial. So it seemed like it’d be a good idea to write a little script to simplify step (3) of the above, namely to drop all the tables in my (development!) database. Here’s what I came up with… Read the rest of this entry
Mockito-like automocking and optional autowiring in JMock
I’m running my little TDD course again, and (as usual) it’s given rise to another small idea to make unit testing easier: provide Mockito-like automocking (using a @Mock annotation), and in addition perform autowiring of all mocks into the class under test. Read the rest of this entry
Connecting to SQL Server from Java over TCP/IP
Been a while since I did this; turns out it’s easy enough.
First, you’ll need the current JDBC driver from Microsoft, which can be found here. Add to classpath as usual.
Set up your Java application to use the following JDBC connection settings: Read the rest of this entry
Updating an expired Apache encryption key
I work as a committer on Apache Isis. On setting up a new PC, I realised that I’ve forgotten my ASF committer password. I popped over to id.apache.org, but found that the “reset password” button didn’t work, failing with an “Encryption failed” error.
This post is mostly a “note to self” on how I fixed that. Read the rest of this entry
My Restful Objects talk @ DDD Exchange 2012
Every year Skillsmatter run a mini-conference on domain-driven design, and this year Eric Evans asked me to do a talk on Restful Objects.
Skillsmatter recorded the talk, Read the rest of this entry
Registering entity types with OpenJPA programmatically
I’ve just started work on an OpenJPA objectstore for Isis. In the normal scheme of things, one would register the entity types within the persistence.xml file. However, Isis is a framework that builds its own metamodel, and can figure out for itself which classes constitute entities. I therefore didn’t want to have to force the developer to repeat themselves, so the puzzle became how to register the entity types programmatically within the Isis code. Read the rest of this entry
Apache Isis and RDF – could be…
An interesting question came in on the Apache Isis mailing list, regarding Isis and its support for building apps that interact with RDF and semantic web technologies: Read the rest of this entry
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…)
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 | %{
$proj = $_ ;
Write-Host $proj.name;
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 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.