Skip to content

Commit 588ccaa

Browse files
author
DeanLuus22021994
committed
refactor: remove redundant naming in infrastructure files
Fixed naming ambiguity by removing duplicate prefixes: - builders/dockerfile_builder.py builders/dockerfile.py - factories/factories.py factories/service.py - health/health_checks.py health/checks.py - models/pydantic_models.py models/validation.py Rationale: - Directory name already indicates purpose (builders/, factories/, etc.) - Redundant suffixes create ambiguity and confusion - Follows DRY principle and proper naming conventions - Cleaner imports: 'from builders.dockerfile import DockerfileBuilder' vs 'from builders.dockerfile_builder import DockerfileBuilder' Updated: - __init__.py with new import paths - README.md with correct filenames in directory structure No breaking changes - all imports still work through main __init__.py
1 parent 15b6552 commit 588ccaa

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

.devcontainer/infrastructure/README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,37 @@ Components are organized by purpose in subdirectories:
2323

2424
```text
2525
infrastructure/
26-
├── core/ # Foundational classes
26+
├── core/ # Foundational classes
2727
│ ├── __init__.py
28-
│ ├── base.py # Abstract base classes
29-
│ └── config.py # Configuration dataclasses
30-
├── builders/ # Builder patterns
28+
│ ├── base.py # Abstract base classes (ContainerService, DatabaseService)
29+
│ └── config.py # Configuration dataclasses
30+
├── builders/ # Builder patterns
3131
│ ├── __init__.py
32-
│ └── dockerfile_builder.py # Template Method for Dockerfiles
33-
├── factories/ # Factory patterns
32+
│ └── dockerfile.py # Template Method for Dockerfiles
33+
├── factories/ # Factory patterns
3434
│ ├── __init__.py
35-
│ └── factories.py # Service and component factories
36-
├── health/ # Health check strategies
35+
│ └── service.py # Service and component factories
36+
├── health/ # Health check strategies
3737
│ ├── __init__.py
38-
│ └── health_checks.py # Strategy pattern implementations
39-
├── models/ # Data models
38+
│ └── checks.py # Strategy pattern implementations
39+
├── models/ # Data models
4040
│ ├── __init__.py
41-
│ └── pydantic_models.py # Pydantic validation models
42-
├── testing/ # Test utilities
41+
│ └── validation.py # Pydantic validation models
42+
├── testing/ # Test utilities
4343
│ ├── __init__.py
44+
│ └── fixtures.py # Pytest fixtures
45+
├── cli.py # Command-line interface (entry point)
46+
├── __init__.py # Module exports
47+
└── README.md # This file
48+
```
49+
50+
├── testing/ # Test utilities
51+
│ ├── **init**.py
4452
│ └── fixtures.py # Pytest fixtures
4553
├── cli.py # Command-line interface
46-
├── __init__.py # Module exports
54+
├── **init**.py # Module exports
4755
└── README.md
56+
4857
```
4958
5059
## Architecture

.devcontainer/infrastructure/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
DatabaseService,
2424
MessageBrokerService,
2525
)
26-
from .health.health_checks import (
26+
from .health.checks import (
2727
HealthCheck,
2828
HttpHealthCheck,
2929
TcpHealthCheck,
@@ -37,17 +37,17 @@
3737
ServiceConfig,
3838
DockerComposeConfig,
3939
)
40-
from .models.pydantic_models import (
40+
from .models.validation import (
4141
EnvironmentConfigModel,
4242
ServiceConfigModel,
4343
DockerComposeConfigModel,
4444
PortModel,
4545
)
46-
from .factories.factories import (
46+
from .factories.service import (
4747
DaprComponentFactory,
4848
ServiceFactory,
4949
)
50-
from .builders.dockerfile_builder import (
50+
from .builders.dockerfile import (
5151
DockerfileBuilder,
5252
DevelopmentDockerfileBuilder,
5353
ProductionDockerfileBuilder,

0 commit comments

Comments
 (0)