Skip to content

Architecture

LeratoKgomo edited this page Jul 7, 2024 · 22 revisions

Architecture

1 Non-functional Requirements

2. Architecture Design Strategy

For our social gaming platform, “GameOnConnect,” We chose the decomposition strategy. This approach involves breaking down the system into smaller, manageable subsystems and components. Here’s why it aligns well with GameOnConnect:

  1. Modularity and Maintainability:

    • By dividing the platform into subsystems like user profiles, friend connections, and game features, we achieve modularity.
    • Each component can be developed, tested, and maintained independently, making our codebase more manageable.
  2. Parallel Development:

    • Different team members can work concurrently on different subsystems.
    • This speeds up development and allows us to deliver features faster.
  3. Reuse and Scalability:

    • Components can be reused across multiple parts within our platform.
    • As “GameOnConnect” grows, we can scale individual subsystems without affecting the entire system.

In summary, the decomposition strategy provides flexibility, scalability, and maintainability which are essential qualities for a dynamic platform like GameOnConnect.

3 Quality requirements

3.1 Performance

Specification:

Performance of the system is critical for providing a smooth experience. Users expect minimal loading times and minimal lag to ensure that they can quickly access their profiles, find friends, and jump into gaming sessions without delay. For a social gaming platform like GameOnConnect, where real-time interactions are essential, optimized performance enhances user engagement and satisfaction.

Quantification:

  • Loading times for main screens should be minimized.
  • Real-time chat messages should have minimal latency.
  • The app should maintain a smooth and responsive user interface.

Strategies:

  • Utilize efficient data retrieval and caching mechanisms with Firebase reducing the time it takes to load screens.
  • Implement asynchronous data loading using Flutter’s FutureBuilder and StreamBuilder. These Flutter tools allow the app to load data in the background without freezing the user interface, improving responsiveness.
  • Optimize the use of Flutter widgets ensuring the app runs efficiently without unnecessary resource consumption, maintaining a high frame rate.
  • Use performance monitoring tools like Firebase Performance Monitoring to identify and address bottlenecks

3.2 Compatibility

Specification: Compatibility ensures that the Android app can reach a wide audience and provide a consistent experience across different devices and screen sizes. Compatibility issues can lead to user frustration and hinder adoption rates.

Quantification:

  • The app should be functional on a wide range of devices.
  • Ensure UI consistency across devices with different screen sizes and resolutions.

Strategies:

  • Test the app on a range of Android devices using Firebase Test Lab.
  • Use responsive design principles and Flutter’s layout capabilities to adapt to different screen sizes.

3.3 Usability

Specification: Usability directly impacts user satisfaction and adoption rates. A user-friendly interface and intuitive design make it easier for users to navigate the platform, connect with friends, and discover new gaming content. This ensures we cater to both experienced and novice gamers.

Quantification:

  • Achieve a high usability score from user feedback and usability tests.
  • Users should be able to find games and friends in a reasonable time frame.

Strategies:

  • Conduct usability testing sessions , use satisfaction surveys and gather feedback to refine the interface.
  • Pay attention to Metrics such as the average time taken to complete common tasks, the number of clicks required to access features, and the frequency of user errors.
  • Use Flutter’s Material Design components for a consistent and intuitive user experience.
  • Provide onboarding tutorials and help sections within the app.
  • Implement filtering and sorting for easier searching.

3.4 Interoperability

Specification: Interoperability enables seamless integration with external APIs and services, expanding the platform’s functionality and content offerings. Integration with APIs like the RAWG Video Games Database API enhances the gaming experience for users by providing access to a diverse range of games. Adherence to API documentation and robust error handling ensures reliable communication with external services, enriching the user experience and driving engagement.

Quantification:

  • Ensure a high success rate for API integrations.
  • Maintain quick response times for API calls.
  • Keep the error rate for API interactions low.

Strategies:

  • Follow best practices for API integration.
  • Implement robust error handling and retry mechanisms for API calls to preventing system crashes.

3.5 Scalability

Specification: Scalability of the system ensures that the platform can accommodate a growing user base and increasing demands without sacrificing performance or user experience. As the popularity of GameOnConnect grows, the system must scale seamlessly to support additional users and gaming sessions. This involves designing a scalable architecture, efficient database management, and optimizing server resources.

Quantification:

  • Ensure the system can handle a growing number of concurrent users.
  • Support a reasonable number of simultaneous gaming sessions.
  • Maintain efficient database query times under typical load conditions.

Strategies:

  • Leverage Firebase’s auto-scaling features for backend services which automatically adjust resources based on user demand, ensuring the system can handle growth.
  • Use Firestore for efficient real-time data synchronization and queries.

4 Architectural Patterns

To meet the quality requirements and ensure a robust, scalable, and maintainable system, we have chosen the following architectural patterns: Model-View-Controller (MVC) and Service-Oriented Architecture (SOA). This document details each pattern, the rationale for its selection, and its alignment with the GameOnConnect requirements.

Model-View-Controller (MVC)

The MVC pattern separates the application into three interconnected components: the Model , the View , and the Controller . This separation of concerns enhances modularity, making the application easier to develop, maintain, and test.

  • Separation of Concerns: Each component can be developed and tested independently.
  • Maintainability: Easier to manage and update the application, particularly the user interface.
  • Scalability: Supports incremental development and integration of new features.

MVC is used in the Flutter app to manage state and UI components, ensuring a responsive and intuitive user experience.

Service-Oriented Architecture (SOA)

SOA involves creating services that can be reused and combined to build the application's functionality. These services communicate over a network using standardized protocols, enabling interoperability with external systems.

  • Interoperability: Facilitates integration with external APIs and services, enhancing the system's capabilities.
  • Flexibility: Services can be independently developed, deployed, and scaled.
  • Reusability: Services can be reused across different parts of the application.
  • Maintainability: Independent services are easier to update and maintain.
  • Scalability: Individual services can be scaled to meet demand without affecting the entire system.

These architectural patterns collectively ensure that GameOnConnect is user-friendly, performant, compatible, scalable, and capable of integrating with external services seamlessly.

5 Architecture diagram

SOA drawio (2)

6 Constraints

Platform Constraint:

  • The system should be accessible via an Android app.
  • The app should be responsive , ensuring compatibility and a uniform experience across different screen sizes and devices.

Performance Constraint:

  • The app should perform well, with short loading times and minimal lag.

Integration Constraint:

  • Integrating with external APIs (such as the RAWG Video Games Database API) introduces constraints related to data formats, endpoints, and rate limits.

7 Design Pattern

Singleton

The Singleton pattern ensures that a class has only one instance and provides a global point of access to it. In GameOnConnect the Singleton pattern is used to ensure that only one instance of the Firebase authentication service exists throughout the application. This guarantees that the authentication state is consistent and accessible from anywhere in the app.

Factory

The Factory pattern provides an interface for creating objects without specifying the exact class of the object that will be created. This is particularly useful for creating different types of events in a flexible and maintainable way.

Mediator

The Mediator pattern defines an object that encapsulates how a set of objects interact. This pattern is useful for managing complex communications between group chats and events, ensuring a centralized control point for these interactions.

Command

The Command pattern is used to encapsulate a request as an object, allowing for parameterization of clients with queues, requests, and operations. It supports undoable operations and helps in implementing a history of executed commands. This is useful for scheduling events, where each session can be treated as a command that can be executed, undone, and logged.