Skip to content

Ambiguous file name due to duplicated name on entirely codebase #12

Description

@rnoro

We use clean architecture to improve code reusability and clarity.
But as we divide each domain into cli, dependency, compile, bundle, deploy, and utils, filenames become ambiguous.

For example:

packpack/src/main/kotlin/org/thisisthepy/python/multiplatform/packpack/dependency/middleware/DefaultInterface.kt
packpack/src/main/kotlin/org/thisisthepy/python/multiplatform/packpack/compile/middleware/DefaultInterface.kt

This is especially difficult to read and navigate in Kotlin because package paths are already deeply nested.

Current Structure

- dependency/frontend/
    BaseInterface.kt - Base Interface for frontend
    Gradle.kt - Abstract Gradle frontend
    Cli.kt - Abstract CLI frontend
- dependency/middleware/
    BaseInterface.kt - Base interface for middleware
    DefaultInterface.kt - Abstract class for middleware
- dependency/backend/
    BaseInterface.kt - Base interface for backend
    UVInterface.kt - Abstract class for UV-specific methods
    external/UV.kt - UV-specific methods

Problem

The current names are ambiguous for two reasons:

  1. BaseInterface.kt and DefaultInterface.kt are repeated across multiple domains.
  2. Concrete implementation classes use the word Interface, for example DefaultInterface and UVInterface, which makes it unclear whether the file contains an interface or an implementation.

Suggested Structure

- dependency/frontend/
    FrontendInterface.kt
    Gradle.kt
    Cli.kt
- dependency/middleware/
    MiddlewareInterface.kt
    DefaultMiddleware.kt
- dependency/backend/
    BackendInterface.kt
    (new) DefaultBackend.kt - Abstract class for ppp native features(python-multiplatform's binary install, versioning, etc..) that uv doesn't support
    UVBackend.kt - Abstract class for UV-specific methods(this extends DefaultBackend)
    external/UV.kt

However, this structure still causes duplication across domains because each domain follows the same structure.

At the very least, the current naming structure should be revised to reduce ambiguity.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions