Friday, January 11, 2008

Command-Query Separation Principle

The principle states that every method should either be:
  • a command method that performs an action (updating, coordinting, ...) and is void (no return value); or
  • a query that returns data to the caller and has no side effects - it should not permanently change the state of any objects

But - and this is the key point - a method should not be both

Applying UML and Patterns by Craig Larman

1 comment:

CresceNet said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my site, it is about the CresceNet, I hope you enjoy. The address is http://www.provedorcrescenet.com . A hug.