我正在处理遗留项目,试图改进项目结构。我的问题是我应该如何组织代码结构。我看到两个选择:
#1 业务域/层
app/
----accout/
--------application/
--------domain/
--------infrastructure/
----client/
--------application/
--------domain/
--------infrastructure/
----transfer/
--------application/
--------domain/
--------infrastructure/
Run Code Online (Sandbox Code Playgroud)
或#2层/业务域
app/
----application/
--------account/
--------client/
--------transfer/
----domain/
--------account/
--------client/
--------transfer/
----infrastructure/
--------account/
--------client/
--------transfer/
Run Code Online (Sandbox Code Playgroud)
哪种方法更适合遗留项目?根据您的经验,哪个更可取?
从我的角度来看,#1 将在进一步重构期间实现系统解耦。另一方面,对于遗留项目来说,#1 似乎更容易实现。
architecture legacy domain-driven-design directory-structure