I am looking for a template to solve the following problems:
Read input
Process data (with verification)
Save result
Examples: Read the csv file, process the data, save as xml Read the MQ message, process the data, save it in the database.
I was thinking about BusinessObject, which:
- It has an
IInput
implementation to handle reading and loading itself. - Can be confirmed using the "rules"
- It has an
IOutput
implementation for saving itself.
eg. (pseudo code!)
public abstract class BusinessObject { public IInput Input { get; set; } public IOutput Output { get; set; } public BusinessObject(IInput input, IOutput output) { } }
and then apply the Load, Process, and Save methods.
However, this does not seem right to me. I think BO should be able to load and save itself?
If anyone knows which template can be such that I can read it or give me an example / explanation, I would be very grateful.
source share