Hello,


JavaMailMessage.properties defines the following messages:
00001=Authentication failed ${0} ${1}.
00002=Authentication failed#2.

Can you say why '00001' is better than 'authFailed'?

I do not say that 00001 is superior than authFailed. One can use whatever is required/decided.


I don't see the advantage of:

public JavaMailMessage FAILED = new JavaMailMessage(00001); // NB this is an 'octal' number, and (00010) has the value 8, so be careful :-)

over

public String FAILED = "mail.authFailed";

In the first case, I can ensure that the message identifiers provided to the I18NJavaMailException constructor is a defined, because it is an element of a specific type-safe enum. In the latter case, it is possible to provide an undefined key to this constructor.


I don't think i18n needs to create a bunch of exceptions specific to i18n. Otherwise, for every Exception, you'll have an I18NXxxException, which sounds like a lot of work. Sometimes I think it would be useful, but not all the time.

As said by dain - dain, correct me if I am wrong - it allows to define distinct exception streams. Each stream can have its own last resort exception handling mechanism.


For instance, based on the class of an exception, one derives the affected sub-system and how to handle it. If the exception is a I18NJavaMailInternalException, then the last resort mechanism traps it and processes it. If it is a I18NJavaMailExternalException, then the last resort mechanism traps it, processes it and re-throws it to the client.

BTW, as said by others, and based on the KISS principle, a standard i18n approach is fine for the time being.

Cheers,
Gianny

_________________________________________________________________
Hotmail : un compte GRATUIT qui vous suit partout et tout le temps ! http://g.msn.fr/FR1000/9493




Reply via email to