Last post Oct 11, 2020 09:16 PM by DA924
Oct 10, 2020 10:21 PM|alisufian27|LINK
I have many service classes in Business Logic Layer similarly many classes in the Data Access Layer. and i have to reuse functions of different services/entities now i have a question which is the best practice that in a business logic layer should i call
data access layer function or business logic layers function.
For example, in order service i need customers and products so should i call BAL customer, product or i have to call DAL customer, product
Oct 11, 2020 01:54 AM|bruce (sqlwork.com)|LINK
the DAL should be an abstraction of the database. it should just support queries and updates to the database. This abstraction allows changing the database vendor. if asp.net core, you might want this to be EF core context and entries.
the BL layer is the logical layer. It should have its own interface and should avoid exposing DAL entities. this allows changing the DAL layer, without changing the BL api.
the DAL should only be called by BL layer.
a service should only call the BL layer.
in n-tier, there are public/intranet facing services (UI / webapi) and there are backend (behind firewall) tiers. only backend tiers should access the DAL.
Oct 11, 2020 09:16 PM|DA924|LINK
Is the BLL anemic of any business logic, it is acting as passthrough logic to access the DAL and you don't need it?
Also, understand what architectural style you really are using. Is it layered or n-tier?