Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ====WHAT I'M DOING WITH THE DATA CLASSES====
- AuctionStaff User:
- - will be the only one who gets direct access to calendar
- - AuctionCalendar class will have setter methods for adjusting default values
- All Other Users:
- - Will be given the DataHandler, which will contain all methods for retrieving the necessary info
- from calendar/user databases. This lets me funnel data through one location, and ensures every individual person
- isn't doing something different with the data. If there are more methods you guys need, just let me know and I can write them out.
- ====MY IDEA ON HOW THE PROGRAM SHOULD FLOW====
- Suggested flow of the program:
- 1. Run Program
- 2. GUI Frame loads, with the login panel loaded by default
- 3. User enters email, login panel identifies user type, opens a new BidderGUI/ContactGUI etc based on type of user. This panel replaces the login panel.
- Observable/observer (SUGGESTED, I am not an expert in GUI stuff so disregard if this won't work)
- - Frame extends JFrame, implements Observer
- - Calendar extends observable
- - Frame has a JPanel variable that references the current active panel.
- - Each panel has an updateValues method
- - When a change is made in the Calendar (new auction added, new bid added, etc etc):
- 1. The Calendar class does the notify call
- 2. The frame sees there is a change, and calls to the update method of whatever panel is active (via its reference variable)
- 3. The update method then calls to applicable methods for updating fields. For example: it can clear out a window that lists all upcoming auctions, and repopulate it again. New variables will show up if there are any, otherwise it
- will just repopulate the same thing.
- This might not completely efficient, but it will still update instantly (because computers are fast) and it will probably be pretty clean.
- ====QUICK DESCRIPTION OF METHODS BEING ADDED TO DATA HANDLER====
- Data Handler methods so far:
- 1. get a user (mostly just for login)
- 2. getAuctionsByOrg() <- returns an ArrayList of auctions that belong to a certain organization. Can replace the array list in a contact's class (since a contact belongs to an org)
- 3. getAuctionByID() <- Self explanatory. Each auction has a unique id
- 4. getActiveAuctions() <- Returns an array list of auctions that have been scheduled but haven't yet happened
- 5. getAuctionItemsByAuction() <- returns a HashMap<Integer, AuctionItem> of auction items. Really, this just returns
- the inventory sheet in the Auction class, but it can be rewritten if you guys want to remove that field from that class.
- 6. getAuctionItem() <- two versions of this exist, (overloaded constructor), one is by just auction item ID, which iterates through all auctions looking for the item id, and one that accepts an itemID and an Auction, which works a lot faster. Either can be useful depending on situation.
- More to come as well...let me know if theres anything you guys know you need.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement