Skip to content

Query in Dependency Inversion (violation) example #1

@Fahad-Ahmad9450

Description

@Fahad-Ahmad9450

PaymentService(CreditCardProcessor()) // high level class CreditCardProcessor depends on low level class PaymentService which violates DIP.

Isn't PaymentService the high level class that depends on CreditCardProcessor as the low level class? Can you please explain how the dependency is working here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions