Business logic development

I feel like a noob to ask this question, but now I have been looking for some time.

When developing a BLL layered application, would you put all entity classes in a single namespace? For example: if you have a database with Customers and their Vehicles, and these Vehicles receive service, you can say that monthly. I would think that one of them would keep customers and their vehicles in a separate “module” from the “service module” (so if you ever need to update the service method or where the data is stored, you do not need to touch the Customer \ module Vehicle).

Am I reflecting on this correctly or should I change my design ideas?

This showed me a problem using LINQ to SQL. If half of the entity classes of the tables are contained in the “module” A, and the other in the “module” B, then somewhere you will have a “module” reference “module” B and vice versa, to take into account the associations between two tables that have borders with “modules "

OR (just thinking about it now) will you have 1 class of table entities in the “modules” (one class in both modules)?

Any advice would be appreciated.

+4
source share
1 answer

It’s not entirely clear if you also have a level of access to data, because you indicate “so that if you ever need to update the way services are performed or where the data is stored, you do not need to touch the client \ Vehicle module”. DAL will take care of processing data retrieval and storage, wherever it is.

But, of course, it could be that the Car should be updated, and it would be very convenient if these rules had to be updated in one place. You could just create a client and a BLL car with these rules. Then you simply add the CustomerVehicleService, which uses the Client and Transport. There is no rule you cannot.

+1
source

All Articles