多站点应用程序中的业务逻辑(前端、后端 2、后端 3、后端)

发布于 2024-10-04 21:51:51 字数 404 浏览 0 评论 0原文

假设我有一个课程管理应用程序。

后端学生:

  • 学生可以查看课程,订阅课程,评价课程...

后端学校:

  • 学校可以插入课程,订阅学生课程 .... 上传课程文件

后端教师:

  • 教师可以将文件上传到课程

......。

正如您所看到的,某些功能是跨应用程序共享的。

我必须将业务逻辑放在哪里?

我可以编写“核心业务逻辑”并共享它吗? 或者创建 3 个完全不同的业务逻辑更好?

Suppose I have an application for courses management.

BACK-END STUDENT:

  • the student can view the courses, subscribe course, rate course...

BACK-END SCHOOL:

  • ths school can insert course, subscrive student to a cuorse....
    upload fies for a course

BACK-END TEACHER:

  • the teacher can upload files to a cuorse....

.

As you can see some function is shared accros the applications.

Where i have to put the Business Logic?

I's possibile to wirite a "core business logic" and share it?
Or is better to create 3 completly different business logic?

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

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

发布评论

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

评论(1

抽个烟儿 2024-10-11 21:51:51

您熟悉以下原则吗?

简短的答案是(可能)您希望将所有 BL 放在一个地方,但以遵循 CCP 和 CRP 的方式组织。

是的,可以共享和重用 BL,但这取决于您如何构建解决方案的其余部分。

这些原则基本上说的是(在您的情况下),由于您的 TeacherStudentSchool 对象显然是同一域的一部分,因此它们应该可能会一起去。

阅读本文,如果您对整个架构不熟悉,它应该会有所帮助:5-层架构 (PS - 虽然它以 ASP.NET 为中心,但仍然有许多应用更广泛的基础知识)。

Are you familiar with the following principles?

The short answer is (probably) that you want to have all your BL in one place, but orgainised in such a way that you follow CCP and CRP.

Yes it is possible to share and reuse the BL, but this will depend on how you architect the rest of the solution.

What these principles basically say (in your case) is that as your Teacher, Student and School objects are obviosuly part of the same domain they should probably go together.

Read this, it should help if you're new to the whole architecture thing: 5-Layer Architecture (P.S - although it's ASP.NET centric there's still lots of basics that apply more widely).

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