Class Design

I'm currently planning a client/server booking system and i'm a bit puzzled over how I should structure my classes.

I intend to have a Client class that incorporates methods to send/receive data and establish connections with the server. I also intend to use the Client to display the appropriate JFrames according what the user is doing. If one of my JFrame classes requires data from the server should I incorporate the requests for data into my Client class or into the JFrame itself? Or would the 2nd option be poor design?

[542 byte] By [MattMcCa] at [2007-11-27 2:41:39]
# 1
A class should have one responsibility, so don't let one class be in charge of the connection AND the GUI.Have a look at the MVC pattern how to structure your GUI (and other) classes: http://en.wikipedia.org/wiki/Model-view-controller
prometheuzza at 2007-7-12 3:05:40 > top of Java-index,Java Essentials,Java Programming...
# 2

Thanks very much.

The article made a lot of sense but i'm not sure if i'm applying it right to my own system. For every JFrame I use to display information to the user should I also have a class that interpretes the data from storage? And I presume in the Java context that a controller is an event handler?

Thanks again.

MattMcCa at 2007-7-12 3:05:40 > top of Java-index,Java Essentials,Java Programming...