0

MVC - How many controllers ?

asked 2010-09-07 12:00:52 +0800

enricoge gravatar image enricoge
27 1 1

What is the best practice about the number of controllers for a ZK application ?
One controller for each ID space, one controller for each group of controls ....

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-09-07 15:05:08 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

I can speak only for me. I do one controller per ID space (window). If i have more than one window for a module logic (i.e. several tabs) i have a mainController who knows all other 'sub'-controllers and vice versa.

link publish delete flag offensive edit

answered 2010-09-08 07:35:30 +0800

enricoge gravatar image enricoge
27 1 1

What do you mean for 'knows all other sub-controllers'.

link publish delete flag offensive edit

answered 2010-09-08 15:46:38 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-09-08 15:48:05 +0800

Means that the MainController have access to the instances of all other tab-controllers that are belongs to this module. And vice versa the tab-controllers have access back to the mainController because it was overhanded at creation time.

ArticleMainController
-- ArticleListController
-- ArticleDetailController
-- ArticleStockController
-- . . .

Have a look on the Zksample2, the three modules that are worked with annotated databinding (articles (adb), branches (adb), offices (adb) )

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-09-07 12:00:52 +0800

Seen: 907 times

Last updated: Sep 08 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More