I'm going to write a simple password manager, which is going to store my accounts encrypted. Here is description of the classes ,
LoginManager - This class will be responsible for authenticating the user, since the data on the harddrive will be encrypted, it will succeed only if the data is succesfully decrypted, the first line of the data file will be [DECRYPTED], so that the program can understand that the data is succesfully decrypted and allow the user to procced to the user interface.
Dependecies:
- DataChecker
- CryptographyManager
- StorageManager
- UserInterface
UserInterface - This class will be responsible for editing, searching, viewing and adding data(accounts). Dependecies:
- DataManager
DataManager - The responsability of this class is to manage the data, it will containg an tree or hash table of the data. It must be able to search, edit and add new data to the data structure. Dependecies:
- Data
Data - This class contains the data splitted into fields - ID, accout, comment, password. It should provide proper encapsulation.
DataChecker - The responsability of this class is to verify that the first line of given file is [DECRYPTED], said in another way to check if the data is succesfully decrypted, and encrypted(before closing the program the file must be encryptd).
StorageManager - This class is responsible for reading and writing data from the disk.
CryptographyManager - this class is responsible for storing the cryptography algorithm Dependecies:
- CryptographyAlgorithm
CryptograpghyAlgorithm - This is interface for different cryptography algorithms, every class should implement methods for encrypting and decrypting.
I think I've made this design over complicated. The program isn't so complicated to make use of any design pattern, so I tried to follow the solid principles. What bothers me the most is that CryptographyManager seems useless. I would like to know if I'm violating the SOLID principles.
DataChecker
andUserInterface
have a curious relationship.