Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Is design pattern required for simple dialog

Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've a small question here.
Do I need to implement a mediator in a dialog box with just a couple of components.
I didn't implement any design pattern in my dialog compared to a MVC with mediator for the Client GUI as I find there is not much of a need.
I just add the listener accordingly to needs.
Is using design pattern an absolute necessary?
Or, will anyone be penalized for not using it?
Thanks for any comments.

Han Ming
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that is a big depends. Meaning what is the benefits of MVC. Lets see, Extensibility, Flexibilty, Maintainability, and easy to read.
OK. stating that, your code is not wrong, it is just a matter of looking at it and determining if the above benefits of MVC, is better, and might meet more of the requirements of the assignment.
So, then I would ask to you, what is your opinion on that?
Now, having said all that, no you don't need it for a Dialog Box, actually if you use the JOptionPane, then you can use the following code, like I did to display all Exceptions.

[ March 05, 2002: Message edited by: Mark Spritzler ]
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
Thanks for your advice.
I understand your view that if it provide better maintainability etc etc, I should do it.
But let says for a dialog with 2 labels, 2 textfield and 2 button.
All I add in was an listener for each of the component. (of course some code for formatting layout).
Then, I think that implementing MVC here does not seem to add a huge benefit over it. Is this correct?
In this case, do I really have to implement it?
Maybe I'm rather inexperience in this, I'd like to know what is the industrial practice for this kind of decision rather that for the purpose of the assignment.


Han Ming
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic