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).
精彩评论