init: 클린 아키텍처 백엔드
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# adapter:outbound:objectstorage — module rules
|
||||
|
||||
## Registered identity
|
||||
|
||||
- Module ID: `adapter-outbound-objectstorage`
|
||||
- Gradle path: `:adapter:outbound:objectstorage`
|
||||
- Focused test: `./gradlew :adapter:outbound:objectstorage:test --console=plain`
|
||||
- Runtime baseline: Java 21; repository framework baseline: Spring Boot 4.0.0.
|
||||
- Registry SSOT: `.harness/project/modules.yaml`.
|
||||
|
||||
Package root: `dev.caskeleton.adapter.outbound.objectstorage`. Driven (outbound) adapter
|
||||
implementing `dev.caskeleton.application.storage.ObjectStoragePort` (application-core). Design
|
||||
rationale lives in [README.md](README.md).
|
||||
|
||||
## Responsibility
|
||||
|
||||
- Persist/retrieve binary blobs behind `ObjectStoragePort`. Two backends select the same port by
|
||||
`ca-skeleton.objectstorage.backend`: `filesystem` (default) and `s3` (S3/MinIO, AWS SDK v2).
|
||||
- Opt-in: `ObjectStorageConfig` gates each backend with `@ConditionalOnProperty`; filesystem is the
|
||||
`matchIfMissing` default. The adapters are plain classes; the config assembles them as beans.
|
||||
|
||||
## Allowed
|
||||
|
||||
- Project deps: `:application-core`, `:shared-contract` — SSOT is the
|
||||
`adapter-outbound-objectstorage` entry in `.harness/project/modules.yaml`; `src/build.gradle`
|
||||
enforces it. No
|
||||
`:domain-core`, no sibling adapters (shared outbound code would go through `:adapter:outbound:support`
|
||||
if ever needed).
|
||||
- External: `software.amazon.awssdk:s3` (version via the module-scoped `software.amazon.awssdk:bom`
|
||||
platform, pinned by root `ext.awsSdkVersion`), `spring-boot-starter`,
|
||||
`spring-boot-configuration-processor` (annotation processor).
|
||||
|
||||
## Forbidden
|
||||
|
||||
- Inbound adapters, sibling outbound adapters, persistence, `app-bootstrap`, `sample-portfolio`
|
||||
(ArchUnit `OUTBOUND_ADAPTERS_*` family rules).
|
||||
- Leaking a raw AWS SDK type across `ObjectStoragePort` (B7) — the port returns only `StoredObject`
|
||||
/ `byte[]` / primitives.
|
||||
- Fully-qualified inline type references; more than one public top-level type per file.
|
||||
|
||||
## Tests
|
||||
|
||||
`FilesystemObjectStorageAdapterTest` (temp-dir round-trip), `S3ObjectStorageAdapterTest` (mocked
|
||||
`S3Client` mapping), `S3ObjectStorageAdapterIT` (Testcontainers MinIO, `disabledWithoutDocker`).
|
||||
|
||||
```bash
|
||||
cd src
|
||||
./gradlew :adapter:outbound:objectstorage:check
|
||||
```
|
||||
Reference in New Issue
Block a user