views:

128

answers:

9

This question is a little silly, but sometimes it's tough to figure out how to name things correctly. The conversion will parse a config file into XML and vice versa. I want to call the program MyCompany.Config2Xml, but the program also needs to be able to "Xml2Config".

+2  A: 

I propose: ConfigParser

jeffamaphone
A: 

General term seems like it would be format convertor, or transformatter (by analogy with transcoder). In terms of the specific names you discuss, I think I'd go with ConfigConvertor.

chaos
Transformatter: Xml in disguise?
Matt Howells
Readability is the right of all sentient beings.
chaos
@unknown: Your argument is persuasive. Unfortunately this makes my answer almost a duplicate of danielmay's, except with more classicist spelling.
chaos
sorry, I moved my comment up, orphaning yours. What I said is to merge both suggestions into ConfigTransformatter.
PA
Or, paraphasing the exact words of the question, ConfigFormatConverter
PA
Conformer ... ...
jeffamaphone
@jeffamaphone: Well, there's no need to insult the poor thing; it's just doing its job.
chaos
I like ConfigFormatConverter!
Sam Pearson
A: 

DaTransmogrifier

UberConvertPlus

Xml2Config2Xml

ConfiguratorX

Matt Howells
+1  A: 

CC for short:
ConfigConverter ?

Daniel May
CC is (almost) universally recognized as a C-compiler. CC would be a very bad name.
William Pursell
A: 

'XConTrans'

or simply 'Via'

Hardryv
A: 

ConfXmlSwitcher :P

Alberto Zaccagni
+2  A: 

In keeping with SqlDataReader, TextReader, XmlReader etc I'd just call it ConfigReader and ConfigWriter.

Or, you could just go the serialization approach and then not have to worry about naming conventions.

Spencer Ruport
+1  A: 

Rather than ConfigParser as proposed by jeffamaphone (+1 for nice username), make it a verb:

parse-config

This makes it read nicely in scripts:

if ! parse-config < config-file > config.xml; then
    exit 1
fi
William Pursell
+1  A: 

I think it helps a lot to think about the verbs (methods) you intend to use with the class and the role the class plays in the application.

In other words if you envision the operation to be {class}.Get() or {class}.Load() then ConfigParser might be a good choice.

If on the other hand you have a corresponding {Class}.Set() or {class}.Save() operation then something like ConfigManager would be a better choice, particularly if the class will be used to isolate the application from the persistence of its configuration.

If the role of the class is nothing more than part of a standalone application or a step in a longer running process then I would would lean more towards class and method pairs that are more like Convert.ToXml() Convert.ToConfig() or Translate.FromXml() Translate.FromConfig().

RonnBlack