Trustin Lee wrote:
On 6/21/07, peter royal <[EMAIL PROTECTED]> wrote:
On Jun 20, 2007, at 3:42 PM, Trustin Lee wrote:
> What about putting the option in IoService?
>
> IoAcceptor acceptor = ..;
> acceptor.setSessionAttributeMapFactory(new MyMapFactory());
>
> I thought about putting it to IoSessionConfig but the map can't be
> changed once its created.

good place for it. also makes me wonder if we should have a non-map
interface that IoSession uses.. since we only have get/set/contains/
keys, if we had a simple interface, it would be easy for people to
back it by a highly optimized structure knowing it doesn't need full
map semantics.

or that could be premature optimization :)

They can extend AbstractMap, no? ;)

Trustin

It's nice to be able to plug a structure but I don't care about it so
much. Mina should be distributed with the best Map available that:
- doesn't cause any concurrency problems (visibility +
synchronization)[priority 1]
- consumes little memory [priority 2],
- be fast [priority 3].

The best choice should be the default choice. Right now, the best choice
for the Map that backs IOSession seems to be a java.util.HashMap with
classic synchronization (according to Gato's tests).

Therefore, a better HasMap for session is one that doesn't consume more
memory than java.util.HashMap AND/OR is faster.


IMO, a framework that gives too many options is not necessarily a
powerful framework, it only makes it more complex to use. A powerful
framework is the one that is easy to use and does the job as efficiently
as possible.

_________________________________________________________________
Vælg selv hvordan du vil kommunikere - skrift, tale, video eller billeder med MSN Messenger: http://messenger.msn.dk/ - her kan du det hele

Reply via email to