Timeline for OOP bank account program in Python 3
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 14, 2019 at 14:24 | comment | added | anfield | Ive put the classes into their own file (account.py) and then create_account, get_account etc in another file, but that second file, database.py wants the class definitions in it in order to run. I'm not sure how to pass those definitions between the two | |
Mar 13, 2019 at 21:38 | history | edited | AJNeufeld | CC BY-SA 4.0 |
Fix "smart" quotes.
|
Mar 13, 2019 at 21:37 | comment | added | AJNeufeld |
You've got several files, with typically only one class/file. One class/file is not pythonic; you end up with classes like bank_account.BankAccount , which you then work-around using from bank_account import BankAccount . You could restructure into several files, with several classes/file. One file, called model.py might contain several dumb, plain-old-data class structures for your various account types. Another file database.py could import model and provide your SQL queries for loading/saving the model data to the database. Another file business.py adds business logic, etc.
|
|
Mar 13, 2019 at 21:22 | history | edited | AJNeufeld | CC BY-SA 4.0 |
Fixed "smart" quotes. Removed "to be continued?"
|
Mar 13, 2019 at 20:03 | comment | added | anfield | thanks for commenting. Is there any way you can share some more detail on how I can go about splitting my code into layers as you mentioned? I am having trouble visualizing how I am going to accomplish this. One thing I did start doing was to take get_pin set_pin etc out and put it into its own class Identification. | |
Mar 8, 2019 at 16:55 | vote | accept | anfield | ||
Mar 8, 2019 at 16:55 | |||||
Mar 8, 2019 at 14:33 | comment | added | anfield | thanks for taking the time to comment. I will definitely take this into account | |
Mar 8, 2019 at 3:57 | history | edited | AJNeufeld | CC BY-SA 4.0 |
Septuple quoted strings???
|
Mar 8, 2019 at 3:51 | history | answered | AJNeufeld | CC BY-SA 4.0 |