You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shale.apache.org by Matthias Wessendorf <ma...@apache.org> on 2007/02/24 13:55:10 UTC

[DialogContextManager] create(FC, String)

Hi,

what do you guys think to change the method to return null, incase of
there is no dialog with the desired name ?

-M

-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: [DialogContextManager] create(FC, String)

Posted by Craig McClanahan <cr...@apache.org>.
On 2/24/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > Change isn't source compatible, so hard to justify, I think.
>
> perhaps for 1.1.x ?
>

Breaking backwards compatibility on a commonly used API like this
would normally be something I'd only want to contemplate on a major
version change.  But, for the reasons expressed in my previous message
on this thread, I'd prefer not to implement this suggested change at
all.

Craig

> > -Rahul
> >
> > P.S.- IMO, we should be porting things like typos you fixed today
> > (thanks for that) to the 1_0_X branch as well.
>
> tomorrow
>
> -M
>
> > > -M
> > >
> > > --
> > > Matthias Wessendorf
> > > http://tinyurl.com/fmywh
> > >
> > > further stuff:
> > > blog: http://jroller.com/page/mwessendorf
> > > mail: mwessendorf-at-gmail-dot-com
> > >
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: [DialogContextManager] create(FC, String)

Posted by Matthias Wessendorf <ma...@apache.org>.
> Change isn't source compatible, so hard to justify, I think.

perhaps for 1.1.x ?

> -Rahul
>
> P.S.- IMO, we should be porting things like typos you fixed today
> (thanks for that) to the 1_0_X branch as well.

tomorrow

-M

> > -M
> >
> > --
> > Matthias Wessendorf
> > http://tinyurl.com/fmywh
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: [DialogContextManager] create(FC, String)

Posted by Rahul Akolkar <ra...@gmail.com>.
On 2/24/07, Matthias Wessendorf <ma...@apache.org> wrote:
> Hi,
>
> what do you guys think to change the method to return null, incase of
> there is no dialog with the desired name ?
>
<snip/>

Change isn't source compatible, so hard to justify, I think.

-Rahul

P.S.- IMO, we should be porting things like typos you fixed today
(thanks for that) to the 1_0_X branch as well.


> -M
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: [DialogContextManager] create(FC, String)

Posted by Craig McClanahan <cr...@apache.org>.
On 2/24/07, Matthias Wessendorf <ma...@apache.org> wrote:
> Hi,
>
> what do you guys think to change the method to return null, incase of
> there is no dialog with the desired name ?
>

While you can find a lot of APIs that do this sort of thing, the
current design represents my biases on the topic lately:

* If you are looking up something that is "optional", and
  it's normal to sometimes expect that you might not find
  anything, return null.

* If you are looking up something that your application
  cannot do without, throw an exception.  The application
  can still catch the exception if it knows how to recover.

I've seen too many cases where the former approach was used, but the
application developer is faced with some difficult to diagnose NPE
later on, simply because they "assumed" the looked-up item would
always be there.  I'd rather throw the IAE directly, and tell the
developer exactly what's wrong -- also known as "fail fast" coding
:-).

Craig

> -M
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>