Controllers vs Actions

17 views
Skip to first unread message

Stefan Adams

unread,
Apr 27, 2017, 1:20:31 AM4/27/17
to mojolicious
I'm building a website that can pull and push activities, and within each of these modes, you first get your list of users, then list your activities, and then you proceed to push or pull your activity to/from the selected user.

Question regarding the design of the Controllers:

Are my Controllers Push and Pull, and within each the actions are list_users, list_activities, and copy_activities?

Or, are my Controllers Users, Activities, and Copy, and within each my actions are push and pull?

Or, something different still?

Any quick advice / pointers would be greatly appreciated!  I don't think I have a good handle on application design yet.  :(

Jan Henning Thorsen

unread,
Apr 27, 2017, 2:52:32 AM4/27/17
to Mojolicious
Normally, I would say that a class is an object which does things. So I would name the controllers Users and Activities.

Stefan Adams

unread,
Apr 27, 2017, 10:21:17 AM4/27/17
to mojolicious
Thanks, Jan! Yes makes perfect sense!

I had it in my mind that everything I specified were actions: list_users et al... :/

That was stupid. :D

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscribe@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages