I may have all this OO completely wrong, but here goes:
Ok, the scenario is a classic order entry.
Customer places an Order which has OrderLineItems of StockItems. Order is entered by Employee.
- Application starts and asks for login/password
- Employee selects 'Orders' from Mainmenu form
- Orders forms opens....
- Employee selects Customer
- Employee selects Stock adds to OrderLineItems
- Selects second StockItem; add to OrderLineItems
- Order is committed, (stock decremented, order posted to DB, Order printed)
- Employee is returned to MainMenu
Now with Object scope:
- Application starts and asks for login/password
- Is this the best place to make objEmployee, to be kept whilst in this whole Sales application?
- Employee selects 'Orders' from Mainmenu form
- Orders forms opens....
- Make objOrderHeader, is objEmployee able to be passed in or is it created here, or re-created here.
- Employee selects Customer - adds/edits Customer details if required...
- Make objCustomer
- Employee selects Stock adds to OrderLineItems...
- Make objStockItem and objOrderLineItem -> add to objOrderLineItems_collection
- Selects second StockItem; add to OrderLineItems...
- Make objStockItem and objOrderLineItem -> add to objOrderLineItems_collection
- Order is committed, (stock decremented, order posted to DB, Order printed, Order Entered By = EmployeeID)
- Once posted to Db, all objects now redundant/garbage (except objEmployee?)
- Employee is returned to MainMenu
- Is objEmployee still valid as an object?