Why are you not thinking about things?
Yes, a lot better.
You need to decide whether a customer has an account or an account has a customer
Also does an account open another account?
Do you need “state”?
Can you have an account which does not belong to anybody?
What on earth makes you think you can have a bank with no data? Of course a bank will have fields
Do you know any database programming?
your methods will have to turn into functions or procedures and you are no longer writing OO code.
I think you have too many fields in each class.
Surely that would read customers, accounts in Bank?
you would link an account to a costumer (or maybe several customers in a Collection).
Find out about bidirectional maps;
butCampbell, what do you think about it??
You are building this app, not I.Tushar, what do you think about it??
You are building this app, not I.
Paweł Baczyński wrote:
This might be considered cosmetics, but you don't have to use .length() == 0. You can use .isEmpty().
but it is very important that your code does what your documentation says it does. Especially when you are working with other programmers.
Thus it is always advisable to invoke a trim() before length()/isEmpty()
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|