aspose file tools*
The moose likes Beginning Java and the fly likes Tips/Design patterns for GUI design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Tips/Design patterns for GUI design" Watch "Tips/Design patterns for GUI design" New topic
Author

Tips/Design patterns for GUI design

Andy Joness
Greenhorn

Joined: Sep 15, 2009
Posts: 24
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

Joined: Oct 25, 2008
Posts: 2700

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.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tips/Design patterns for GUI design
 
Similar Threads
Design Patterns vs. Algorithms
per-session instance of servlet?
Content Management
Selection of Panel
another 486 question -ugh!