Skip to content

danielbd9/Solid-Principles-Android-Kotlin

Repository files navigation

SOLID Principles in Kotlin

This repository contains examples demonstrating the SOLID principles in Kotlin. SOLID is an acronym that represents five principles of object-oriented programming and design. These principles help to create more understandable, flexible, and maintainable software.

SOLID Principles

  1. Single Responsibility Principle (SRP)
  2. Open/Closed Principle (OCP)
  3. Liskov Substitution Principle (LSP)
  4. Interface Segregation Principle (ISP)
  5. Dependency Inversion Principle (DIP)

Single Responsibility Principle (SRP): A class should have only one reason to change, meaning it should have only one responsibility.

Open/Closed Principle (OCP): Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification.

Liskov Substitution Principle (LSP): Objects of a derived class should be able to replace objects of a base class without altering the functionality of the program.

Interface Segregation Principle (ISP): A class should not be forced to implement interfaces it does not use; specific interfaces are better than a single general interface.

Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules; both should depend on abstractions. Abstractions should not depend on details; details should depend on abstractions.

How to Run

To run the examples, clone this repository and open it in your favorite Kotlin IDE (such as IntelliJ IDEA). You can then execute each example from the main function in the respective Kotlin file.

git clone https://github.com/yourusername/solid-principles-android-kotlin.git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages