|
Re: questions about the manager: msg#00017lang.perl.modules.dbi.rose-db-object
(This wandered off-list due to poor Gmail-wrangling by me. I'm sending this along just so it'll be in the archives.) On 6/2/06, Guillermo Roditi <groditi-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: >On 6/2/06, John Siracusa <siracusa-mn4gwa5WIIQysxA8WJXlww@xxxxxxxxxxxxxxxx> >wrote: >> On 6/2/06, Guillermo Roditi >> <groditi-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote: >>>> I get the meta part (I actually typed that exact method name in an >>>> earlier email before I revised it) but then why is there a need for >>>> two helper methods? Wouldn't setting that attribute simply change the >>>> behavior of the lone insert_or_update() helper method? >>> >>> yeah thats exactly the idea. it means old code becomes instantly more >>> efficient for mysql simply by setting the flag to true, which is done at the >>> class level with the rest of the config. so youwould do it when specifying >>> your classes and then thats it. the loader could technically do it for you >>> as well. >> >> Yeah, but since you have to import the helper anyway, you get the same >> effect by importing the one with dup-key-update in your class, or your >> common base class, or wherever. Basically, I don't see a need for the >> meta->... attribute since the act of choosing which helper to import, >> and where you choose import it (e.g., in one class only, or in a >> common base class) already controls how and where it applies. Can you >> give me a scenario where you can do something with the meta attribute >> that you can't on helper import? > > Ahh, i get you now. It's unfortunate that the insert_or_update() is in the > helper rather than in the main class though as that would have fixed this > problem. I like to keep the main class clean, since every new method creates a new potential conflict with a column accessor name (meaning the column would have to be explicitly aliased, which is annoying to do and which the loader won't do for you...and can't really do in a sane way, short of adding numbers to the end of the method name or something similarly silly :). Since making a common base class is the recommended practice anyway, I don't think importing all the helpers you want to use in that one place is an undue burden :) -John
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: questions about the manager, Guillermo Roditi |
|---|---|
| Next by Date: | Rose::DB::Object subclass instances within Safe compartment, Ethan Rowe |
| Previous by Thread: | Re: questions about the manager, Guillermo Roditi |
| Next by Thread: | Preview of Rose::DB::Object 0.73, John Siracusa |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |