On Tue, 6 Mar 2012, Sven Barth wrote:

Hello together!

I'm currently playing around with fcl-web a bit.

As I'd like to utilize inversion of control (e.g. passing things like database connections through the constructor [as one possible implementation of this pattern]) for my modules I'd like to ask whether it would be an idea

whooohoo - expensive terminology detected !!
"Inversion of Control" :-)

for a feature request (maybe even with patch) to add an "OnCreateModule" event to TWebHandler which is called inside TWebHandler.HandleRequest before the module is created using CreateNew or Create?

Well, it can only be after create. You need the instance first, and it is constructed with Create(New).

If you need to do something before that, there already is the OnGetModule 
handler.

But yes, a centralized initialization handler for webmodules is OK. Something like 'OnInitModule' or so ?

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to