================================================== Using static fields vs. using an additional class ================================================== Think about representing 'sumBalance' and 'idgenerator' in a separate class such as a Bank class (yes by adding an additional class). The scheme that we studied, namely introducing 'sumBalance' and 'idgenerator' in Account as static fields works well if we want to keep track of information for only one bank. If we want to keep track of this sort of information for multiple banks, how would we do it? We'll talk about it in class and possibly create a separate class in class together if time allows. Or, we will see it in our next problem set. Interesting question: Can we do without static fields altogether in programming? That is, we can use dynamic fields of an additional class instead of static fields in the current class? If you were to use an additional class, think about what you would have to do. (1) You will have to create an additional class; (2) You will have to create an instance of it before you can do anything; (3) You will have to store that instance somewhere so that you will have a handle on it to be able to access, but where? Hmmm... It would have to be stored in a static field of that other class or in the current object's class, right? Otherwise, create yet another class and so on and . . . Where does it end? So, you see that you will need to use a static field at some point to break that infinite chain, right? You might argue... what if we remember the bank object in a field of each account object? That would work, but would that be a good design?