Populate: Implement preparable or richer getter approach

2010-03-30 Thread Alex Rodriguez Lopez
Hi to all, as I learn more things about S2 some questions emerge about best practices more experiences users might know how to do best. I believe it is a common problem having to populate fields like selects first thing (with data from DB or stored in session) before any task is done.

Re: Populate: Implement preparable or richer getter approach

2010-03-30 Thread Greg Lindholm
I will typically retrieve everything I need to populate the fields in prepare() and try to do it within a single db transaction. One issue with doing db retrieval from within a getter is the getter may be called multiple times which would mean repeating db queries (inefficient) or doing lazy

Re: Populate: Implement preparable or richer getter approach

2010-03-30 Thread Paweł Wielgus
Hi Alex, if i would take your code and try to change something, i would lose some time to find where this damn select options come from, of course getter would be the last place to check. That's the only real con that i can think of. Best greetings, Paweł Wielgus. 2010/3/30 Alex Rodriguez Lopez