开发者

Business Logic in a multi sites application (front-end, back-end 2, back-end3,back-end)

开发者 https://www.devze.com 2023-01-27 22:25 出处:网络
Suppose I have an application for courses management. BACK-END STUDENT: the student can view the courses, subscribe course, rate course...

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 开发者_如何学Cshare it? Or is better to create 3 completly different business logic?


Are you familiar with the following principles?

  • Common Closure Principle CCP
  • Common Reuse Principle CRP

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消