From: george.priv@gmail.com
Subject: Re: How to return an empty aggregate
Date: Sat, 5 Apr 2008 15:36:36 -0700 (PDT)
Date: 2008-04-05T15:36:36-07:00 [thread overview]
Message-ID: <0742cf95-b2a9-438a-98ac-318f1f1c311e@d1g2000hsg.googlegroups.com> (raw)
In-Reply-To: fb3487f9-7141-44c0-9020-b235ccc418a1@j1g2000prb.googlegroups.com
On Apr 5, 5:14 pm, Maciej Sobczak <see.my.homep...@gmail.com> wrote:
> On 5 Kwi, 18:04, george.p...@gmail.com wrote:
>
> > Can you provide non-academic example?
>
> For the empty record?
> I thought I did already. :-)
> This might be a challenge, because we have no judge that can say
> whether something is academic or not.
>
> Consider a logging system that is designed with OO in mind. There is a
> base interface with some operation(s) for logging and a bunch of
> concrete implementations for various log destinations - one for disk
> file, one for network output, one for database persistency, etc. The
> part of the program that does something useful takes Log'Class and
> feeds its log entries via given Log'Class parameter to whatever
> happens to be a concrete Log implementation - a classic strategy
> pattern.
>
> What would you do to... switch the logging off?
>
> I would create the derived (concrete) log that is *empty* and does
> nothing and pass it as Log'Class to wherever it is expected.
> It cannot be simpler than that.
So you derive concrete from not-empty type?
>
> Is it academic? I would do it at the nearest opportunity.
>
> --
> Maciej Sobczak *www.msobczak.com*www.inspirel.com
next prev parent reply other threads:[~2008-04-05 22:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-01 11:58 How to return an empty aggregate Maciej Sobczak
2008-04-01 12:54 ` Anh Vo
2008-04-01 17:18 ` Adam Beneschan
2008-04-02 7:16 ` Maciej Sobczak
2008-04-01 13:34 ` Dmitry A. Kazakov
2008-04-01 15:00 ` Robert A Duff
2008-04-02 7:19 ` Maciej Sobczak
2008-04-03 5:02 ` george.priv
2008-04-03 9:09 ` Maciej Sobczak
2008-04-04 15:38 ` george.priv
2008-04-04 20:35 ` Maciej Sobczak
2008-04-04 23:58 ` george.priv
2008-04-05 13:48 ` Maciej Sobczak
2008-04-05 16:04 ` george.priv
2008-04-05 21:14 ` Maciej Sobczak
2008-04-05 22:36 ` george.priv [this message]
2008-04-06 19:53 ` Maciej Sobczak
2008-04-06 7:00 ` george.priv
2008-04-06 20:04 ` Maciej Sobczak
2008-04-07 20:23 ` george.priv
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox