jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Daggett <jeremy.dagg...@RACKSPACE.COM>
Subject Re: Historical context of *Options.NONE?
Date Thu, 22 May 2014 15:22:55 GMT
Thanks Andrew!

I appreciate your explanation and that pattern makes sense to me. However,
I don¹t think it is necessary for the option classes that I am updating
right now.

/jd

On 5/21/14, 12:25 PM, "Andrew Phillips" <aphillips@qrmedia.com> wrote:

>> Many of the option classes in jclouds have a "NONE² field that
>> cleverly creates a default instance of the class containing no
>> options. Can anyone enlighten me on the history of this pattern and
>> why this is necessary?
>
>My best guess is that this may have been an instance of the Null
>Object pattern, so that you can do things like:
>
>public X list() {
>   return list(Options.NONE);
>}
>
>and can then implement the version *with* options without having to
>check for null options etc.
>
>ap


Mime
View raw message