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

Is a controller a factory?

 
Kevin Broderick
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quick question people,

Is a controller a factory. Now please excuse my ignorance but MVC, factory and other pattern terminology is all new to me and at this point of the project I'm feeling a little lost.

What I intend to happen would be on the class run main method, I'd get the mode first, then activate configuration to get database parameters, port number, ip address, and then call a controller class that decides on the gui front by a factory class that controller class has.

This Controller class would then create the client gui passing in a service passed by the factory or a server gui if server was specified by the mode.

does this sound wrong?

Thanks
 
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 Kevin,

Sounds a bit abstract, so I'll describe my approach: the main window is created passing the mode the application is running in (standalone or network). Then a dialog is shown to enter configuration settings (based on the application mode). Then a controller is created with the parameters from the dialog. The main window has a reference to this controller and this controller is used to do all the work (search rooms, book room,...).
The controller has a reference to the business service and the appropriate business service is retrieved (similar to how the service is retrieved in Andrew's book) depending on the application mode .

Hope it helps!
Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic