Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Reusable business processes - Logic that tends to be called more than once or from more than one location should be wrapped up in a service.
  • Self-contained - Services should be capable of performing their duties only using the supplied arguments. Thus, data stored in global variables, commons, etc., cannot be used, since this establishes a state that might not be duplicated under other conditions. In this regard, services are black boxes, engines that receive incoming data and send back a response. The same incoming data will always yield the same response. 
  • Modular - A service can rely upon other services, as long as each service follow follows the same basic key principles described in this article.

When a service is designed using the above principles, it is also suitable for unit testing. This makes it easier to validate the proper functionality of any service without having to run the full application. It also makes it easier to confirm that changes to the service logic (such as refactoring) does not alter expected behavior.