Architecture - ptal/online-broker GitHub Wiki
Architecture schema
- The request routing is described in the online-broker/online-broker/conf/routes file and consists of URL and methods call couple.
- We use the API SecureSocial for the authentication, it is implemented with SecuredAction and is nearly automatic, the only logic needed is implemented in the class MySQLUserService.
- Finally the requests are checked with a Json validator.
We avoid exceptions and have opt for a monadic programming style. What does it means? Concretely we are using the structures Option[A] or /[Error, A] to report errors. It has several advantages, firstly you can communicate between threads (you can't launch exception from one thread to another), secondly it's nearly impossible to forget to check if the result is an error or a valid result (you can easily forget to catch an exception). Our application is robust.