#### Topic: Passages of states of object

There is an object the Order. At it can be the order of 30 statuses. Is  where the administrator can span the order from any status in any status. That is if all to paint on each combination that it turns out   and a lot of duplication turns out. For certain there are checked templates for the such? What?

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> For certain there are checked templates for the such? What? State machine.

#### Re: Passages of states of object

Hello, snaphold, you wrote: At first like it was clear. But here all was scattered: S> That is if all to paint on each combination that it turns out   and a lot of duplication turns out.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> For certain there are checked templates for the such? What?  the machine certainly.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> For certain there are checked templates for the such? What? If from one status passage in strict a limited number of statuses and a question only in it is possible, it is possible to use the associative arrays (std:: map <enum, enum>), setting steams a key-> value for each of possible changes of the status of the order or a key-> set of statuses (std:: map <enum, std:: set <enum>>)

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> That is if all to paint on each combination that it turns out   and a lot of duplication turns out. If in one place accumulates too much  in this place switch S> For certain arises there are checked templates for the such? What? The jump table between states.

#### Re: Passages of states of object

Hello, Maniacal, you wrote: M> If from one status passage in strict a limited number of statuses and a question only in it is possible, it is possible to use the associative arrays (std:: map <enum, enum>), setting steams a key-> value for each of possible changes of the status of the order or a key-> set of statuses (std:: map <enum, std:: set <enum>>) Nafiga there map? The table almost for certain static, for static tables very well approaches an old kind array.

#### Re: Passages of states of object

Hello, Pzz, you wrote: Pzz> Nafiga there map? The table almost for certain static, for static tables very well approaches an old kind array. Only if statuses it zero-based a dial-up of enumerated type where numbers go successively.

#### Re: Passages of states of object

Hello, Maniacal, you wrote: Pzz>> Nafiga there map? The table almost for certain static, for static tables very well approaches an old kind array. M> only if statuses it zero-based a dial-up of enumerated type where numbers go successively.  - a program domestic concern, and them it is possible to store these statuses in a convenient type. Even if they are stored somewhere in basis, it is possible to do conversion at saving/loading of the data.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> Is  where the administrator can span the order from any status in any status. Without dependence from implementation, it will be a source of a constant headache. Modify business process that such brothel was not. And then at you will be drawn beautiful state machine, and shaft  that them , all as is necessary.

#### Re: Passages of states of object

Hello, snaphold, you wrote: So a square matrix with a zero diagonal. Then if in a matrix pointers on function the call of the output agent will look it beautiful: * (stateChangeTable [STATE_FROM] [STATE_TO]) ()

#### Re: Passages of states of object

If you want ,  a heap of switches, in one place, it that is necessary. And in an ideal do in basis a label with possible passages but if you will be fond, you will write Jira.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> There is an object the Order. We do not know, whether correct it is abstraction. S> at it can be the order of 30 statuses. Most likely, incorrect. S> is  where the administrator can span the order from any status in any status. And, certainly, any audit of similar actions. The project is doomed to success and precisely endures three major versions. S> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. S> for certain there are checked templates for the such? What? I recommend OOP and DDD. (Clever men who write stored procedures for databases, but not on SQL, and directly in the compiled code through a prism any ORM Here get out, and declare that OOP does not work and meets only in textbooks, but I do not recommend them to listen.)

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> Is  where the administrator can span the order from any status in any status. S> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. What to paint? And duplication of that?

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> There is an object the Order. S> at it can be the order of 30 statuses. S> is  where the administrator can span the order from any status in any status. S> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. S> for certain there are checked templates for the such? What? Such variant yet was not: if it is possible to reorganize states in the form of states and  for implementation of states we use a pattern state from gof, and for  - state machine.

#### Re: Passages of states of object

Hello, Sharov, you wrote: S> Hello, snaphold, you wrote: S>> For certain there are checked templates for the such? What? S> State machine. Found implementation but here the moment what it is not clear. Here if we follow an example from the link There is a jump table at me there is a passage from Paused in Exit. Accordingly as it will look? StateMAchine I so understood is good when it is necessary to pass in an adjacent state, and when it is necessary to pass through some states how to be?

#### Re: Passages of states of object

Hello, the Corkcrew, you wrote: Hello, snaphold, you wrote: S>> Is  where the administrator can span the order from any status in any status. S>> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. What to paint? And duplication of that? The object from a state 1 can pass in 20 states Object from a state 2 can pass in 20 states... The Object from a state 20 can pass in 20 states at passage from a state 20 in a state 1 and at passage from a state 19 in a state 1 will be the identical logic, except one method (20 => 19) how to issue? Found implementation but here the moment what it is not clear. Here if we follow an example from the link There is a jump table at me there is a passage from Paused in Exit. Accordingly as it will look? StateMAchine I so understood is good when it is necessary to pass in an adjacent state, and when it is necessary to pass through some states how to be?

#### Re: Passages of states of object

Hello, Qulac, you wrote: Q> Hello, snaphold, you wrote: S>> There is an object the Order. S>> at it can be the order of 30 statuses. S>> is  where the administrator can span the order from any status in any status. S>> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. S>> for certain there are checked templates for the such? What? Q> such variant yet was not: if it is possible to reorganize states in the form of states and  for implementation of states we use a pattern state from gof, and for  - state machine. Found implementation but here the moment what it is not clear. Here if we follow an example from the link There is a jump table at me there is a passage from Paused in Exit. Accordingly as it will look? StateMAchine I so understood is good when it is necessary to pass in an adjacent state, and when it is necessary to pass through some states how to be? Probably Stejt approaches but how to envelop?

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> Hello, Qulac, you wrote: Q>> Hello, snaphold, you wrote: S>>> There is an object the Order. S>>> at it can be the order of 30 statuses. S>>> is  where the administrator can span the order from any status in any status. S>>> that is if all to paint on each combination that it turns out   and a lot of duplication turns out. S>>> for certain there are checked templates for the such? What? Q>> such variant yet was not: if it is possible to reorganize states in the form of states and  for implementation of states we use a pattern state from gof, and for  - state machine. S> Found implementation S> but here the moment what is not clear. S> here if we follow an example from link S> There is a jump table at me there is a passage from Paused in Exit. S> Accordingly as it will look? StateMAchine I so understood is good when it is necessary to pass in an adjacent state, and when it is necessary to pass through some states how to be? S> probably Stejt approaches but how to envelop? Did not understand a question. Imagine a label, where across - input influences, on a vertical - a current state, and in cells - a new state. To issue it it is possible on a miscellaneous, including attracting . the general all it is defined by pair: the current state - input influence, in the resulted example is class StateTransition, for each such pair we define a new state and if needed we pass. I.e. pass we can as us takes in head.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> StateMAchine I so understood is good when it is necessary to pass in an adjacent state, and when it is necessary to pass through some states how to be? Passages are possible from any state in any, i.e. all depends from the set corrected. Any restrictions are not present. Though there are types of states of type finite - if there got, remains only there.  specifies in itself.

#### Re: Passages of states of object

Hello, snaphold, you wrote: S> There is an object the Order. S> at it can be the order of 30 statuses. Something . Whether is the part of statuses search of combinations of independent signs?