Matt,

So long as it works i'm very flexible. However, do take a look at the plans for improving the memory handling of zend pdf streams. Loading data from a parser, then into like 5 or 6 classes is going to suck performance (and memory) wise when using these on larger binary files.

The memory consumption used by parser/writer pairs should be close to the max-size of the file and not 5 or 6x times filesize. So keep that in mind.

Other than that, whatever works.

K
----- Original Message ----- From: "Matthew Ratzloff" <[EMAIL PROTECTED]>
To: "Zend Framework General" <fw-general@lists.zend.com>
Sent: Tuesday, April 03, 2007 12:52 PM
Subject: Re: [fw-general] Zend_Stream (was Zend_Parser)


So, I was talking with Ralph and we came to the conclusion that everything
I'm doing can be done using streams.

Ah, streams--that dark, deserted, slightly scary corner of the PHP world.

Zend_Stream_Reader seems to be a better fit, name-wise, when you look at
its derivatives.

   Zend_Stream_Reader_Interface
   Zend_Stream_File_Reader (or Zend_File_Reader?) implements
Zend_Stream_Reader_Interface
   Zend_Pdf_Reader extends Zend_Stream_File_Reader
   My_Image_Gif_Reader extends Zend_Stream_File_Reader

That way, when we inevitably come up with writers (deriving from
Zend_Stream_Writer), they correspond very obviously:

   Zend_Pdf_Writer extends Zend_Stream_File_Writer (Zend_Pdf becomes the
input stream class, extending Zend_File/Zend_Stream_File)
   My_Image_Gif_Writer extends Zend_Stream_File_Writer

Streams could then be combined in any number of ways to make reading and
writing very simple and consistent.  It also has the added effect of
promoting the use of streams in PHP.

Thoughts?

-Matt


Reply via email to