google-code-export / slim3

Automatically exported from code.google.com/p/slim3
1 stars 1 forks source link

pluggable controller bean factory #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
    I have a tiny DI framework which is used to replace spring DI. I hope I can use it in slim3 controller but I don't know where to plug it in seamlessly without explicitly calling the getBean method of my tiny DI framework.

    If there is a controller bean factory which is configurable (declaratively or  programmatically), it would be much more easier to use custom DI framework.

Original issue reported on code.google.com by mylee...@gmail.com on 12 Jun 2010 at 6:03

GoogleCodeExporter commented 9 years ago
You can override FrontController#createController().
This method is prepared for such a request.

There is an important caution.
If you want to use HOT reloading, you should clean up the reflection cache 
per request,
because HOT reloading creates a new class loader per request.
See http://sites.google.com/site/slim3appengine/hot-reloading.

BeanUtil#initialize() and BeanUtil#getBeanDesc() will help you with the issue.
http://code.google.com/p/slim3/source/browse/trunk/slim3/src/main/java/org/slim3
/util/BeanUtil.java

Cleanable#clean() is called per request.

Original comment by higaya...@gmail.com on 12 Jun 2010 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by higaya...@gmail.com on 18 Jun 2010 at 11:47