-
C's three-tier structure is the most. The most common development method for the .NET platform.
It is mainly divided into database layer, entity layer, and business logic layer, which may be called differently, but the general meaning can be understood.
The data layer is the lowest level, directly dealing with the database, the business logic layer is very important, mainly all kinds of functions are written in combination with the statements of the database, and the entity layer is like a waiter in a restaurant, responsible for transmitting the data sent by the business layer, including the interface you see is generally written in the entity layer.
There is also a three-tier structure that cannot be crossed by a level. Just like the database layer can't deal directly with the entity layer. Let's learn the three-layer structure, it seems simple, but it is very charming and infinitely varied. Come on!
-
The data access layer only manipulates the database to get results.
The business logic layer calls the data access layer.
The presentation layer displays only the data.
Entity classes are data carriers in Layer 3.
-
Presentation layer, UI layer. -Interface.
Logical Layer -- Logical processing.
Data layer. - Operate the database.
-
Following... I'm also a newbie. I feel like you can use the datatable directly.
-
Three-layer structure: data access layer, business logic layer, and presentation layer.
Interdependencies:
The business logic layer refers to the data access layer, and the presentation layer refers to the business logic layer.
The main responsibilities of the data access layer are:
Interact with the database and write the corresponding SQL execution statement.
Presentation Layer Main Responsibilities:
Reference the business logic layer, get some parameters from the user's input, call the parameters using various methods in the business logic layer, and present the results to the user in the presentation layer.
The main functions of the solid layer are:
The solid layer is not actually a three-layer structure. It adds another layer between the data access layer and the database, and after isolating the two layers, the data access layer does not need to directly access the database, so the coupling between the programs is reduced.
Also, if you don't know much about the three-layer structure, here's a beginner ** that you can check out. I was very helpful when I first started.
-
This one. When I first came into contact with it, it wasn't very clear, but after a long time, you will find that one of the characteristics of object orientation, "encapsulation", can explain all this, to put it bluntly, the method call and class call are the same, but the syntax is different, the space is different, the three-layer architecture is very basic, if you know the function of each layer of the three-layer architecture, it is easy to do, writing in one class file is no different from two class files, don't think about it, it's just a little change in the syntax when calling. I only understood these when I learned for the second time, and it was inevitable to be mixed up at the beginning, sort out my thoughts, re-straighten out the relationship and understand it fundamentally, and remember to understand every knowledge point thoroughly!
-
To put it simply.
Access the data from the database, this is a layer of data access layer, which organizes the business relationship of related data, this is a layer of business logic, and represents the organized data to people, which is a layer of presentation layer.
By the way, I found some information for you:
A good hierarchical structure can make the division of labor among developers clearer. Once the interfaces between the layers are defined, developers responsible for different logical designs can spread their focus and work together. For example, UI designers only need to consider the experience and operation of the user interface, domain designers can focus only on the design of business logic, and database designers do not have to worry about tedious user interactions.
Once each developer's task is confirmed, the development progress can be rapidly improved.
The benefits of loose coupling are obvious. If a system is not hierarchical, then its logic is tightly entangled, interdependent, and irreplaceable. Once there is a change, it will affect the whole body, and the impact on the project is extremely serious.
Reducing the dependencies between layers can not only ensure future scalability, but also have obvious advantages in reusability. Once a unified interface is defined for each functional module, it can be called by individual modules without having to re-develop for the same function.
Standards are also indispensable for a good layered structure design. Only on the basis of a certain degree of standardization can this system be scalable and replaceable. And the communication between layers inevitably ensures the standardization of interfaces.
-
Let's start by looking at the composition of a three-tier architecture:
One: Interface layer.
The interface layer provides the user with a visual interface, through which the user enters and obtains data. The interface layer also provides a certain level of security to ensure that users can see confidential information.
Two: Logical layer.
The logical layer is the bridge between the interface layer and the data layer, which responds to user requests at the interface layer, executes tasks, and grabs data from the data layer, and delivers the necessary data to the interface layer.
Three: the data layer.
The data layer defines and maintains the integrity and security of the data, and it responds to requests from the logical layer to access the data. This layer is usually implemented by large database servers, such as Oracle, Sybase, MS SQL Server, etc.
Here's an analysis of the benefits of a three-tier architecture:
From both a development and application perspective, a three-tier architecture has significant advantages over a two-tier or single-tier structure. The three-tier structure is suitable for group development, and each person can have a different division of labor, and the collaborative work multiplies the efficiency. When developing a two-layer or single-layer application, each developer should have a deep understanding of the system and have high ability requirements, and when developing a three-layer application, it can combine a variety of talents, and only a few people need a comprehensive understanding of the system, which reduces the difficulty of development to a certain extent.
The three-tier architecture is a thin customer model, and the user side only needs a smaller hard disk, smaller memory, and a slower CPU to get good performance. In contrast, single-layer or fat customers are too demanding on the noodle machine.
Another advantage of the three-tier architecture is that it can better support distributed computing environments. Applications at the logical layer can run on multiple machines, taking full advantage of the network's computing capabilities. The potential of distributed computing is huge, far more effective than upgrading the CPU.
The biggest advantage of the three-tier architecture is its security. The user side can only access the data layer through the logical layer, which reduces the entry point and blocks many dangerous system functions.
-
I think the advantage is that it's easier to manage, easier to read, easier to understand, and easier to reuse.
-
There are not many restrictions on how many layers your application can have, the key depends on how much you want to divide your application into several modules from a functional point of view.
The project has strong scalability and maintainability.
-
It can be better maintained, ** reuse is also better, and it is good to separate the UI (interface layer) BLL (business logic layer) and DAL (database access layer), which is generally used with the model layer.
-
For example, the interface part is placed in a WinUI package, the business rules part is placed in the BR package, and the data access part is placed in the DA package, which is the typical three-layer architecture division you mentioned. But you have to appreciate what are the benefits of such a division, if you don't divide it, your ** will be written like this, isn't it very good for maintenance and scalability? It is very likely that the readability is not very good, hehe, programming is also an art, pay attention to aesthetics, layering technology by reducing the degree of module coupling, rule encapsulation and other means to let you curate your artwork, make it more beautiful, more vibrant.
For projects developed with three layers, after the project is launched, the requirements can be changed as soon as possible.
-
You play this a few more times, do a few more cases, and you will understand, it's very simple. The three layers include: business logic layer, data access layer, presentation layer, and generally a model layer.
If you want to make three layers, start to build three layers, that is, model (model layer), DAL (data access layer), BLL (business logic layer), and a ** or form (presentation layer). Then follow the steps to 1Add external references, reference the correspondence between the three layers, and then add the following references internally, generally dal references model, bll references dal and model, representation layer references bll and write model layer, if the database is not very complex, you see how many tables you want to use in the database, write the class corresponding to the same table name in the model layer, and then encapsulate the attributes of some corresponding table fields in the class.
3.Write the data access layer, which writes your specific operation method on the database, and the corresponding fields to be inserted can be called by creating an instance of the model layer class to call the corresponding encapsulated attribute field in the model layer class. 4.
To write the business logic layer, it is to summarize and encapsulate the methods in the dal, so that the presentation layer can be used instead, so that the presentation layer can call the specific methods in the dal. 5.To write the presentation layer, call the corresponding method in the bll.
Hope it helps!
-
French wine people are very good at remembering the human body Futian and the plan ikttyuyuio typhoon day internationalization on the look.
-
1. The BLL layer is the business logic layer, and from a certain point of view, it is the "processing layer"; The data that interacts with the user is written in the view layer, the business logic is written in the BLL layer, and the data access related to the database is written in the DAL layer.
2. These query conditions can be said to have no logic, and they are all directly called to the dal layer; So the paragraph you posted**, it can be said that it does not play the role of the BLL layer, (nothing is processed, there is no business logic).
3. Take the last method of this BLL as an example, directly call the SelectEmpbyeType method of DAL, and then return the dataset (the dataset is a collection of employee categories).
4. Where can I get the parameters? You can't see it from this layer. You can only know what the data is returned and who you want to use it for, and you can't see it. These are in the view layer.
5. This paragraph does not reflect the role of the BLL layer at all. Write all the logic to the view layer or the dal layer.
-
For example, if you want to determine whether the login is successful, you return a queried password at the DAL layer, get the input password from the UI layer, and then compare whether it is consistent at the BLL layer, and then return a BOOL type.
The judgment you didn't use above is mainly to pass a data, such as whether you delete it successfully, you can add a judgment If it is greater than 0, it will return true
In short, BLL is the processing logic.
u: above d: below r:
Right l: Left f: Front b: >>>More
Every Internet café has a bar counter, and there is a computer in the bar that is the machine that controls the entire Internet café. Every computer in the Internet café is a client, and it obeys the computer at the bar, and the network management only needs to update it on that computer in time. When you want to update, start a program again, compare the difference between the game and the game on your computer, and copy the files you need from this machine when you update, and it will be fast. >>>More
1.If the iOS version of 3560 is or above, look at the log records of 3560 to find out whether there is ARP spoofing in the network, or whether the gateway address is occupied. (If the version is not high, then go to see by grabbing packets). >>>More
Teach you a simple layer reduction method, first find the color you like, the first spell of the bottom cross, this is no problem, if you somehow cross the color and the color of the middle block of the face is consistent, then the color of the middle block goes to the bottom surface of the four corners, after the fight for the specific formula available you can go to the pattern square station to look at the second and third layers, simulate to the other side of a row vertically divided into abc side body bottom is divided into 123 from top to bottom, from left to right right, reduce the formula left of the second layer, a 3, a right, down 3, right side (opposite plane) inverse, -90 degrees, left, surface each rotated 90 degrees clockwise direction counterclockwise reversal, unlimited use of two formulas to be able to come up with the second layer, the top surface of the painting, you go to the Rubik's Cube station to see, the formula, you can not see it is not clear.
Layer 2 is a common switch.
Layer 3 with routing function. >>>More