Filter
Exclude
Time range
-
Near
🧵 Day 11/30 — #LLD DIP (Dependency Inversion Principle) 👉 High-level modules should NOT depend on low-level modules 👉 Both should depend on abstractions In simple terms: → Don’t depend on concrete classes → Depend on interfaces / contracts --- Why this matters 👇 When DIP is violated: → Tight coupling between components → Hard to change implementations → Difficult to test (no mocking) → Small changes ripple across system --- Classic example 👇 ❌ Bad design OrderService directly depends on MySQLDatabase → Changing DB = changing service → Testing becomes hard --- ✅ Better design → Create Database interface → MySQL, Postgres implement it → OrderService depends on interface Now: → Swap DB without changing service → Easy to test (mock interface) --- 💡 Key idea: Business logic should NOT care about: → Database → External APIs → Frameworks It should depend on abstractions only --- ⚠️ Tradeoffs: → More interfaces → More setup initially → Slightly complex structure But… → Highly flexible system → Easy to extend & test → Loosely coupled architecture --- 🔥 Rule: If changing a low-level detail breaks your core logic → You’re violating DIP --- Where this shows up 👇 → Database switching → Payment gateway integration → Notification providers → External APIs --- Would you: A) Directly depend on concrete classes B) Use abstractions for flexibility What would you choose and why? 👇
🧵 Day 10/30 — #LLD ISP (Interface Segregation Principle) 👉 “Clients should not be forced to depend on methods they don’t use” In simple terms: → Don’t create fat interfaces → Create small, focused ones --- Why this matters 👇 When ISP is violated: → Classes implement unused methods → Leads to empty / dummy implementations → Increases confusion → Makes code harder to maintain --- Classic example 👇 ❌ Bad design One interface: Worker → work() → eat() Now a Robot implements it 🤖 → work() ✅ → eat()? ❌ (doesn’t make sense) Forced implementation = bad design --- ✅ Better design Split interfaces: → Workable → work() → Eatable → eat() Now: → Human → implements both → Robot → implements only work() Clean. Logical. Flexible. --- 💡 Key idea: Interfaces should be: → Small → Specific → Role-based Not “one-size-fits-all” --- ⚠️ Tradeoffs: → More interfaces → Slightly more design effort But… → Better flexibility → Easier testing → Cleaner architecture --- 🔥 Rule: If a class is implementing methods it doesn’t need → Your interface is too big --- Where this shows up 👇 → Payment systems (different capabilities) → Notification services (SMS vs Email) → API design (modular endpoints) --- Would you: A) One big interface for everything B) Multiple small focused interfaces What would you choose and why? 👇
11
1
13
393
You “fixed” it: class OrderService { private Database db; public OrderService() { this.db = new MySQLDatabase(); } } Did you really invert the dependency? Or just hide it inside the constructor? 👀 #CleanArchitecture
3
14
3,000
Replying to @javarevisited
Tight coupling. - Hardcoded MySQLDatabase -> no flexibility - Cannot switch to PostgreSQL easily - Unit testing becomes hard (no mocking) Violates Dependency Inversion. Should depend on interface, not concrete class
1
14
731
Spot the issue: class OrderService { private MySQLDatabase db = new MySQLDatabase(); } Works fine today. But what happens when: You add PostgreSQL? You write unit tests? You move to cloud? #DesignPatterns
2
13
2,164
Replying to @SumitM_X
Dependency Inversion is a SOLID principle that says depend on abstractions, not concrete classes. Inversion of Control means shifting object creation and lifecycle management to a framework/container. Dependency Injection is the technique used by IoC containers to inject dependencies into classes (via constructor, setter, or field). 1. Dependency Inversion Principle (DIP) Type: Design Principle (SOLID) High-level modules should NOT depend on low-level modules. Both should depend on abstractions. In simple words: Depend on interfaces, not concrete classes. Without DIP class MySQLDatabase { void save(String data) { System.out.println("Saved to MySQL"); } } class UserService { private MySQLDatabase db = new MySQLDatabase(); // Tight coupling void saveUser(String user) { db. save(user); } } Problem: - UserService tightly coupled to MySQL - Cannot switch to MongoDB / PostgreSQL easily With DIP: interface Database { void save(String data); } class MySQLDatabase implements Database { public void save(String data) { System.out.println("Saved to MySQL"); } } class UserService { private Database db; UserService(Database db) { // Depends on abstraction this.db = db; } void saveUser(String user) { db.save(user); } } - Now we can plug any DB implementation. 2. Inversion of Control (IoC) Type: Design Pattern / Architecture Principle Control of object creation & lifecycle is inverted (shifted) from the application code to a container/framework. Instead of YOU creating objects → Framework creates & manages them. Without IoC UserService service = new UserService(new MySQLDatabase()); You control creation. With IoC (Spring Example) @ Service class UserService { private Database db; public UserService(Database db) { this.db = db; } } Spring Container does: - Create Database bean - Create UserService bean - Inject dependency You don’t control creation anymore. 3. Dependency Injection (DI) Type: Implementation Technique of IoC Dependencies are injected into a class rather than created inside it. DI is HOW IoC is achieved. Types of DI 1. Constructor Injection (Recommended) class UserService { private Database db; UserService(Database db) { this.db = db; } } 2. Setter Injection class UserService { private Database db; void setDatabase(Database db) { this.db = db; } } 3. Field Injection (Spring) @ Autowired private Database db;

3
7
1,756
5️⃣ Dependency Inversion Principle Depende de abstracciones, no de implementaciones concretas. ❌ OrderService usa directamente MySQLDatabase. Cambiar a PostgresDatabase obliga a reescribir el servicio. ✅ Crear interfaz Database y pasarla por inyección de dependencias. El servicio no depende del motor concreto.
1
1
3
1,674
Your code is correct. Your tests pass. ✅ But when traffic spikes, your data looks weird. 😵‍💫 Welcome to the world of transaction isolation levels in MySQL - where phantoms, dirty reads, and non-repeatable reads lurk in the shadows. Understand what’s really happening under the hood 🔍 medium.com/gitconnected/mysq… #mysqldatabase #Consistency #Engineering
1
2
53
Never open your production and local databases side by side,Trust me you’ll realize it after you’ve deleted an entire table or row. Oh f***… I just deleted the production DB. 😭 To all my devs friends: triple-check that DB connection before you hit enter. #DevLife #Laravel #Database #Programming #php #mysqldatabase #phpmyadmin
1
1
51
🛠️ Example: Instead of `class User { Database db = new MySQLDatabase(); }`, inject `User(Database db)`. Swap `MySQLDatabase` with `PostgresDatabase` or a mock without changing `User`. 🚀 #designpatterns #testing #microservices
1
22 Aug 2025
🎥 New Episode on RackNerdTV! ✅📅 How to Use Database Wizard in cPanel. 💻🌐 -- 📺▶ WATCH HERE: youtu.be/FAmTRKo5Gjc 🛒CPANEL HOSTING racknerd.com/shared-hosting #cPanelDatabase #DatabaseWizard #WebDevelopment #WebsiteSetup #cPanelTutorial #MySQLDatabase #HostingGuide
1
2
171
5⃣ Dependency Inversion Principle Depende de abstracciones, no de implementaciones concretas. ❌ OrderService usa directamente MySQLDatabase. Cambiar a PostgresDatabase obliga a reescribir el servicio. ✅ Crear interfaz Database y pasarla por inyección de dependencias. El servicio no depende del motor concreto.
1
1
16
4,447
💡 Did you know? Nearly 30% of #WordPress sites still use #MySQL 5.7! With WordPress powering 43.6% of all websites, MySQL's impact is enormous. Dive into the full MySQL #versionHistory & latest 9.0 updates! 🚀 🔗 wpexperts.io/blog/mysql-vers… #MySQLDatabase #WooCommerce #WebDev
1
1
3
43
WEB DEVELOPMENT IN SHORT 1. HTML (Structure) It’s like the skeleton of a website. Without it, nothing stands. It builds the basic structure. #HTMLBasics #WebStructure #FrontendDevelopment 2. CSS (Presentation) Adds style to the HTML. Like clothes, colors, fonts, and layout—all done using CSS. #CSSDesign #WebStyle #FrontendTips 3. JavaScript (Behaviour) Brings life to the website. Makes buttons clickable, popups appear, and more. #JavaScriptFun #WebBehaviour #InteractiveWeb 4. Node.js (Brain) The brain of the website. Handles all logic and processing in the backend. #NodejsPower #BackendBrain #ServerSide 5. MySQL (Memory) Works like memory. Stores all user data like login info, comments, etc. #MySQLDatabase #DataStorage #BackendMemory 6. React/Vue (Personality) Gives the website a smooth personality. Helps create modern and interactive UIs. #ReactVue #ModernFrontend #UserInterface 7. Express.js (Nervous System) A helper of Node.js. Keeps the server and APIs running smoothly. #ExpressJS #BackendFlow #ServerRouting 8. REST API (Communication) The communicator between frontend and backend. Passes data between them. #RESTAPI #DataCommunication #WebIntegration
3
5
152
Can I bribe my mysql database with cookies to make it cooperate with solr? Source: devhubby.com/thread/how-to-i… #programmingtips #codingtutorial #programming #techblog #import #mysqldatabase

5
7
2
122