Class Design Question
- From: Cool Guy <coolguy@xxxxxxx>
- Date: Thu, 19 May 2005 22:33:06 +0100
I have a class which holds key-value pairs where the keys are common
Windows file extensions and the values are associated file content
descriptions (for each extension).
This class has a method which gets a value given a key.
e.g.:
class FileDescriptionTable {
public void Get(string fileExtension) {
return GetDescription(fileExtension);
}
}
I was considering changing it so that, instead of taking a key (a file
extension), it takes a full file name, and determines the extension itself
(by making a routine call):
class FileDescriptionTable {
public void Get(string fileName) {
return GetDescription(FileUtility.GetExtension(fileName));
}
}
Is this a good idea, or would it give FileDescriptionTable too much
responsibility? I can't quite decide.
.
- Follow-Ups:
- Re: Class Design Question
- From: Cool Guy
- Re: Class Design Question
- From: Robert C . Martin
- Re: Class Design Question
- From: H. S. Lahman
- Re: Class Design Question
- From: iamfractal
- Re: Class Design Question
- Prev by Date: Re: Lahman, how ya doing?
- Next by Date: Turn $5 into a lot more!
- Previous by thread: Packages of Use Cases - guidelines
- Next by thread: Re: Class Design Question
- Index(es):
Relevant Pages
|