• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCJD and MVC ones again

 
Jacek Balcerski
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
According t what I have read about MVC patter I see three options to implement assignment:
1) Use famous observer pattern

2) Make POJO controllers. Controller would implement Then I would define method in view In this method for every gui element I need I would call where is my controller. Then in controller in method I would make my choices according to action commands.

3) Make POJO controllers. In controller I would define private classes (each implementing ActionListener or WindowEvent etc) implementing calls to businesses logic . In view I would define getters returning gui elements I'am interested in. In controller I would call those getters. On returned GUI elements I would call passing already defined objects <ActionListener>.

I personally think 3 version is the most clean but I'm not really sure is it acceptable from exterminator point of view. What do you think of that ?
Jacek
a) sorry for my English
b) I'm not strict GUI developer so sorry if you consider my questions silly
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacek,

Welcome to the JavaRanch!

Whatever approach you take will be fine if you don't break any must requirement, just explain your decisions in the choices.txt file.

And for the record. I used:
- observer pattern (I have 1 panel to enter configuration settings, which is used to enter server details, connection properties in local and networked mode)
- ActionListeners (both private -named- inner classes and anonymous inner classes)
- a controller (which holds a reference to one of the business service implementations depending on the mode the application is running in)

Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic