Opened 13 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 heikki, 13 years ago

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 !

comment:2 by heikki, 13 years ago

Owner: changed from geonetwork-devel@… to heikki

comment:3 by heikki, 13 years ago

Insert methods dealt with in #477.

comment:4 by heikki, 13 years ago

Update methods dealt with in #479.

comment:5 by heikki, 13 years ago

Various things in #482.

comment:6 by heikki, 13 years ago

Resolution: fixed
Status: newclosed

Reduced # of insert and update methods in XmlSerializer to 1 each.

Note: See TracTickets for help on using tickets.