I'm currently getting in to design patterns and I'm finding them very useful, however I'm now refactoring an older program and I'm needing some advice.
I've set up a User class, then made NewUser and ExistingUser subclasses. But I'm wondering where is the best place to catch the user's errors e.g. if they enter an incorrect age, or an incorrect name etc. Would you do this in the form itself or in the User class? or perhaps create a separate class for it?
The idea is the user's info gets written to a file if they are new, or if they are returning they can edit their info, so either way their details need to be correct. I've tried searching google but not really had any luck
You're not really talking about GUI design but more about the programs architecture. There are many ideas about how to separate different aspects of the program and many solutions. However since this is the beginning java section I would start with the MVCpattern.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.