System Architecture



EcoMeter consists of several components. The user interface is implemented using Qt, which provides a set of widgets for building graphical user interfaces (GUIs). These widgets include buttons, labels, text boxes, and other interactive elements that allow users to interact with the application.


The main controller serves as the backbone of the system, processing user requests and facilitating communication between the various components. It is responsible for notifying the models to update data and asking the view to modify their presentation. This ensures that the user interface remains up-to-date with the latest system information.


The Util classes play a critical role in allowing the models to collect targeted system information from the Linux kernel. They provide an abstraction layer that simplifies the process of collecting data, making it easier for the models to access and process relevant information.


This system architecture allows for a smooth and efficient flow of data between the user interface, controller, models, disks, and kernel, resulting in a seamless use experience.


Design Patterns



In this project, we have utilised several design patterns to ensure that our Linux energy monitor is efficient, maintainable, and scalable. Some of the design patterns we used include the Model-View-Controller (MVC) pattern, which separates the application's data, user interface, and control logic into three distinct components.


The adapter design pattern was also used to provide a flexible and extensible solution for converting different types of data to the required format without changing the existing codebase. Additionally, we employed the Singleton pattern to ensure that only one instance of a class is created, which is important for classes that manage system resources.



Finally, the DAO pattern was used to separate the data access layer from the application's business logic, making it easier to change the underlying data storage mechanism without affecting the rest of the application.

By using these design patterns, we were able to develop an energy monitor that is not only functional but also modular and easily extensible.

Design Principles

In development, we adhered to several design principles to ensure that our code is maintainable, scalable, and easy to understand. These include

  • Single Responsibility Principle: We ensure that each module or class is responsible for only one task or functionality.
  • DRY (Don’t Repeat Yourself): We avoid duplication of code by keeping reusable code in functions or modules.
  • KISS (Keep it simple, Stupid!): We aim to keep our code simple and easy to understand by avoiding unnecessary complexity.
  • YAGNI (You ain't gonna need it): We avoid adding unnecessary features or functionalities to the codebase that are not required by the user or the project specifications.

By adhering to these design principles, we ensure that our codebase is well-organised, easy to maintain, and can be extended without causing any side effects or breaking existing functionality. This also helps us to develop high-quality code that is easily testable and scalable.