monk.e.boy wrote: > > > > bparise wrote: >> >> >> For some reason I don't really like imposing this dependency on the Post >> side. Maybe I should decouple it and create a Topic::savePost(Post) that >> takes care of this? >> >> > > BINGO! ;) >
Maybe this question is part of a larger design pattern. I really like the idea of having all functionality encapsulated in 1 class, but then again I don't want to have to repeat myself. For instance... Topic::savePost(Post) Topic::deletePost(Post) Post::changetTopic(Topic) Topic::sendEmailNotifications() Ideally, these could all be under 1 "service" class... this way the "models" don't have anything defined in them other than the ORM stuff. ForumService::changeTopic(Post $post, Topic $newTopic) ForumService::savePost(Post $post) ForumService::deletePost(Post $post) ForumService::sendEmailNotifications(Topic $topic) What are your thoughts about this? I feel its a bit of redundancy since most of these methods are only going to be called within 1 place anyways. -- View this message in context: http://n4.nabble.com/Doctrine-Counter-Behavior-tp1010418p1012383.html Sent from the Zend Framework mailing list archive at Nabble.com.
