Naked Objects Programming: Bounded Classes
In this screencast we’re going to continue looking at domain object properties, building on the first post in this series.
We’ve already seen how Naked objects allows us to write supporting validateXxx() and choicesXxx() methods which we can use to limit the set of values that can be taken for a property, (eg “visa”, “mastercard” or “amex”). But suppose there were two different classes that both had the same rules? That would suggest there’s a concept missing from our ubiquitous language (eg PaymentMethodType). What the values then represent are the bounded set of instances of that type (just like an enum).
So in this screencast we extend the previous example and replace a simple string property with one that references a new bounded (entity) class. And that sets us up to start pushing functionality onto it.
PS: By the way, in these screencasts I’m mostly using the Naked Objects drag-n-drop viewer. But if you want to retrace my steps you should find it works just the same with the HTML viewer too.
Posted on October 23, 2009, in apache isis. Bookmark the permalink. 2 Comments.
These screencasts are very handy. While implementing the Naked Objects pattern in php I am borrowing from the Java NO Framework and you’re keeping me on the right track. Thanks.
Thanks, Giorgio.
I have a ton of these to do, but I’m aware I also need to start adding some other content because one of the objectives of the blog is to provide further resources for those that have bought the book, and none of these screencasts show anything that isn’t already covered in the book. Depending on how fast you’re going on implementing your own NO framework, it’s unlikely I’ll get around all the corner cases in time.
Mail me offline if you want the inside scoop on any of the design decisions we took as you work on your implementation.
Cheers
Dan