... | @@ -154,6 +154,8 @@ This approach leverages `constraints` on a domain object, but pulls those constr |
... | @@ -154,6 +154,8 @@ This approach leverages `constraints` on a domain object, but pulls those constr |
|
|
|
|
|
The content of a single Coldbox event should be as short as possible to achieve the desired results. This is an area of concern for **DRY**: If there is a significant amount of business logic going on, that should take place in a model or service layer and not the API handler, unless it is absolutely, positively certain that the business logic will only ever be used in one place. Even then, envision a subsequent version of your API: if you wanted to take your endpoint and update it from **v1** to **v2**, you would ideally only concern yourself with writing the changes in business logic in the **v2** endpoint. If you would have to replicate a lot of unchanged code from your **v1** handler, probably that portion should have gone into a service layer (whether on a model object or a separate service object).
|
|
The content of a single Coldbox event should be as short as possible to achieve the desired results. This is an area of concern for **DRY**: If there is a significant amount of business logic going on, that should take place in a model or service layer and not the API handler, unless it is absolutely, positively certain that the business logic will only ever be used in one place. Even then, envision a subsequent version of your API: if you wanted to take your endpoint and update it from **v1** to **v2**, you would ideally only concern yourself with writing the changes in business logic in the **v2** endpoint. If you would have to replicate a lot of unchanged code from your **v1** handler, probably that portion should have gone into a service layer (whether on a model object or a separate service object).
|
|
|
|
|
|
|
|
Remember: **Fat models, skinny handlers.**
|
|
|
|
|
|
## API Endpoint Conventions
|
|
## API Endpoint Conventions
|
|
|
|
|
|
### Expand
|
|
### Expand
|
... | @@ -170,7 +172,7 @@ The default behavior of `getExpandedIncludes()` is to append any values from the |
... | @@ -170,7 +172,7 @@ The default behavior of `getExpandedIncludes()` is to append any values from the |
|
|
|
|
|
`getExpandedIncludes()` is defined on the inLegaue base Quick entity.
|
|
`getExpandedIncludes()` is defined on the inLegaue base Quick entity.
|
|
|
|
|
|
Remember: **Fat models, skinny handlers.**
|
|
|
|
|
|
|
|
## Documenting API Endpoints
|
|
## Documenting API Endpoints
|
|
|
|
|
... | | ... | |