Domain-driven design (DDD) focuses on what matters in enterprise applications: the core business domain. And Naked Objects lets you build DDD applications just by writing the core domain classes, the rest of the application is taken care of for you.

This blog supplements and expands on my book, Domain Driven Design using Naked Objects, describing how you can rapidly develop and test domain applications using Naked Objects.

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.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

2 comments to Naked Objects Programming: Bounded Classes

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

  • danhaywood

    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

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>