command-objects

Grails Plugin: Getting all command object classes

In a plugin, I need to iterate over all domain and command object classes to apply some meta-magic to them. Getting the domain classes isn't a problem, however command objects are not that easy to get hold of, since they don't seem to be considered Grails artefacts. After browsing the docs, I came up with the following code: def doWithD...

Grails: How do you unit test a command object with a service injected into it

I am trying to test a Controller that has a Command object with data binding. The Command Object has a Service injected into it. But When I try test the command object the injected service method is never found as it is never "injected" Is there a way to mock a service inside a command object? Test method void testLoginPasswordInv...

WPF Binding Command

I'm putting a WPF application together in which I have an image control which I want to bind a custom command object to from my view model that will execute when the image is clicked. I have exposed the command object from my view model and just need to bind it to the image control. Is it possible to bind this command object to an image...

How to add constraints on inherited properties in a grails domain sub-class

Here's what I'd like to do: class A { String string static constraints = { string(maxSize:100) } } class B extends A { static constraints = { string(url:true) } } So class A should have some constraints and B should have the same plus additional constraints on the same property. I couldn't get that to work though a...