where to put SQL queries in a widget - init() or run()

Hi,

rather small but nevertheless a valid "best practices" question:

I’m building a small widget that runs a couple of big SQL queries to calculate some data, then print it nicely in a box.

Now, shall I put my SQL in run() instead of in init() for some reason? If so, what shall be a good reason for this? To my mind, its a bit cleaner if the output is simply gathered and formatted on run(), but prepared in advance in init().

TIA!

Boaz.

If you don’t use beginWidget() and endWidget() methods, then there is no difference, but I agree that run() should only render prepared data.

thanks.