Question: Object Oriented Design Question - Bank accounts A given bank has thousands of bank accounts. Each bank account has attributes such as balance, account_id, and

Object Oriented Design Question - Bank accounts

A given bank has thousands of bank accounts. Each bank account has attributes such as balance, account_id, and is_sensitive. Go through all the bank accounts and if they are is_sensitive (True), tokenize them using a Tokenize service that has TokenServiceRequest and TokenServiceResponse class objects. If we're dealing with sensitive bank accounts (sensitive = True), then append 'tkn_' + account.id (e.g "tkn_1234") to account.

What would the object oriented design look like? IN JAVA.

------------

Example answer (INCORRECT ANSWER in python): This is not the correct answer but it was in the right direction in python. Please write the correct answer in JAVA instead.

class Account: ... def accountService(accounts): pass # you implemented

class TokenService: ... def tokenizeService(tokenServiceRequests): pass # you implemented

Account(id, balance, sensitive): self.id = id self.balance = balance self.sensitive = sensitive

TokenServiceRequest(trackingId, data): self.id = id self.data = data

TokenServiceResponse(trackingId, token): self.trackingId self.token = token

accounts = [Accounts("1234","12",True),Accounts("2233","22", False)] response = Account.accountService(accounts) print("True: ", tkn_" + accounts[0].account_id == response[0].account_id)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!