Win a copy of Learn Java with Math: Using Fun Projects and Games this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Why no GUI Design Framework?

 
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For web applications, we have many frameworks available to help build our software (Struts, Hibernate, Spring etc), but why is there nothing for writing GUIs? Why not something which will help us properly apply some sort of MVC framework and separate logic from presentation? Is there nothing more than guidelines? Some sort of container and easy to maintain event handler for each component would be useful.

What is the best way to write a GUI application? Should you just create your logic-handling classes separate from the GUI classes and provide the correct method (from your logic class) for each event handler, for each GUI component?
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kashif

You may try JFrameBuilder
 
Ranch Hand
Posts: 476
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But isn't it true that all those MVC Frameworks were made to work on different media? If you have your models and controllers you can define your view even if it's Swing.

Alex
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Kashif Riaz:

For web applications, we have many frameworks available to help build our software (Struts, Hibernate, Spring etc), but why is there nothing for writing GUIs? Why not something which will help us properly apply some sort of MVC framework and separate logic from presentation? Is there nothing more than guidelines? Some sort of container and easy to maintain event handler for each component would be useful.



I don't quite understand this question---Swing is a GUI design framework
and Hibernate and Spring support writing GUI's in Swing just as much
as they do in web applications, that is to say, not at all, since they
have to do with persistence. Swing is designed to separate logic
from presentation and it will happen pretty much automagically if you
are programming in a test-driven style.

What is the best way to write a GUI application? Should you just create your logic-handling classes separate from the GUI classes and provide the correct method (from your logic class) for each event handler, for each GUI component?



If you're programming in a test-driven style then you will find that the
logic separates itself from the view. If you are doing unit testing at
all then you'll find yourself putting logic in separate classes because
it is more problematic to unit test gui classes. If you are not doing
unit testing consider starting.

That said, a rule of thumb that I use for event handling code is that
if it changes the GUI in a shallow way. e.g., disabling a button, I
tend to leave the code in the GUI class. If it changes data or uses
business rules, then I want to unit test it and will pull the code
out of the GUI class.

Cheers,
Glenn
 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
How do they get the deer to cross at the signs? Or to read this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!