jcropp
jcropp

Reputation: 1246

Single or multiple ZF2 controllers

I am developing a ZF2 project that will include 20 or 30 different action functions. I can put all of the functions into a single controller or create several smaller controllers. As the number of action functions grows, it seems like having a single, conglomerate controller would be inefficient since one-off calls to individual functions in the controller would only utilize a fraction of the controller’s code. It also becomes a chore to locate the functions that I need to tweak.

What should I consider (performance or otherwise) in my decision to use a single controller or multiple controllers?

Upvotes: 0

Views: 47

Answers (1)

Ruben
Ruben

Reputation: 5095

The issue is not so much runtime efficiency, but more a design matter instead. I would strongly recommend to split up the required functionality over multiple controllers or, better yet, into multiple modules grouping related functionality and promoting re-use. You will thank yourself later when you have to maintain the application if you choose a better software design.

Upvotes: 1

Related Questions