Skip to content

Remove singleton? #6

@eonist

Description

@eonist

Singletons can be a source of tight coupling and testing difficulties.
Improvement:
Provide a way to inject dependencies or consider using protocols to allow for easier testing and decoupling.

protocol CrashHandling {
        func setUpCrashHandler()
        func processCrashReport()
        var sendCrashReportToServer: (([String: String]) -> Void)? { get set }
    }

    class Crashlytic: CrashHandling {
        // Implementation
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions