Skip to content

Commit 4be9568

Browse files
authored
Merge pull request #8 from rsachdeva/v0.60.2
README Updates: Types-specific crates and their purpose
2 parents e6f0986 + eaa977f commit 4be9568

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,33 @@ AWS deployments.
694694
See cargo workspace members:
695695
[Cargo.toml](Cargo.toml)
696696

697+
#### Types-specific crates and their purpose
698+
699+
The workspace includes several -types suffixed crates that handle domain models, type definitions, business logic and
700+
conversions:
701+
702+
* **drive-deposits-rest-types**: REST API request/response types and validations
703+
* **drive-deposits-proto-grpc-types**: gRPC protocol buffer generated types
704+
* **drive-deposits-cal-types**: Core calculation domain models and business logic
705+
* **drive-deposits-lambda-db-types**: DynamoDB item types and conversions
706+
707+
This separation provides key benefits:
708+
709+
1. **Dependency Management**: Keeps dependencies lean by isolating type definitions. For example,
710+
drive-deposits-rest-types prevents REST-specific dependencies from leaking into other components.
711+
712+
2. **Clear Boundaries**: Each -types crate establishes clear domain boundaries and ownership of data models.
713+
714+
3. **Reusability**: Types and conversion logic can be reused across multiple crates without circular dependencies. For
715+
example, allows in module fashion re-use of drive-deposits-rest-types crates in various crates as required without
716+
the actual axum dependency from drive-deposits-rest-gateway-server crate.
717+
718+
4. **Evolution Flexibility**: While some of these crates could be merged as modules into their consuming crates, the
719+
current separation allows evolution of the type system.
720+
721+
The -types crates represent the current optimal structure based on the system's needs. As the codebase evolves, they
722+
could be mergedinto modules if tighter coupling provides clear advantages.
723+
697724
#### Naming: why keeping prefix drive-deposits
698725

699726
Using the "drive-deposits-" prefix for crate names clearly distinguishes these as separate crates within

0 commit comments

Comments
 (0)