Re: I/O class: how to design for special case
- From: jladd@xxxxxxxxxxxxxx
- Date: 26 Jan 2006 18:05:11 -0800
Simon,
If you ask the CFooBuffer instance to get the data itself, then pass it
to the CFoo::out routine.
The data must be coming from somewhere, so try this:
CFooBuffer::readFrom(Object source)
If the Object is a socket then handle it, if its a file, then handle
that.
This approach means:
1. You ask the CFoo class for the CFooBuffer that best suits it (which
was a requirement) and,
2. You dont expose anything about the internals of CFoo or CFooBuffer
and,
3. You dont have non-required reads/write to the CFooBuffer because its
the thing that does the reading/writing
into its own internal buffer.
I hope this helps. Keep well,
Rgs, James.
.
- Follow-Ups:
- Re: I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special case
- References:
- I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special case
- From: H. S. Lahman
- Re: I/O class: how to design for special case
- From: Simon Elliott
- Re: I/O class: how to design for special case
- From: H. S. Lahman
- Re: I/O class: how to design for special case
- From: jladd
- Re: I/O class: how to design for special case
- From: Simon Elliott
- I/O class: how to design for special case
- Prev by Date: Re: OOP phrases
- Next by Date: Re: OOP phrases
- Previous by thread: Re: I/O class: how to design for special case
- Next by thread: Re: I/O class: how to design for special case
- Index(es):