Skip to content

Application Framework Anti-Patterns #4

@markavitale

Description

@markavitale

Convention

  • Don't make assumptions about a reverse-dependency's implementation. AKA, don't assume NSApp or NSApp's delegate conforms to a given protocol (even checking for conformance is wrong, because you shouldn't know about
  • Provide a delegate property in this case, don't directly access the application delegate. The application delegate could be your delegate, but you shouldn't know or care, only the Application Delegate would know or care in that case.

Rationale

These types of reverse dependencies make it harder to refactor and reorganize code and make components inherently less reusable.

Example

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions