Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Framework Anti-Patterns #4

Open
markavitale opened this issue Jun 5, 2020 · 0 comments
Open

Application Framework Anti-Patterns #4

markavitale opened this issue Jun 5, 2020 · 0 comments
Labels
proposed convention A new convention for the guidelines

Comments

@markavitale
Copy link
Contributor

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

@markavitale markavitale added the proposed convention A new convention for the guidelines label Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposed convention A new convention for the guidelines
Projects
None yet
Development

No branches or pull requests

1 participant