Package com.example.breeze_seas
Class DBConnector
java.lang.Object
com.example.breeze_seas.DBConnector
DBConnector provides centralized access to the Firebase Firestore database instance.
Role in architecture: - Implements the Singleton design pattern to ensure that only one instance exists and is shared across the application. - Prevents other classes from directly instantiating or accessing Firestore, enforcing separation of concerns and improving maintainability. - Acts as the single entry point for all Firestore database operations.
Outstanding/future work: - Add error handling for database initialization failures. - Extend support for dependency injection if needed for testing or scalability. - Monitor thread-safety if accessed concurrently from multiple components.
-
Method Summary
-
Method Details
-
getDb
public static com.google.firebase.firestore.FirebaseFirestore getDb()
-