Skip to content

Category: Design Principle

Composition over Inheritance

Composition over inheritance is a design principle that is gaining increasing popularity in the world of software development. It recommends using composition, which involves combining simple objects to form more complex ones, over inheritance, which involves inheriting properties and behaviors from a parent class. In this article, we will discuss…

The Law of Demeter

The Law of Demeter is a software design principle that states that a module should not know about the inner workings of the objects it manipulates. In other words, a module should only communicate with its immediate neighbors and not with the objects that they manipulate. This principle is also…

Keep it simple, stupid (KISS)

The Keep It Simple Stupid (KISS) principle is a design principle that advocates for simplicity in software design and development. The principle states that systems should be designed and developed in the simplest way possible, without unnecessary complexity or features. The KISS principle emphasizes the importance of simplicity in software…

Open/Closed Principle

Open-Closed Principle Class should be opened for extension but closed for modification This principle promotes writing a maintainable code by having two important characteristics: Open for extension Closed for modification In short, you should be able to add almost any new feature to your class easily and will not have…

Dependency Inversion Principle

Dependency Inversion Principle Depend on abstractions, not on concretions High-level modules should not depend on low-level modules. With this theory, high level modules like the view controller, should not depend directly on low level things, like a networking component. Instead, it should depend on abstractions or in Swift term, protocol.…