Leon,

> For example, if I need the
> current user's country somewhere deep in the BL I could change all
> interfaces inbetween and add the country (or locale) parameter, but
> than I have one of nine methods having this parameter. If I am
> consequent, I'd have to add standard parameters like current userId,
> locale, etc to each method in each interface which wouldn't make
> method signatures better readable. Consider:
> public void sendMessage(Message message) against
> public void sendMessage(Message message, UserId currentUserId,
> SessionId currentSessionId, Locale currentLocale.....)
> which one is better to understand?

I agree. I wouldn't recommend adding every single required piece of data
to all of your method calls. Rather, consider creating a class that
contains all of this information. Say, UserData. Then, add a parameter
of that type to each of your methods, and propagate them through the
rest of your interfaces.

If you find that, in the future, you need another piece of data, just
add it to the UserData object and none of your interfaces have to change.

-chris


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to