Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #23630
| From | Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: DI/wiring |
| Date | 2013-04-24 21:14 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <kl9ape$vtj$1@dont-email.me> (permalink) |
| References | (1 earlier) <MeVbt.370900$Nq4.247520@newsfe21.iad> <conventions-20130424061354@ram.dialup.fu-berlin.de> <K1Tdt.7951$X11.6815@newsfe30.iad> <accept-20130424174657@ram.dialup.fu-berlin.de> <accept-20130424203914@ram.dialup.fu-berlin.de> |
On 24/04/2013 20:41, Stefan Ram allegedly wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> Thanks for your helpful answer! I might still continue to
>> use »accept« sometimes, but I see your point.
>
> It might have to do with the following aspect:
>
> The contract of the object O says:
>
> »Before the other methods of O can be
> used, the method
>
> acceptRunnable( java.lang.Runnable )
>
> has to be called once with an object
> implementing java.lang.Runnable.«
>
> (Similar contracts apply often to the
> classes I write in such cases.)
>
> Nowhere does the contract say that a
> »property Runnable« exists or is set.
>
> A perfectly fine implementation of
> »acceptRunnable« might be:
>
> public void acceptRunnable( final java.lang.Runnable runnable )
> {}
>
> The client cannot observer what the object actually does
> with the runnable object. Therefore, »setRunnable« might not
> be an appropriate name for such a method.
>
But Shirley, the object's contract specifies what it does with the
Runnable and when it does it, does it not?
Also, what is the contract of the acceptRunnable method itself? Does it
have side-effects?
--
DF.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: DI/wiring Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-04-18 09:32 -0700
Re: DI/wiring Lew <lewbloch@gmail.com> - 2013-04-23 23:32 -0700
Re: DI/wiring Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-04-24 09:44 +0200
Re: DI/wiring Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-24 09:19 -0300
Re: DI/wiring Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-04-24 08:40 -0700
Re: DI/wiring Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-24 13:05 -0300
Re: DI/wiring Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-04-24 21:14 +0200
Re: DI/wiring Joerg Meier <joergmmeier@arcor.de> - 2013-04-24 20:13 +0200
Re: DI/wiring markspace <markspace@nospam.nospam> - 2013-04-24 14:22 -0700
csiph-web