Topic: Display of lines of the table of basis in objects?
We take for an example the elementary table: CREATE TABLE tbl (key INTEGER PRIMARY KEY, cap TEXT NOT NULL); If to interpose new record with a field cap ='AAA ' (INSERT), to delete it (DELETE) and to interpose new (INSERT) with cap ='BBB '. Then in sqlite record with cap ='AAA ' and c cap ='BBB ' will have identical "key" (remote record with cap ='AAA ' means had we tell key=1, and new record will have too key=1). I develop application which should allow to open the same record in different independent windows (is more true the set of records intersection which can not zero, but for simplification we will be restricted to one record). And here we admit read any record from the table, transformed it into object, and opened this object in several windows. In one window we pushed the button to delete, then created new record, at this time at all of us still openly third window in which data of already remote record, we in it admit something we change and we push to save, and the nonsense any turns out if to use "key" as a unique identifier of object of basis. What in such cases do, enter type "cache" between classes responsible for operation with basis and the program, and all GUI working with basis subscribe for events of "cache" and if in one window the object is deleted "cache" informs windows that such object is not present?