> For the complete documentation index, see [llms.txt](https://edsonha.gitbook.io/my-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edsonha.gitbook.io/my-gitbook/refactoring/code-smells/god-class.md).

# God Class

```javascript
//Problem:
class CustomerService {
  calculateOrderDiscount(aProducts, oCustomer) {
    // do work
  }
  isValidCustomer(oCustomer, oOrder) {
    // do work
  }
  gatherOrderErrors(aProducts, oCustomer) {
    // do work
  }
  register(oCustomer) {
    // do work
  }
  forgotPassword(oCustomer) {
    // do work
  }
}


//**Solution**:
class CustomerOrderService {
  calculateOrderDiscount(aProducts, oCustomer) {
    // do work
  }
  isValidCustomer(oCustomer, oOrder) {
    // do work
  }
  gatherOrderErrors(aProducts, oCustomer) {
    // do work
  }
}

class CustomerRegistrationService {
register(oCustomer) {
    // do work
  }
  forgotPassword(oCustomer) {
    // do work
  }
}
```
