需要创建一个“选择你自己的冒险”类型指南 - 最佳使用方法 [英] Need to create a "choose your own adventure" type guide - best approach to use

查看:139
本文介绍了需要创建一个“选择你自己的冒险”类型指南 - 最佳使用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上需要向用户询问一些问题,并在路上收集信息。每个问题都可能会对不同的问题产生影响。另一个例子是涡轮税的网络界面,在某些方面回答是可能会触发未来的问题。



似乎这样会在软件中是一个相当常见的问题,所以我想问我是否有任何现有的解决方案/设计模式可以帮助。种类好像是状态机,但我认为这是一个过度简化。

解决方案

查看这张图片,有助于选择正确的字体,名为所以你需要一个字体(大图像!)。



据了解,您希望创建类似但互动的关于另一个域的内容。



因此,您需要使用分支节点和叶节点构建类似的图。使用复合模式可以非常方便地完成。如果您已经拥有(知道)所有可能的问题(或者您知道某些时候您会知道所有这些问题,并且可以手动将它们添加到系统中),那么这是可行的。



如果你想要一些更加动态和智能的东西,那么解决方案可能因情况而异。


Basically need to ask user a set of questions and gather information along the way. Each question could have impacts on different questions down the road. Another example would be turbo tax's web interface, answering yes on some ?s may trigger future questions.

Seems like this would be a fairly common problem in software so I guess I'm asking if there are any existing solutions/Design Patterns out there that could help. Kind of seems like a state machine, but I think that is an oversimplification.

解决方案

Look at this picture which helps with choosing correct fonts which is called So You Need a Typeface (big image there!).

It asks you numerous questions and at some point suggest you one or several answers.

As I understand you want to create something similar but interactive and about another domain.

So, you need to construct similar graph with branching-nodes and leaf-nodes. It can be done very conveniently with the Composite pattern. If you already have (know) all possible questions (or if you know that at some point you will know all of them and will be able to add them manually to the system) then it's the way to go.

If you want something more dynamic and intelligent then the solution can highly vary from case to case.

这篇关于需要创建一个“选择你自己的冒险”类型指南 - 最佳使用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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