面向架构(结构)与面向功能的项目结构

发布于 2024-10-01 10:32:36 字数 1003 浏览 6 评论 0原文

我参与的项目有一个面向架构的项目文件/文件夹结构:

Root
|____ Node1
    |____ Event Handlers
    |         |___ <all event handlers of project>
    |____ Events
    |         |___ <all events of project>
    |____ Request Handlers  
    |         |___ <all request handlers of project>
    |____ Requests
    |         |___ <all requests of project>
    |____ ...

从系统架构的角度来看是一个清晰的(已由开发团队提出)。

它是设计团队提出的面向功能的结构:

Root
|____ Feature #1
    |____ Event Handlers
    |         |___ <all event handlers of Feature #1>
    |____ Events
    |         |___ <all events of Feature #1>
    |____ Request Handlers  
    |         |___ <all request handlers of Feature #1>
    |____ Requests
    |         |___ <all requests of Feature #1>
    |____ ...

这种变体更接近设计人员,并且清楚地描述了要实现的功能。

我们的团队已经开始了一场圣战:什么是最好的方法。 有人可以帮助我们解释第一个和第二个的缺点优点吗? 也许还有第三种对我们双方都更有用、更有利的方法。

谢谢。

The project, I have involved, has an architecture-oriented project's file/folder structure:

Root
|____ Node1
    |____ Event Handlers
    |         |___ <all event handlers of project>
    |____ Events
    |         |___ <all events of project>
    |____ Request Handlers  
    |         |___ <all request handlers of project>
    |____ Requests
    |         |___ <all requests of project>
    |____ ...

It is a clear from the architectural point of view of system (has been proposed by development team).

It is a feature-oriented structure has been proposed by designer team:

Root
|____ Feature #1
    |____ Event Handlers
    |         |___ <all event handlers of Feature #1>
    |____ Events
    |         |___ <all events of Feature #1>
    |____ Request Handlers  
    |         |___ <all request handlers of Feature #1>
    |____ Requests
    |         |___ <all requests of Feature #1>
    |____ ...

This variant is closer to designers and it describes clearly a feature to be implemented.

Our teams have started a holy war: what is the best approach.
Could somebody help us and explain cons and pros of the first and second ones.
Maybe there is a third one that is more useful and beneficial for both of us.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愛放△進行李 2024-10-08 10:32:36

我会选择第二个选项,以便实现长寿命应用的可维护性。

我举个例子来解释一下:

应用发布一年后的某一天,原代码编写团队离开几个月后,用户在某个流程中检测到并报告了错误。该票肯定会看起来像“这东西不起作用”,经过一些电子邮件乒乓球之后,它最终会变成“我无法为澳大利亚客户保存多产品订单”。

好吧,在第一个项目结构中,您必须在所有项目请求和事件处理程序中搜索有错误的代码所在。
在第二个模块中,您可以在订单保存模块(或根据您的结构粒度,“海外/多产品订单保存”模块)缩小搜索范围。

在我看来,它可以节省大量时间,并简化可维护性。

I would choose the second option, in order to the mantainability of a long life application.

Let me explain it with an example:

One day, a year after the application release, and months after the team who worte the original code has left, a user detects and report a bug at a certain process. The ticket will surely look something like "This stuff does not work" which, after some email ping-pong it will end up being "I can't save a multi-product order for an australian customer".

Well, on the first project structure, you have to search among all your project Request and Event Handlers where the buggy code is.
On the second one, you can narrow your search at the order saving module (or depending your structure granularity , the "overseas/multiproduct order saving" module).

It can save a lot of time, and ease mantainability IMO.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文