Thanks for your explaination. Mina IoHandler, IoAcceptor, IoConnector can be
configured? Is there any examples or tutorials for this? Furthermore,

2007/5/17, Niklas Therning <[EMAIL PROTECTED]>:

MINA doesn't need Spring. The mina-spring-integration module provides
some classes which make it easier to use Spring to configure your MINA
IoHandler, IoAcceptor, IoConnector etc.

Spring's dependency injection (DI) is a great tool as it helps you
separate the configuration of your classes from the actual use. It
encourages good design since your code won't have to bother about
getting hold of the dependencies it needs to do its work. Instead you
provide setter methods which Spring will use to inject the dependencies.

The DI stuff is just a small (but extremely important) part of Spring.
If your app uses Hibernate, needs transactions, can be managed through
JMX, etc Spring has a lot to offer and will make your life as a
programmer a lot more easier (and fun). In such an app
mina-spring-integration is a life saver since it lets you inject those
Spring managed transaction enabled services into your IoHandler,
IoFilter, etc without tying your code to Spring in any way.

BTW, you could still use the dependency injection pattern and benefit
from the cleaner design without using Spring. You could separate out the
wiring of the dependencies into a separate package of your app. For a
small project that could be sufficient and it would let you switch to
Spring based configuration more easily in the future.

HTH
Niklas

mat wrote:
> Can you explain more why Mina needs Spring? Mina itself is a framework,
> isn't it?
>
> 2007/5/16, Trustin Lee <[EMAIL PROTECTED]>:
>>
>> On 5/16/07, mat <[EMAIL PROTECTED]> wrote:
>> > Can anyone give me a hint why migrate spring into mina? Is Spring for
>> web
>> > development?
>>
>> Well, Spring is basically a IoC (or DI) container.  It's not directly
>> related with web application development.  Of course, it provides many
>> bells and whistles which enable rapid web application development, but
>> it doesn't mean that Spring container itself is not suitable for MINA
>> applications.  It can work with virtually any type of applications
>> such as a Swing GUI application.
>>
>> Trustin
>> --
>> what we call human nature is actually human habit
>> --
>> http://gleamynode.net/
>> --
>> PGP Key ID: 0x0255ECA6
>>
>



Reply via email to