Re: Assistance with naming a class
by jdporter (Paladin) on Mar 27, 2007 at 15:34 UTC
|
Those suggestions you got already look good, except I'd add one qualification:
Whether you use 'SQL' or 'DBIx' should depend on the implementation. Is the module going to be talking DBI? If so, then I'd recommend the latter, since 'SQL' is (it seems to me) more about the language generically. OTOH, if your module is simply going to translate the info into the corresponding schema SQL and leave the actual db creation to another function, then the former makes more sense.
A word spoken in Mind will reach its own level, in the objective world, by its own weight
| [reply] |
Re: Assistance with naming a class
by talexb (Chancellor) on Mar 27, 2007 at 15:45 UTC
|
I think either SQL::Schema::FromINI or SQL::Translator::FromINI would be appropriate.
I like the 'FromINI' because it clearly says where the data is coming from. It sounds like it's more or a translator than anything that generates a schema .. a schema generator is much more of an abstract item.
I don't believe it should have 'DBIx' in front of it -- it's not actually part of that class or group, it's more of a preparatory step.
Alex / talexb / Toronto
"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds
| [reply] [d/l] [select] |
Re: Assistance with naming a class
by Mutant (Priest) on Mar 27, 2007 at 15:41 UTC
|
Something involving 'FromINI' works for me. If it's not based on SQL::Translator, then perhaps using that namespace is misleading (if it is, then it's probably a good name!). My vote would be for SQL::Schema::FromINI.
I think it's easy to underestimate how important naming of classes, methods, variables, etc. is. Even if you use something descriptive (i.e. not just $foo), it should provide a reasonable explantion of what it does. Choosing a good name can make for a huge improvent in code readability. | [reply] [d/l] |
Re: Assistance with naming a class
by Rhandom (Curate) on Mar 27, 2007 at 15:59 UTC
|
| [reply] |
|
|
Rhandom,
These are good questions. As I said:
"Due to reasons beyond my control, I am stuck with this implementation. I understand the limitations and I also understand existing prior art. Suggestions for alternatives, while appreciated, are futile."
In other words, this implementation falls far short of the mark of what a reasonable person would want but that's besides the point.
| [reply] |
Re: Assistance with naming a class
by pdcawley (Hermit) on Mar 30, 2007 at 07:29 UTC
|
Is it politically feasible to pick an existing tool that does the job of building the database and write an adaptor that goes from the INI format to whatever the existing tool wants? If you pick something that's well documented and supported, you just saved yourself an awful lot of work, and put a bunch of extra capability in the bank for when the INI approach runs out of steam.
You can name the resulting translator module Existing::Product::Schema::(From)?INI and release it or not as you choose.
| [reply] [d/l] |
|
|
pdcawley,
You asked a question which deserves a response though I would have preferred to stay silent. There was a discussion a while back concerning adding a "Perl Career" section devoted to venting frustrations, asking for advice, etc. This would fall into that category.
I am not a developer. My official title is "Information Technology Specialist". My organization doesn't do any development, we hire contractors. There is a general fear of free and/or open source technology. Since I can remember, the only language used in development has been Java. The organization is oozing with hidden agendas, political power struggles, irrational fears, and a general angst against change.
I am sure this situation isn't too unfamiliar. You may be surprised to hear that I love my job. I remain a perl hobbyist and not a professional because I do it for fun not money. If you take the fun away, the money isn't worth it. My job pays extremely well, provides unique opportunities and challenges, and is quite stable in contradiction to the chaos. Surviving in this environment means knowning when to pick your battles. This leads to the answer of your question.
It is mostly a personal choice rather than one of political absolutes that is preventing me from changing this implementation. I treasure the rare occasions I am asked to contribute code. I have learned that the battles that need to be fought and won in order to win the war of change take a heavy toll and the road to victory is littered with casualties. You are fighting multiple adversaries and most employ attrition as their weapon of choice.
The short answer is, I probably could after a long and arduous struggle but I wouldn't like who I became in the end.
| [reply] |
Re: Assistance with naming a class
by pemungkah (Priest) on Mar 29, 2007 at 11:38 UTC
|
Schema::Builder::FromINI encapsulates the sentence you used to describle the code: it builds schemas from INI files. | [reply] |