sofa-boot icon indicating copy to clipboard operation
sofa-boot copied to clipboard

是否可以在 SOFABoot 模块中定义 Controller 组件

Open Kunple-w opened this issue 3 years ago • 2 comments

In what area(s)?

/area runtime

/area operator /area placement /area docs /area test-and-release

Ask your question here

在https://www.sofastack.tech/projects/sofa-boot/faq/中提到:

Q: 是否可以在 SOFABoot 模块中定义 Controller 组件? SOFABoot 模块一般用于封装对外发布服务接口的具体实现,属于业务层,Controller 属于展现层内容,我们不建议也不支持在 SOFABoot 模块中定义 Controller 组件,Controller 组件相关定义建议直接放在 Root Application Context。

提供模块级别的Controller我理解在模块化中也是场景的,如该模块自身对外提供的接口。如果将各个模块的Controller都放在Root Application Context中,感觉又是反模块化的方向。

  1. 考虑对Controller的支持吗?看了一下issue和faq,似乎对这个特性都有提到。
  2. 如果要实现这能力,需要如何做?

Kunple-w avatar Dec 17 '21 06:12 Kunple-w

感谢反馈! @alaneuler 看看哈

seeflood avatar Dec 17 '21 07:12 seeflood

SOFA 的模块化是分层 和根据业务模块分模块不一样

nogeek-cn avatar Dec 21 '21 07:12 nogeek-cn