ussd的设计模式建议 [英] design pattern suggestion for ussd

查看:163
本文介绍了ussd的设计模式建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 php 来创建一个USSD页面。我以前做过,这是相当时间有限的黑客工作;基本上一个巨大的文件,带有手机用户可以处于所有可能状态的开关语句(然后保存在DB中并在下一个USSD请求中检索) - 一种状态机。

I'm using php to create a USSD page. I've done this before and it was quite the time-constrained hack-job; basically one huge file with a switch statement for all the possible states that the cellphone user can be in (which is then saved in a DB and retrieved upon the next USSD request) -- a state machine of sorts.

这一次我有更多的时间,想要使用更多的专业。有没有任何设计模式或最佳实践,我可以用于这种情况?

This time round I have a bit more time and would like to use something more professional. Are there any design patterns or best practices that I can use for this kind of scenario?

推荐答案

好的,所以搜索东西USSD具体是一个错误。简单地将 USSD 替换为状态机给了我一些答案,我是

Ok, so searching for something USSD specific was a mistake. Simply replacing USSD with state machine gave me the answers I was looking for.

这篇关于ussd的设计模式建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆