I got the same Big Smokes Cigar assignment, and here are some of my thoughts, they are half-formed, please correct me if I am wrong.
1. It is not mentioned that what kind of interface the Merchant Bank supports, I think the appropriate assumption could be
a)proprietary API (internet) or Webservice,
b) Proprietary security or SSL solution.
c) No global transaction is supported.
d) Synchronous mode
2. Since the interface with the third party manufactures is JMS, also system needs have high performance, therefore making a synchronous call to JMS provider (MOM), and wait until response comes back is not acceptable. What I am thinking now is the stock's Availability Check should be composed by 2 parts
Async part: there is independent
thread which periodically poll third-party inventory system using JMS. We may or may not be able to use MDB. The result needs to be cached and shared somewhere.
Sync part: During the "Search for Cigars" and "Add Cigars to Cart" use cases, the "Stock Availibity" is checked using the result which is cached and shared previously. We may introduce a threshold to define how stale the information is.
3. A technical risk is there is no way to guarantee that the number of units available is accurate. There is no pessimistic like mechanism here, therefore there are always cases where payment is made through, but there is not stock eventually. We may need to consider how to reconcile this situation.
4. Related to point 3, there must be another interaction with third-party inventory logically, that is, after transaction is complete, the system need to update the inventory system to decrease the number of units available. Otherwise the "Check Availability" will never get correct number. I think this extra interaction can be performed asynchronously together with notifying shipping companies.
5. Based on the "Business Domain Model", the relationship b/w products and manufacturers are many-to-many. So generally speaking, a given product and be made by multiple manufacturers. This many-to-many relationship will complicate the "Check Availability". There may need some iteration logic like: if manufacturer A does have enough items, then go to manufacturer b... etc. Then it becomes even worse that one order may involves multiple third-party inventories (say 50 items from A, the other 50 items from B)
6. Login module is not mentioned, we can assume that a 'Login' use case is required. But we don't need to show it in diagrams since it is not the focus.
7. We may or may not store Credit Card information. I was wondering if the testers want to know how we handle storage of credit card in database and memory.
8. In order to resolve the design concern of system performance and availability requirement, the profiling module is required. Also MBean(s) may or may not be required the expose system's healthiness to enterprise monitoring tools like Control-M/Patrol etc.
9. In the "Pay for Cigars" use case, following activities are involved, we need to design how to handle transaction/recovery. Global transaction with email server and Merchant bank is not there.
a) Local database updating
b) Queuing message for stock system update (we may use Topic, instead of Queue)
c) Queuing message for shipping company notification (we may use Topic, instead of Queue)
d) Sending email
e) Payment call to Merchant Bank
Your thoughts are appreciated.
Peace,