Architecture and Design System related QnA
Created
July 14, 2026 12:38
-
-
Save byJeevan/cb021c45bf0ebd04ddd1325c88e5d110 to your computer and use it in GitHub Desktop.
Architecture and Design System QnA
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SOLID Principle
The SOLID principles are 5 design principles used to write clean, maintainable, and scalable code.
S — Single Responsibility Principle (SRP)
A class should have only one reason to change.
→ One class = one responsibility.
O — Open/Closed Principle (OCP)
Code should be open for extension but closed for modification.
→ Add new behavior without changing existing code.
L — Liskov Substitution Principle (LSP)
Subclasses should be replaceable for their parent classes without breaking behavior.
→ Child class must behave correctly as parent.
I — Interface Segregation Principle (ISP)
Don’t force classes to implement methods they don’t need.
→ Create small, specific interfaces.
D — Dependency Inversion Principle (DIP)
Depend on abstractions, not concrete implementations.
→ Use protocols/interfaces instead of direct class dependency.
Simple iOS Example
Instead of:
Prefer:
This follows DIP and improves testing & flexibility.