I have four classes flight, passenger, seating chart, and waiting list. I'm trying to create a gui. I am new to swing so I dont know how it is done. should I create a separate class for a gui and build all the gui there or should I incorporate my gui code in those already existing classes? how is it implemented if there is a general guideline?
Asked
Active
Viewed 98 times
2 Answers
3
The classes that you mention are model classes; they are used to abstract the data of your system. You should never put your presentation [GUI] code in model classes. You must have separate classes/code for your presentation[GUI].
The general guideline is that :
Separate Presentation, Controller and Model code into different classes. Use the model-view-controller design pattern for your system.

Swaranga Sarma
- 13,055
- 19
- 60
- 93
0
In all programming languages is nice to separate UI and code. It's better to understand and keeps you code clean.

evilone
- 22,410
- 7
- 80
- 107