Skip to content

Instantly share code, notes, and snippets.

View sharunspi's full-sized avatar
🌍
Just coding

sharun k k sharunspi

🌍
Just coding
View GitHub Profile
@sharunspi
sharunspi / SOLID.MD
Last active September 30, 2022 16:20
SOLID Design principles with examples

SOLID ( Single Responsibility Principle - Open-Closed Principle - Liskov Substitution Principle - Interface Segregation Principle - Dependency Inversion Principle )

Single Responsibility Principle

Each class should solve only one problem.It can be applied to classes, software components, and microservices.

class Building {
    constructor(name, address, noOfPeople) {
        this.name = name
 this.address = address
@sharunspi
sharunspi / railwayZones.js
Created June 10, 2021 06:19
Railway zone with divisions list
railwayZones = [
{
id:1,
name:"Northern Railway",
divisions:["Delhi", "Ambala", "Firozpur", "Lucknow NR", "Moradabad"]
},
{
id:2,
name:"Northeast Frontier Railway",
divisions:["Alipurduar", "Katihar", "Rangiya", "Lumding", "Tinsukia"]