Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
david_smith committed Nov 1, 2024
1 parent a48f5e8 commit 2657996
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ By using the `#[Describe()]` attribute, you can specify:
- **Default Values** and Required Properties: Ensure properties have sensible defaults or enforce their presence.
- **Type Casting**: Handle primitives, custom classes, enums, and more.

This approach leads to code that’s easier to maintain and less prone to errors, as it centralizes value resolution logic within your data models.
This approach allows you to centralize value resolution upstream of your business logic, drastically reducing downstream checks.

### Better Than Defensive Programming

Traditional defensive programming requires you to scatter validation and type-checking throughout your code, leading to verbosity and potential
oversights. With a **DataModel**, you define value resolution logic once, using the `#[Describe()]` attribute, and let the trait handle the rest.
oversights. With a **DataModel**, you define value resolution logic once, using the `#[Describe()]` attribute.

This method reduces boilerplate, minimizes the risk of missing checks, and results in cleaner, more readable code. It shifts the focus from defensive
checks to declarative definitions, improving both development speed and code quality.
Expand Down

0 comments on commit 2657996

Please sign in to comment.