Chapter 3 Project
Chapter 3 Project
Methodology
3.1 Design Approach
The design approach adopted for the development of the Offline
Spending Tracker Application for Mobile is rooted in the principles of
Object-Oriented Design (OOD). Object-Oriented Design provides a
paradigm for organizing and structuring software code based on the
concept of "objects," which encapsulate data and behavior, promoting
modularity, reusability, and maintainability.
React Native: The heart of the technology stack is React Native, chosen
as the primary framework for developing the mobile app. Recognized for
its capacity to enable cross-platform development without compromising
performance, React Native is the linchpin that ensures our application
operates seamlessly on both iOS and Android devices. This choice not
only expedites development but also guarantees a consistent and high-
quality user experience across diverse platforms.
3.5.1 ER Diagrams:
Entity-Relationship (ER) diagrams serve as a visual representation of the
relationships between different entities in the database. For the Offline
Spending Tracker, the ER diagram depicts the connections among the
three primary entities: 'Expense,' 'Budget,' and 'User.' Relationships are
established to reflect associations such as each 'Expense' being linked to a
specific 'User' and 'Budget.' Attributes of each entity, such as expense
amount, date, and category, are outlined in the ER diagram. This visual
representation aids in understanding the relational structure, ensuring data
integrity and facilitating effective communication between developers
and stakeholders.
3.5.2 Normalization:
Normalization is a crucial database design concept that ensures the
efficient organization of data within tables, minimizing redundancy and
dependency. In the context of the Offline Spending Tracker Application,
normalization is applied to the database schema to enhance data integrity,
simplify maintenance, and support the dynamic nature of expense
tracking and budget management.
The database for the Spending Tracker consists of three main entities:
'Expense,' 'Budget,' and 'User.' Each of these entities has specific
attributes capturing relevant information. Normalization is applied to
these entities to eliminate redundancy and improve overall database
performance.
Expense Entity:
The 'Expense' entity, responsible for storing information about each
spending transaction, is normalized to avoid duplicate entries and
improve data consistency. Attributes such as 'amount,' 'date,' 'description,'
and 'category' are organized efficiently within the 'Expense' table.
Budget Entity:
The 'Budget' entity, which represents the user's budgeting plan, is
designed with normalization principles in mind. It includes attributes
such as 'budgeted categories,' 'allocated amounts,' and 'spending limits.'
Normalization ensures that budget-related data is logically organized,
reducing the likelihood of data anomalies.
User Entity:
The 'User' entity captures information about application users, including
profiles, preferences, and settings. Normalization in this context ensures
that user-specific data is stored in a structured manner, enhancing the
maintainability and scalability of the database.
Relationships:
Relationships between these entities are established based on foreign key
associations. For example, each 'Expense' is linked to a specific 'User' and
'Budget.' This ensures that the data is interconnected, supporting the
application's functionality, such as associating expenses with the
respective user and budget.
Advantages of Normalization in the Spending Tracker Application:
Reduced Redundancy:
Adaptability to Changes:
The Agile development model emphasizes adaptability, and
normalization supports this by providing a flexible structure that can
accommodate changes and updates to the application's features without
major disruptions to the database schema.
Simplified Maintenance:
Normalized databases are generally easier to maintain. When
modifications or additions are necessary, developers can make changes to
specific tables without affecting the entire database, supporting an agile
and iterative development approach.
In summary, normalization is a foundational aspect of the database design
for the Offline Spending Tracker Application. It ensures that the data is
organized efficiently, relationships are well-defined, and the database
structure is adaptable to changes, aligning with the Agile model's
principles of flexibility and responsiveness. This approach to
normalization contributes to the overall effectiveness and reliability of the
Spending Tracker's database, supporting its core functionality of tracking
expenses and managing budgets.
Inserting Data:
The process of inserting data involves adding new entries to the database.
In the Spending Tracker, this corresponds to capturing new expenses,
creating budget plans, and registering user profiles. Realm instance
statements are employed to add records to the respective tables, ensuring
that new data is appropriately incorporated.
Retrieving Data:
Retrieving data is essential for displaying information within the
application. For instance, when a user wants to view their expense history
or budget details, Realm select statements are utilized to fetch the
relevant data based on specified criteria.
Updating Data:
The ability to modify existing records is crucial for users to accurately
reflect changes in their spending or adjust budget allocations. Update
statements are employed to modify specific attributes within a record.
Deleting Data:
Deleting data allows users to remove outdated or unnecessary
information from the database. This is achieved using delete statements,
ensuring that the data remains accurate and relevant.
Transaction Management:
To maintain data integrity, the Spending Tracker implements transaction
management. This ensures that a series of operations either complete
successfully or leave the database in a consistent state. For instance, when
transferring an amount from one budget category to another, a transaction
is utilized to ensure both debit and credit operations occur atomically.
Error Handling:
Robust error handling mechanisms are implemented to manage
exceptional scenarios, ensuring that the application gracefully handles
errors and provides meaningful feedback to users.
Asynchronous Operations:
Asynchronous database operations are employed to prevent the
application from becoming unresponsive during time-consuming tasks,
enhancing the user experience.
Connection String:
A connection string serves as a key component in defining the parameters
needed to establish a connection to the Realm Database. It includes
essential information such as the database location, authentication
credentials, and other configuration details. The connection string is
carefully crafted to ensure a secure and accurate link between the
application and the database.
In the context of the Offline Spending Tracker, the connection string is
configured to connect to the Realm Database securely, safeguarding
sensitive user information and ensuring that data communication occurs
seamlessly.
Connection Controls:
2. Credential Management:
User credentials, including usernames and passwords, are securely
managed within the application. The connection controls ensure that only
authenticated users with valid credentials can access and manipulate data
in the Realm Database.
3. Connection Pooling:
Connection pooling is implemented to efficiently manage and reuse
database connections, reducing the overhead of establishing a new
connection for each user interaction. This enhances the application's
performance and responsiveness, especially in scenarios where multiple
users are concurrently accessing the database.