As we all know, Delphi ListView class Direct Add, Update, delete operation speed is relatively slow, especially when the amount of data, such as the amount of data reached 5000, 10000, 50000, speed is really can be said to be "surprisingly slow." In fact, the rapid operation of the method is very simple, as we all know. In my work, many projects are used to ListView, and the response to speed is higher, so there has been a rapid operation ListView code scattered in a number of projects in many modules of the problem, and, when the interface layer data display requirements change, the natural occurrence of "repetitive code common problems." Considering compatibility issues with previous versions, there has been no mature component referencing third parties. In view of the fact that "repetitive code in a program is the easiest to cause problems and must be eliminated", you have designed a more general class structure for solving such problems. Of course, it's far from a "generic framework" (a lot of people on the market now like to make what they do, whatever it is, as a framework). In the project of adopting this structure, it is easy to implement the MVC pattern to achieve the low-level and basic requirements of the separation between business logic and interface display.
(because, the current CSDN software upload function is not available, I only put part of the code snippets in the document, there is a need for complete source, please leave a message)
Class Hierarchy:
The ListView base operation is encapsulated in the Lvcontroler package, and the core class is Tcxxlvcontroler:
(Note: The Lvcontroler class is encapsulated in a generic class structure, external users do not need to understand and access, so do not introduce.) )