比如 写了一个 BaseController,其他 xxxController 都 extends BaseController,1、将所有 xxxController 用到的资源都写在 BaseController 中:
@Resource
protected xxxService xxxService;
@Resource
protected yyyService yyyService;2、将 xxxController 使用到的分别写在自己的 Controller 中:
@Resource
private xxxService xxxService;上面两种情况哪一种效率更高?哪一种更节约资源?如果都写在 BaseController 中,有的资源,在子 Controller 可能没用上,不知道会不会浪费资源?spring 高手请指点一下!!谢谢!