Systemdesign

20 May 2017

Welcome to our Third Blog, you will see information about the Interaction and Class diagrams, Design patterns and statergies used in Development process

Sequence diagram

Sequence diagram for PIN verification use case

sequencedg1 image

Above sequence diagram shows login process,Process begins when user enters the 4 digit PIN, the entered PIN will be verified. If PIN doesn't exist (during first login) it will be stored. If it is not first login then it will be verified against existing value and user is either authenticated/rejected from acessing application.

Sequence diagram for View Report use case

usecasediagram image

Above sequence diagram shows View Report process,Process begins when user requests to view his statistics of expense and income. User can either view report by filtering by date or by category. Depending on user request of filters, relevant information is fetched and plotted based on chosen representation type.

Class Diagram

classdg image

Detail description of classes and their associations

Below is the detailed explaination of Class diagram with its attributes and associated data types, operation and relationship between classes.

  1. UserDetails

    • Attributes:

      • PIN - Integer(Accepts PIN of length 4)

    • Methods :

      • verifyPIN(int PIN) - verifies if entered pin is of lenght 4 and user authentication

      • setPIN(int PIN) - sets passed pin when user has logged in for the first time

      • getPIN() - gets PIN on request

    • Every user after login will be allowed to select one curreny type. Hence user is associated with minimum of one currency type and maxximum of any number of currency types available

  2. CurrencyType

    • Attributes:

      • currencyType - String

    • Methods:

      • getCurrenyType() - returns currency type value set for the application

      • setCurrencyType(String currencyType) - sets currency type value

      • Contains getters and setters to get and set value of currency type across the application as it is made private :

    • Currency is associated with every item and each user is allowed to set currency type very first time he logs into the application

  3. Item

    • Attributes:

      • amount - integer

      • Note - String

      • Category - enum

      • subCategory - Arraylist

    • Methods:

      • addSubCategory(Item item) - adds custom defined subCategory of type item to Arraylist of subCategories which is predefined

    • Every Item is associated with one currencyType and one item per transaction

  4. Transaction

    • Attributes:

      • totalBalance - integer

      • totalIncome - integer

      • totalExpense - integer

    • Methods:

      • addTransaction(Item item, String note, Category category, String subCategory) - Adds transaction for selected category and subCategory with note and amount details

      • Calculate() - calculates total balance, expense and income for every transaction and keeps application with updated values

    • Every transaction consits of atleast one Item. Transaction inherits class Item, hence has acess to all attributes and methods defined in class Items and one or many transaction will involve in generating the report.Basically handles all actions involved in adding and maintaining of transactions under Income or Expense category

  5. TransactionManagement

    • Attributes:

      • transactionManagementInstance - TransactionManagement

    • Methods:

      • TransactionManagement() - Private constructor with do nothing

      • getInstance() - Checks if the instance of transaction management class exists, if exists then returns same instance else it will create an instance and returns it

    • One or many transaction class can have only one instance of TransactionManagement

  6. Report

    • Attributes:

      • startDate - Date

      • endDate - Date

      • Category - enum

    • Methods :

      • generateReport(startDate Date, endDate Date) - Generates report based on the given range of date values

      • generateReport(Category category) - Generates report based on the selected category value

      • Plot() - Plots the graph for given values

    • Each report consits atleast one transaction and can take any number of transactions based on the defined date range or category. It will fetch required data and plots in Bar graph/ Pie or Line chart

  7. Enumerations

    • Category enum contains value income and expense

    • Currency enum contains various currency values

    • Currency and Category values are constants and cannot be added or modified during program execution, hence are stored as enums

Design Pattern

Design pattern is one of the best practices applied in object oriented programming. It provides standard terminology and are specific to certain scenarios.

Our Money Tracker application will be built on creational pattern i.e, Singleton Pattern and can also include Model-View-Controller pattern

Below scenario shows how Signleton pattern and MVC pattern can be applied for Money Tracker app

Singleton Pattern

Fig(a) Singleton pattern

MVC Pattern

Fig(b) MVC pattern

Reasons why we are incorporating this design pattern in our application are:

  • Since Money tracker application is specific to one single user, having Singleton pattern to instantiate object for management of complete transaction is much suitable

  • Since the class controls the instantiation process, the class has the flexibility to change the instantiation process

  • MVC pattern seperates application concerns, keeping input, processing and output in different layers

  • Allows for easier code maintenance and faster development process

  • Provides multiple view as it is necessary in viewing the Report

  • Modifications in one of the layer doesn't require changes in the other layer

Development Stratergies

  • All user stories are broken down into several Epics and logged in Backlog

  • Weekly SPRINT will be followed

  • SPRINT planning is done every Monday and tasks are discussed and assigned to weekly sprint

  • Assigned tasks are analysed and impediments are discussed in stand up meetings

  • SPRRINT review is done every friday. Completed or pending tasks will be discussed

  • Iteravtive Model appproach is followed

  • Agile Methodology in practice

  • Tools used for development:

    • Andriod Studio

    • Emulator

Key changes in project requirement

  • Change in currency type for existing transaction was discarded as it requires currency conversion calculation on fly. Now user will be allowed to select currency only during launch of application for the 1st time

  • Authenticating user by username and password was replaced by 4-digit PIN

  • As per the initial design, an option to select whether the transaction is on income or expense was on the transaction page. As part of the change, onclick of the 'Add transaction' in the home screen the user will now be able to select an option i.e income/expense in a new screen just before he lands on the transaction page.

Thanks for visiting our Blog !