a little preamble....
I'm very new to using patterns or should i say trying to use patterns. My problem is i keep seeing the most recent pattern i read about in what ever current project i'm working on. So some opinions would be would be appreciated.
current project...
something similar to EDI(no where near as sophisticated) . A vendor sends in a invoice file and each line may or may not get booked to the accounting software and may or may not send notifications of receipt based on the value of the inventory code contained in the line.
my diagnosis...
So what varies are the actions to be taken based on the value of the inventory code. In other words it's internal "state" is being changed by the value of the inventory code so it would be a state pattern. Which happens to be the most recent pattern i read about? Coincidence????
rules......
Inventory Code=01 then SendNotifications()
Inventory Code=02 then Book(); SendNotifications()
Inventory Code=03 then Book()
Inventory Code=04 then donothing
current design....
InvoiceFile Is Collecion of Line Objects. Within the Line object is a method
called ProcessLine() which will do the booking, send notifications, or ignoreline
I really would appreciate some feedback on why this would or wouldn't be a state.
I'm very new to using patterns or should i say trying to use patterns. My problem is i keep seeing the most recent pattern i read about in what ever current project i'm working on. So some opinions would be would be appreciated.
current project...
something similar to EDI(no where near as sophisticated) . A vendor sends in a invoice file and each line may or may not get booked to the accounting software and may or may not send notifications of receipt based on the value of the inventory code contained in the line.
my diagnosis...
So what varies are the actions to be taken based on the value of the inventory code. In other words it's internal "state" is being changed by the value of the inventory code so it would be a state pattern. Which happens to be the most recent pattern i read about? Coincidence????
rules......
Inventory Code=01 then SendNotifications()
Inventory Code=02 then Book(); SendNotifications()
Inventory Code=03 then Book()
Inventory Code=04 then donothing
current design....
InvoiceFile Is Collecion of Line Objects. Within the Line object is a method
called ProcessLine() which will do the booking, send notifications, or ignoreline
I really would appreciate some feedback on why this would or wouldn't be a state.