define

What is paging check design? As shown in the picture below, this is a feature of the Nuggets column, you can choose to batch add similar files to the column, with the drop-down, will return page by page.

In addition to this design, there is also a page below the design, according to the number of pages, such as:

use


There are two check functions, check and cancel.

I’ve seen two designs for this paging check.

The first use, the one for nuggets, has been selected to no longer show up in paging, so the paging check only adds functionality. Those already selected have a separate list from which they can be selected for deletion.

The successful separation of additions and deletions makes it easy for users to use.

In the second case, the check and uncheck functions are in the paging check. In one scenario, the user initiates an application and the operation recommends some services. Later, the user initiates another application and the operation needs to add or subtract the previously recommended content.

Where is the hole

Paging check pit is more secret, you can first think about where the problem, if you can think of it, it shows that students are very careful, agile.

The reason why I wrote this article is because I met this pit when I was doing a project. I thought I had handled too many projects and many pits could be avoided, but I didn’t expect the reality would still slap me in the face. I need to learn and live forever.

The first design separates selected and unselected, and there’s nothing wrong with that. And the product is also very close to the increase of the search function, easy to find.

The pit is in the second type.

In the beginning, I thought it was very easy to record the recommended content. When paging, if there is a recommended content in the page, the selected status is true, otherwise false, and the front end will show whether the selected or not according to the status returned by the interface. When the user submits, the front end will submit the selected content, perform a collection operation between the submitted content and the recommended content of the original record, find out which are new, which need to be deleted, and which are unchanged, and then update these records.

Many students may think this idea is reasonable, probably because we all look at problems in a static way. If we can consider the situation of multiple pages when thinking about this design, we can find the pit in it.

For example, suppose you can recommend 100 items of content, 10 per page, for a total of 10 pages, and recommend the first and last item on each page the first time. Something like this:

Running a second recommendation causes two problems:

  1. Difficulty of use: It’s not good to see all the pages if you want to see what was previously recommended. This can be mitigated to some extent by putting already recommended items at the top, but operations still need to view multiple pages.

  2. Ambiguity: In the second recommendation, the operation just wants to cancel the home page and submit directly after canceling the first page. The content submitted in the front end does not recommend anything, and the system will remove all the recommended content.

The solution

I can think of two solutions:

  1. If there are few recommendations, you can have only one page and put the ones already recommended at the top, which is the most operationally friendly

  2. If the content is too much, the multi-page method can only be adopted. When submitting, the front-end needs to record what is added and deleted, and the server can calculate what is added, deleted and unchanged according to the data.

  • This operation can cause a lot of front-end work, because checkboxes can be checked and unchecked, coupled with pagination, the probability of problems is high.

  • Even if the recommended one is placed at the top, this approach still creates some ambiguity. For example, if the total number of recommended pages in the first time is three, and in the second recommendation, the operation wants to not recommend all of them. The operation is not familiar with the system, so it only removes the first page completely and submits it. The operation thinks that it has completed the task, but there are still 2 pages of recommended pages in the system, resulting in ambiguity.

  • If the recommended data is not stored in your own system and is obtained from other systems through interface paging, the top function cannot be realized unless the interface supports it, and all pages still need to be traversed during operation.

conclusion

I don’t particularly recommend using the paging check function, but if you do use it, it would be better to simplify the paging check function and only add features, with a separate list of existing recommendations.

The last

If you like my article, you can follow my public account (Programmer Malatang)

My personal blog is shidawuhen.github. IO /

Review of previous articles:

recruitment

  1. Bytes to beat | push big 24:00

  2. Bytes to beat | headlines today guangzhou server push r&d engineers

  3. Bytes to beat | trill electricity now hiring front-end development project in Shanghai

  4. Bytes to beat | trill electricity senior server-side development engineer – trading in Shanghai

  5. Bytes to beat | trill electric ShangWuHan server-side development engineer (senior)

  6. Bytes to beat | fly book big customer push product manager

  7. Bytes to beat | trill electricity service side technical posts vacant

  8. Bytedance recruitment special

Design patterns

  1. Go Design Pattern (11)- Proxy pattern

  2. Go Design Mode (10)- Prototype mode

  3. Go Design Mode (9)- Builder mode

  4. Go Design Pattern (8)- Abstract Factory

  5. Go Design Mode (7)- Factory Mode

  6. Go Design Pattern (6)- Singleton pattern

  7. Go Design Pattern (5)- Class diagram symbolic representation

  8. Go Design Pattern (4)- Code writing optimization

  9. Go Design Pattern (4)- Code writing

  10. Go Design Patterns (3)- Design principles

  11. Go Design Pattern (2)- Object-oriented analysis and design

  12. Go Design Pattern (1)- Syntax

language

  1. Understand pprof

  2. Go tool generate

  3. Go singleton implementation scheme

  4. Implementation principle of Go channel

  5. Implementation principle of Go timer

  6. Beego framework use

  7. Golang source BUG tracking

  8. Gin framework concise version

  9. Gin source code analysis

architecture

  1. Payment access general issues

  2. Current limiting 2

  3. Seconds kill system

  4. Distributed systems and consistency protocols

  5. Service framework and registry for microservices

  6. Discussion on Micro-service

  7. Current limiting implementation 1

  8. CDN request process details

  9. Common Cache tips

  10. How to effectively connect with third-party payment

  11. Algorithm is summarized

storage

  1. MySQL development specification

  2. Redis implements distributed locking

  3. The implementation principle of atomicity, consistency and persistence of transactions

  4. InnoDB locks and transactions

network

  1. HTTP2.0 basics tutorial

  2. HTTPS Configuration Combat

  3. HTTPS Connection Process

  4. TCP Performance Optimization

tool

  1. GoLand Practical skills

  2. Automatically generate go struct from mysql table

  3. Markdown editor recommends – Typora

Reading notes

  1. Selected by MAO

  2. The principle of

  3. History As A Mirror

  4. Agile revolution

  5. How to exercise your memory

  6. Simple Logic – After reading

  7. Hot Wind – After reading

  8. Analects of Confucius – After reading

  9. Sun Tzu’s Art of War – Reflections from reading

thinking

  1. Struggle to mobilize all forces for victory

  2. Anti-liberalism

  3. practical

  4. The standard by which you judge yourself

  5. Service team holiday shift plan

  6. Project process management

  7. Some thoughts on project management

  8. Some thoughts on product manager

  9. Thinking about programmer career development

  10. Thinking about code review