Last time round we simplified an entity inheritance hierarchy, moving the polymorphism into anonymous subclasses of a Java 5 enum. Which is great, but if there’s a lot of business logic that’s been factored out in this way, it can make the enum itself somewhat unmanageable. Moreover, we can’t easily extend or modify [...]
My last blog post, about pushing behaviour onto enum subclasses, got quite a few votes on dzone. Interestingly, about a third voted the post down, not up – though no-one left any comment to explain why they thought it was a bad idea.
So, here’s another example of using this technique, but from a somewhat [...]
In the previous post we saw how to write a FacetFactory so that Naked Objects treats enums as value types. Let’s now complete the story by also showing how to provide drop-down lists for any properties or action parameters of that type.
In the previous posts we’ve seen how to simulate enums in Naked Objects 4.0. But it’d be nice if Naked Objects supported enums natively. So let’s see how, half in this post and half in the one that follows.
What we’re going to do here is to extend the Naked Objects programming model, which [...]