Chapter 6. Back to Business – The Service Layer
The service layer is the nucleus of the application; it is where the business logic resides. The business logic encapsulates the rules that define the working application and it is where a significant amount of development time is spent. Enhancements, changing requirements, and ongoing maintenance will usually require modifications to the service layer. Business rules may include such operations as restricting access to specific roles, security constraints, calculations, validations, compliance checks, and logging, to name a few.
Some typical business logic examples could include the following:
- Only administrators can change the country assigned to a user
- Administrators can only change a user to a country in their own geographical region
- If payment is made in a currency other that USD, an exchange rate premium of 5 percent must be added
- An Australian zip code must be exactly four digits
- Reassigning an invoice to the Canadian affiliate...