[TYPO3-core] RFC #12130: Improve performance of flashmessages

Ernesto Baschny [cron IT] ernst at cron-it.de
Wed Oct 7 18:21:53 CEST 2009


Rupert Germann schrieb:
> Ernesto Baschny [cron IT] schrieb:
>> It is hypothetic for you, but I have used that method for ages and will
>> continue to do so. 
> 
> which method? the PRG pattern?
> I don't get the point where's the connection to this patch?
> 
> ....
>> So I see no real reason to remove this feature just because some folks
>> won't need it.
> 
> well, you call it feature - I call it bug.
> And I don't see a reason why we should leave in this performance break
> as there are enough methods out there which can achieve that.

The term "flash message" already implies it to survive a request. AFAIK
the term comes from Ruby where it is used exactly for that (collecting
messages to be displayed after a redirect). If we want it to behave
different, we should call it differently to avoid confusion.

It is being used that way in many frameworks and people [1] already:

* CakePHP - flash messages are implemented in the "Session" class [2]
* FLOW3 - flash message has a "session" context [3]
* Extbase - see extbase/Classes/MVC/Controller/FlashMessages.php,
backport from FLOW3
* Zend Framework - also stores flash messages in session for the exact
same reason (The FlashMessenger helper allows you to pass messages that
the user may need to see on the next request) [4]

Do you consider every one of them implemented a "bug"? If the "bug" you
are refering to is the performance of storing the message in the
database, we should solve that and not remove the functionality altogether.

My suggestion was to provide a parameter / option to only store flash
messages in the session when required, and not all. Repeating my
previous post: That way we could have "blazing fast" flash messages for
a single request (storing them in a static variable, as you did) but
still have a way to have certain flash messages to survive the request
(storing them in the BE-user session).

Cheers,
Ernesto

[1] http://blog.agilephp.com/2008/06/03/flash-messages/
[2] http://book.cakephp.org/view/400/setFlash
[3]
http://flow3.typo3.org/fileadmin/API/FLOW3/F3/FLOW3/MVC/Controller/class-FlashMessageContainer.html
[4]
http://framework.zend.com/manual/en/zend.controller.actionhelpers.html,
see 12.8.4.4. FlashMessenger


More information about the TYPO3-team-core mailing list