Moved here from StackOverflow.
Today, an interesting discussion with a colleague. We're going to create a wrapper for WCF's channels, that will handle the Close(), Abort() and Dispose() correctly. This wrapper is to be used instead.
A coworker argued that this was like creating a domain specific language. He opposed the idea, saying it would impose a certain way of working on every software developer that he considered intrinsically wrong. He'd rather overload the 'using' keyword. (Now, AFAIK, this is not possible in C#)
So, does it? Does creating a set of classes and using them strictly instead of classes from other libraries (i.e. forbidding use of Channel) make a DSL?
Edit: When does 'code' become a DSL? I always understood a DSL as a new language with its own grammar, keywords, parser, tokenizer, etc.. Is the term becoming more vague with use?
class ChannelWrapper : IDisposable
{
void Dispose(bool disposing)
{
...
try {
channel.Close();
}
catch (CommunicationException) {
channel.Abort();
}
catch (TimeoutException) {
channel.Abort();
}
}
}