Hihi, i am writing utilities classes using C#. The utilities contain my own
exceptional classes. Until now, my design about the exceptional classes is
that:
I have my expceitonal class and inherit from ApplicationException and i will
assign a message to it when creating the instance for more details to
identify what's the problems are. The message is not hardcoded in program,
the exceptional classes will call and pass MessageKey to a MessageReader
class to get the message from a text file.
In this case, i should collect all the messages in a text file, and i
confuse with that. I think i should seperate the different exception's
message in different file. For example, at least i will have Common
Message(e.g. Out of range) and Applicaiton Message(e.g. field cannot be
empty). And then, when the program create common's exception, the
MessageReader will get message from common file. However, if i use this
method, i will have many message file and it seem difficult to maintain.
So i want to know how to do the exception class in a better way? How the
..NET to do it? Is it same with me? Does my method correct?