In general, I use:
Data level:
To access the data, I create an interface for each object. Each interface lists all methods for accessing publicly available data for a given object. To store data, I create container types for each object, which can be structures or simple classes with only data. I also rely on a language dataset, such as lists, to store my data, so I am not tied to a specific type of database. After that, I create a class that implements data interfaces, this class has all the SQL and access to the database, so if the storage technology changes, this is the only class that will be changed.
Business level:
It should be called and in what order all the logic with the data should be called, how to check which methods from the data interfaces. This class receives and βsendsβ data to a data warehouse or graphical interface using containers (for example, lists), where the data types are my containers mentioned above.
GUI:
Invokes business logic methods and presentation / presentation data format. There is no logic here but to invoke the correct business logic methods.
An example of a small container code (C #)
This example of business logic is really very simple, it just shows how to retrieve data from the storage tier, but as long as you have access to the data, you can manipulate it the way you want. Just a comment here: perhaps this solution should be changed if it is implemented on a very busy server with thousands of applications, since it can use a lot of memory.
For business logic and the UI point of view, all data is transferred between modules using general-purpose containers such as lists. The connection point between all these modules is the container classes, so all classes are more or less decoupled.
The user interface makes orders business logic classes, so it acts as a service provider. Thus, changing the user interface will not affect the classes below.
Business logic requests and sends data to data storage classes using general-purpose data, so changing a database / storage technology should not affect it.
The way I use and I'm trying to improve it;)