"be consistent" | |
PerlMonks |
Re^5: Auto-Increment and DBD Agnosticismby stvn (Monsignor) |
on Jun 24, 2004 at 14:15 UTC ( [id://369368]=note: print w/replies, xml ) | Need Help?? |
It feels odd because in the case of Query and ResultSet you have the .pm files living somewhere simply because of namespacing, Maybe that is not the best place to put Query and ResultSet then? If I were to guess, I would have thought they were more kind of like "inner-classes", meaning classes that Object used internally, OR that they were subclasses of Object. However, if they are actually on the same "level" as Object, I would recommend mimicing that in your directory/namspace structure. Keep in mind that you are adding a top level namespace Whatever::, which maybe can hold Object, Query and ResultSet for you? Is it right for me to feel that this would be weird, or is this the standard way to it? Trust your feelings young skyknight. Maybe you should try lowering the blast sheild. A true Perl Jedi does not need his eyes :P Oh yeah, and no, there is no standard way of doing it, at least that anyone has told me :) The only alternative that I can fathom would be to put the MySQL class definition inside the Object.pm file. Yuk. Besides this will only temporarily solve your problem since someday you (or someone else) will need to write a PostgreSQL/Oracle/MSSQLServer/etc subclass for this and you will have to deal with it then. Now, based on my still limited knowledge of your code, I would suggest moving Query and ResultSet up to the root namespace (since as you say they are only in Object for the namespace). This will allow you to easily place all subclasses in subdirectories. And while right now all you can see a need for subclassing is Object, you never know if at some point you may need to subclass Query or ResultSet as well. Doing it this way leaves that door open just in case.
-stvn
In Section
Seekers of Perl Wisdom
|
|