• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

[ Suggestion for design ] Transaction and TransactionStatus

 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,
I need to model a workflow for the approval and rejection of purchase orders.
The core entities are Party (representing the actors) and Transaction.
e.g. CompanyA sends PO to CompanyB. (CompanyA and CompanyB are subclasses of Party).
I will store the initial PO request in a Transaction class.
Some of its properties are:

The recipient of the PO has the option of either rejecting or accepting the PO. I'm having a dilemma on how to model the status/action on the Transaction. Actually "Action" might be a better word than "Status" because I'm thinking along the lines of the Command pattern. Note that I would like an audit trail on changes to the transaction. (Tracking Log / History)
Should Transaction contain a collection of Action objects ? If so, I would need to keep a marker in the Action collection, to point out which is the current state (or maybe I could sort it by date and select the most current - which I think would be kinda slow)
Action objects would contain a status field signifying "New", "Rejected", "Confirmed", "KIV".
What are your thoughts ?
Regards,
Pho
[ March 15, 2004: Message edited by: Pho Tek ]
 
Pho Tek
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've managed to settle on this design:

Noticed that I've separated the Tracking Log from the actual TxStatus entity. So current status for the Tx is whatever's in TxStatus.
Regards,
Pho
[ March 17, 2004: Message edited by: Pho Tek ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic