Class DBConnector

java.lang.Object
com.example.breeze_seas.DBConnector

public class DBConnector extends Object
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 Details

    • getDb

      public static com.google.firebase.firestore.FirebaseFirestore getDb()