My Wallet Design
- Description of wallet object:
- A wallet is an object that can hold money (bills), cards (credit, identification, discount, ...) and photos.
- A user can ask for a list of each category item from the wallet, insert these items into a wallet, or remove these items from the wallet.
- A wallet is a storage container, with no knowledge of finances (it can not make change, it can not even total the values of the bills)
- For photos, you don't have to remove a picture from the wallet to display it.
- Money and cards are a standard size, photos are not.
- Methods
- Bill related methods:
- GetNumberOfBillsHeld: this will return the number of bills stored in the walled
- GetBillLimit: This will return the maximum number of bills the wallet can hold.
- InsertBill: this will insert a single bill in the wallet.
- RemoveBill: Remove a bill of a given type from the wallet.
- GetBillList: return a list of bills and the quantity of each.
- Card related methods
- GetNumberofCardsHeld: Get the current number of cards in the wallet.
- GetCardLimit: Return how many cards the wallet will hold
- InsertCard: Insert a card into the wallet
- RemoveCard: Given a card id, remove and return the associated card.
- GetCardList: Get a list of cards currently held in the wallet.
- PhotoRelatedItems
- GetNumberofPhotosHeld: Get the current number of photos in the wallet.
- GetPohtoLimit: Return how many photos a wallet can hold.
- InsertPohto: Insert a photo into the wallet.
- RemovePohto: Given a photo id, remove it from the wallet
- GetPohtoList: Return a list of photo names and ids
- DisplayPhoto: Given a photo number, display that photo
- DoesPhotoFit: Given a photo, return true if it will "fit" dimension wise in the wallet.
- Objects required
- A bill object, it should be able to provide currency and value.
- A card object, for this level it should support the == operator and provide some sort of "name" or identification.
- A photo object.
- Needs a display method.
- Needs an identification field such as name or description. This name should be unique.
- Needs a dimension field.
- What can you store in a walled
- The wallet can store from 0 to an object determined maximum of bills.
- The wallet can store from 0 to an object determined maximum of cards.
- A wallet can store from 0 an object determined maximum of photos
- A wallet can store photos less that MAX_WIDTH x MAX_HEIGHT in size. These constants are per object.
- Some Thoughts
- After all of my reading the last month, I probably would build a hierarchy of WalletObjects
- The maximum sizes are determined by the object when it is created.
- You might provide a low cost and high cost wallet with different capabilities.
- I started to specify that the wallet will have an array of bills. This is an implementation detail that has no place here.