Re: LIFO package?

From: Date: Tue, 23 Mar 2004 12:25:36 +0000
Subject: Re: LIFO package?
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-26674@lists.php.net to get a copy of this message
Tobias Schlitt wrote:
Isn't that just a wrapper around "array_*" methods? Like array_push(), array_pop(), count(),...
Yes, basically. It allows to stack things from anywhere since I'm using a static class method. This enables me to have several classes working on the same stack without having to create an object, global variable... The stack is also multipurpose, because the FIFO class manages several stacks in parallel. In my case, I'm generating a document and I'm saving the local context of font, color, cursor position and so forth in my stack. As my script goes, information is pushed to and pulled from the stack. Whenever needed, any other part of the script can get the current context to do whatever with it. So, it's very very vaguely related to the Singleton and Observer design patters. Singleton, because there is one common entry point ot the stack, and Observer because stack information is made available to any one interested in reading the stack. But the analogy ends there. -Philippe

« previous php.pear.dev (#26674) next »