Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inner classe

 
Alex M�ller
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,

I've implemented my gui via MVC-Pattern and have oriented on Max's book. So i've got a guicontroller.java where i interact with the network or data tier. There's also a MainWindow.java where i display my JTable and searchfields and a RoomTableModel.java where i hold my data for the JTable.

In the book they use now inner classes to code the ActionListener for the commands such as "Rent". Now i'm not really a friend of inner classes, so i decided to put these classes into seperate classes. But now i've got an internal conflict by myself, because i need for some classes the reference of guicontroller, roomtablemodel and my two searchfields (URLyBird). I think this isn't good design, or isn't it?

Thanks for help
alex m�ller
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alex,

GUI classes or better said your View classes in your MVC design are the best place for your inner classes.

Since the view is something very specific you do good to keep your ActionListeners as inner classes in your view class.

Regards,
Darya
[ May 18, 2005: Message edited by: Darya Akbari ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic