-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
A couple of things about the FileManager class:
- The class is
public, but all methods areinternal, so the class might as well beinternal. - All methods in the class are
static. Make the class static - The
File.Exists ? ... : ...pattern leads to unneeded repetition. UseFile.Openinstead. - Make use of the
usingstatement to ensure streams/files are being closed under exceptional circumstances. - Last but not least: the file format is binary, but the files have an .xml extension and the methods are named as if XML is being used.
Those are the most important issues, I would say. There are a few less important ones I'd still like to mention:
- Use constants for file names to avoid inconsistencies between loading and saving
- The method names feel 'asymmetrical'. If there is a
SaveFoomethod, I expect aLoadFoomethod, notGetFooorGetAllFoo. - Some Lists are being created unnecessarily while loading data (if the file has any contents).
Metadata
Metadata
Assignees
Labels
No labels