Skip to content

Real World Benefits

qertoip edited this page Feb 26, 2012 · 1 revision

Use Case Driven Architecture AKA Entity-Control-Boundary Pattern

  • solves models obesity problem
    • there is now obvious place to put (hundreds?!) of your User model methods:
      • the User use cases
  • much faster functional and unit tests
    • isolation from ActiveRecord allows you to plug memory-based persistence backend
    • enjoy true TDD without hacky workarounds
  • easier to upgrade frameworks
    • ActiveRecord 3.2 has different API than ActiveRecord 2.3
    • thanks to isolation you have to change code only in one place - the adapter
  • easier to remove frameworks
  • easier to plug frontends other than DHTML, i.e.: * functional tests * rake tasks * API (services) * CLI (command line interface) * GUI (fat) * Voice UI? * Thoughts UI?
  • easier to migrate to the other relational database * MySQL <-> PostgreSQL <-> Oracle
  • easier to migrate to a completely different database paradigm * Relational <-> Document-oriented <-> Object-oriented <-> Flat-files <-> ActiveResource? <-> ruby-git?? <-> and what not
  • easier to swap MVC framework * since controllers are thinner than ever and use cases are encapsulated in, well, UseCases, it's easier to swap between MVC frameworks like ActionPack and Sinatra
Clone this wiki locally