Writing the constructor 

The constructor is called when the app first loads, and it sets the app's initial state and defines the app's name, which is displayed by the Description container.

It sets the following state variables:

  • userID: It sets the customer's userID to 1, which is the userID for both Acme Inc and Apex Corp in the Bank A and Bank B databases, respectively.
  • network: It sets the network variable to Private Testnet.
  • server: This is the default value of the listening port of the backend server of Bank A. This value is changed to 8001 when the Bank B customer (Apex Corp) logs in.
  • account: This initializes the account variable as null.
  • balance: This initializes the customer's balance to 0 before we fetch the actual balance from the backend.
  • name: This initializes the customer name.
  • trans: This initializes the trans object that stores the transactions after fetching it from the backend server.
  • ViewFlag: This initializes the flag with the value 1.
  • TransFlag: This initializes the flag with the value 1.
  • Fields: This initializes the rname (Receiver's Name), rbank (Receiver's Bank), raddress(Receiver's Address), raccount(Receiver's Account), and amount (Transaction Amount) fields.

Next, let's look at how we set the user account.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.221.136