Re: How to return an empty aggregate
- From: george.priv@xxxxxxxxx
- Date: Mon, 7 Apr 2008 13:23:35 -0700 (PDT)
On Apr 6, 4:04 pm, Maciej Sobczak <see.my.homep...@xxxxxxxxx> wrote:
On 6 Kwi, 09:00, george.p...@xxxxxxxxx wrote:
You receive the events for logging but you don't want
5,000,000 records of the same to go in when some device malfunctions.
You rather want first 10, and something stating that this is serious
condition, etc. Is there a way to use stateless adapter or you have to
have a context?
There is a way to have a filter Log that feeds its selected output
into another Log'Class - and that second Log object can be whatever,
including empty null log.
Hint: essentially you want some Ada equivalent of the following pipe
construct:
$ someprogram | head > somefile.log
which in some particular case might become just:
$ someprogram | head > /dev/null
as opposed to direct:
$ someprogram > somefile.log
or:
$ someprogram > /dev/null
The presence of "head" filter changes nothing in the applicability of /
dev/null - that's why, in Ada terms, it can always have the same
implementation:
type Null_Log is new Log with null record.
--
Maciej Sobczak *www.msobczak.com*www.inspirel.com
I think you misunderstand. I am not questioning value of the concept
of adapter in general. My point was that value of adapter (strategy
if you wish) with no context is approaching 0 and my example was to
demonstrate precisely that point.
G.
.
- References:
- How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: Robert A Duff
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: george . priv
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: george . priv
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: george . priv
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: george . priv
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- Re: How to return an empty aggregate
- From: george . priv
- Re: How to return an empty aggregate
- From: Maciej Sobczak
- How to return an empty aggregate
- Prev by Date: Re: Ada.Strings.Bounded
- Next by Date: Re: delay until problem in Windows
- Previous by thread: Re: How to return an empty aggregate
- Next by thread: Newbie Questions
- Index(es):
Relevant Pages
|
|