Skip to content

Instantly share code, notes, and snippets.

@jccovey
Created July 2, 2012 19:05
Show Gist options
  • Save jccovey/3035008 to your computer and use it in GitHub Desktop.
Save jccovey/3035008 to your computer and use it in GitHub Desktop.
"CMD" Pattern

Quoting scrame in a comment on a "MOVE" design pattern as proposed (http://cirw.in/blog/time-to-move-on/ ):

In Java/Spring-MVC, there is a typical class hierarchy of Controller -> Manager/Service -> DAO. The extra level of indirection is a very handy place to put business logic, then each class in the tier has a dedicated function:

  • Controller - Parses input, delegates the action and returns the response (rendered by the view).
  • Manager - Handles sanitized data, encapsulates business logic and makes calls into the Model / Data layer.
  • DAO - Interfaces with the data store, makes sure only good data goes in, and appropriate responses are returned.

(via http://news.ycombinator.com/item?id=4190037)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment