ICANDO Bulk Chemical Ordering
1471 DATABASE DESIGN FOR THE VALIDATE CUSTOMER USE CASE So far, we have found only one entity object that is likely to need a database entry, namely the customer object. So far, this is a very simple table, with the schema
customer (customer number. name, address, password)
The key will be the customer number, and the table is already in third normal form every attribute is fully dependent on the key, and there are no transitive dependencies. Thus there will be no need for further decomposition of the table Constructing a customer object from a record in the customer table will be just a straightforward copying of the fields into the object attributes.
14.72 TRANSACTIONS FOR THE VALIDATED CUSTOMER USE CASE
The use case we have developed so far has minimal need for locking. The designer will need to consider several things when deciding on a locking policy. The decisions will not be automatic.
The only database record we have considered so far is the customer record. One of the use cases might involve changing this record, such as changing the address or password. The serialization rule says that such updates should work as if they had happened ‘atomically’, and the norm would be to lock the record. The big question is whether the record for the customer should be locked for the whole Firstly, the question arises whether a customer could be making two orders or calling other inquiries at the same time. If the answer is yes, then holding a lock on the
customer record could wrongly prevent that If the answer is no, then the lock might be useful to detect some issue arising if someone is fraudulently trying to make an order. In the case of validation, the check is instantaneous, and the likelihood and significance of a change of address or password during a call are so minimal that the use of a lock seems unnecessary.
When looking at use cases that update the database, such as Metalwho as the taking of order, locks would need to be considered. For example, if orders require a reservation of stock, then a stock record might need to be locked during the ordering process.