On 12/5/11 3:32 PM, Christian Schwarz wrote:
Hi,


I would suggest that we don't use the AttributeKey class at all, and
instead, define each internal MINA Attribute by prefixing them with '__'.
For instance, the SslContext would use the '__SslContext' key. The rational
is that there is no reaon to use complex key, even if we have some
collision risks.

As mentiont in ticket [DIRMINA-874] Typesafe
Attributes<https://issues.apache.org/jira/browse/DIRMINA-874>,
i think a AttributeKey is a good tool to provide typesafey and a reduced
risk of key-collisions. The most time i get confused with String
attribute-keys in MINA 2, is when some one uses a String for more than one
purpose (e.g. attribute-key&  nls-key ). If we have one key-type we can
prevent users to abuse a attribute-key for an other purpose.
Yes, I read your JIRA (and replied).

What about mixing both mode ? A <String, Value> mode for simple usage, and a typesafe mode, as you suggested (that means we will have two different kind of map to store both elements).



The idea of an '__' prefix is still possible, but i think a prefix like
'internal' is more expressive for those how don't read deep in the API-Docs.
It can be 'internal_'<the name>, sure. Doesn't matter too much here, it's just about avoiding collision as much as we can.


--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to