jerrysonguillen / PersonInformationDeskTopAppWithDatabase

Java desktop application , user can have own set of person information and contacts
0 stars 0 forks source link

Code organization #1

Open zenners opened 4 years ago

zenners commented 4 years ago

You should review some of your methods in Database.java

I'm taking a look at save() and remove() and there's a lot going on in those methods.

Somethings to pay attention to are the number of sql statements you're doing. Maybe you can break these up into smaller ones. Create separate methods for your update and insert. Use your GUI to direct which code to use. Does this button update or insert?

Next is separating the persistence (or talking to the db) from the Swing code. I'm not sure where Swing code gets controlled, but I'd recommend having return values in your methods so that you can add control flow to your UI.

zenners commented 4 years ago

or use your controller more instead of the gui

jerrysonguillen commented 4 years ago

ok sir i will make changes