Reputation: 11599
I understand that an object can have only one finite state at a time. A telephone has few different states like ringing, hold, talking etc... An alarm clock has states like ringing, not ringing etc...
I'm looking at an abstract class like Product which can have different statuses like sellable/non-sellable, taxable/non-taxable, tangible/in-tangible. When any of these statuses change for a Product, it will trigger some behaviors in the system.
Should I consider the statuses of a generic class be states? Can a Product keep different states and can still be considered as FSM?
Upvotes: 1
Views: 110
Reputation: 1215
I am sure there is no single right answer here. But I would say it depends. If you want to consider the whole Product a single FSM, then your state would be a sum of all the attributes. Such as sellable, taxable, tangible, ... At one point it might be sellable, taxable and tangible. If the tangible became non-tangible, it would then be sellable, taxable and non-tangible.
On the other hand, if you view your product from the viewpoint of a specific function, you might take a subset of these to represent the product. So, a sales function might just consider the sellable state. A tax function might just consider taxable.
Anyway, like I said, I think depends. On your use case for the FSM and on whatever you want to accomplish. In the end it is just some terminology unless you need the FSM for something special..
Upvotes: 1