Income and Spending will extend a new class Type, as they share similar attributes and methods.
During initialisation of storage in main, Storage will initialise incomes, spendings and password to restore data. Both IncomeListStorage and SpendingListStorage will serialise when load (at the start) and deserialise when save (at the end).
-It is not implemented as one class due to the complexity of the data type, for example, IncomeList extends ArrayList<Income> and Income extends Type. This means that 2 generics have to be used.
Unless IncomeList and SpendingList is extends ArrayList<Type>, but this may cause bugs like accidentally adding income to SpendingList (Can be discussed).
LoginStorage will take the hashed password at the password.txt file if it exist, else it will call createNewUser and create a new file for the newly set hashed password.
Income and Spending will extend a new class Type, as they share similar attributes and methods.
During initialisation of storage in main, Storage will initialise incomes, spendings and password to restore data. Both
IncomeListStorage
andSpendingListStorage
will serialise when load (at the start) and deserialise when save (at the end). -It is not implemented as one class due to the complexity of the data type, for example,IncomeList extends ArrayList<Income>
andIncome extends Type
. This means that 2 generics have to be used.IncomeList
andSpendingList
isextends ArrayList<Type>
, but this may cause bugs like accidentally adding income toSpendingList
(Can be discussed).LoginStorage
will take the hashed password at the password.txt file if it exist, else it will callcreateNewUser
and create a new file for the newly set hashed password.closes #21