Opened 14 years ago
Closed 13 years ago
#430 closed enhancement (fixed)
Refactor DataManager
Reported by: | heikki | Owned by: | heikki |
---|---|---|---|
Priority: | minor | Milestone: | v2.7.0 |
Component: | General | Version: | v2.6.2 |
Keywords: | refactoring, datamanager | Cc: |
Description
DataManager has grown a very large public interface with many methods with almost the same signature used for practically the same purposes.
For example, there are 3 methods "IndexMetadata" (and also a "IndexMetadataGroup" and "IndexMetadataI"); 2 methods "InsertMetadata" (and also 3 methods "InsertMetadataExt"); 2 methods "updateFixedInfo" (and also "updateFixedInfoExisting" and updateFixedInfoNew"); 2 methods "updateMetadata" (and "updateMetadataEmbedded", "updateMetadataExt", 2 methods "updateMetadataOwner"); and so on and so forth.
To add insult to injury most of these have no inline documentation about their purpose whatsoever. This situation obscures the code and makes it harder to do any changes.
Propose to introduce a class MetadataDao, which deals with all the metadata persistency functions, that has the simplest possible public interface (hopefully only "create", "update", "delete", or maybe even only "save" and "delete"), and refactor unclear DataManager interface accordingly.
Change History (6)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Owner: | changed from | to
---|
comment:6 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Reduced # of insert and update methods in XmlSerializer to 1 each.
In scope of this is dealing with class XmlSerializer. Despite its promising, general name, it just handles getting metadata into the metadata table. It suffers from the same super-overloading as DataManager. This class has seen its last days, as far as I'm concerned !