开发者

how to emulate a good pattern

开发者 https://www.devze.com 2022-12-08 13:53 出处:网络
I feel a bit like Edison in search of the elusive filament. I am still in search of the right fundamental design foundation for my web application.

I feel a bit like Edison in search of the elusive filament. I am still in search of the right fundamental design foundation for my web application.

I believe I have found a pattern to base it on and was hoping the community could suggest some strategies for implementing it.

I would like to mimic the iterative control flow of tax software. All of the major tax software houses have released web versions that allow you to click next and previous as you fill out the tax forms to generate the form for Uncle Sam. Part of this work is iterative, so if you have two jobs, you'll go through the section for your W2 twice, since you have开发者_JAVA技巧 two W2's. There are also a couple of different sections, like where you identify dependents, investments, etc. And these sections allow you to break apart a large task into mini tasks.

This iterative nature is one of obstacles I hit when I tried to model this user flow with the state machine plugins. I just couldn't figure out how to cause the state machine to do a loop.

Thanks for reading!


To do a loop, you pass from one state to the same state:

  event :w2 do
    transition :w2 => same, :unless => :w2ready?
  end
0

精彩评论

暂无评论...
验证码 换一张
取 消