File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tips/Design patterns for GUI design

 
Andy Joness
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 MVC pattern.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic