blacktie524 Posted March 6, 2011 Share Posted March 6, 2011 Hi, I know this is a very basic question, but I sometimes find myself struggling to figure out when to split a single object method into multiple methods. For example, I am trying to set up an ACL using Zend_Acl and Zend_Auth, as shown in this tutorial: http://devzone.zend.com/article/1665. However, I am wondering if the My_Plugin_Auth::preDispatch() method should invoke calls to a method called authenticate() and a method called authorize(), instead of having everything lumped in under preDispatch(). I was thinking that this would make the code more readable and encapsulate the logic into its smaller parts, but i'm not sure if this is reason enough. Link to comment https://forums.phpfreaks.com/topic/229818-how-do-you-know-exactly-when-to-split-an-object-method-into-2-or-more/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.