Explore tweets tagged as #postgresdatabase
@iamyatendrak
Yaten
2 years
In Noob Way, `UserRepository` depends directly on `MySQLDatabase`. This makes `UserRepository` hard to reuse & test. In Pro Way, `UserRepository` depends on an abstract `Database`. This allows us to easily swap out the database implementation (i.e., use a `PostgresDatabase`).
1
0
0
@SiddharthaBytes
Siddhartha Satyakama
3 years
The PostgresDatabase class implements the Database abstract class, which defines a connect() method. The UserAPI class can now depend on this abstraction, rather than on the specific implementation details of PostgreSQL.
1
0
0
@juliancamposes
Julián Campos
4 months
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
1
1
16
@ButterChickenSt
Butter Chicken Studios
4 months
🛠️ 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
0
0
0
@applyfirst_app
🇺🇸 US Remote Tech Jobs
1 month
💼 Senior Engineer at Strategic Education, Inc 📍 United States 💰 $120,000.00 - $150,000.00 🛠️ #react #node #typescript #graphql #postgresdatabase #aws #heroku #mikroorm #jira #cypress #git #agile 🔗
0
0
0