设计一个可插拔的点和徽章系统 [英] Designing a pluggable points and badges system

查看:27
本文介绍了设计一个可插拔的点和徽章系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设计一个可插拔的积分和徽章系统,易于打开和关闭,并且易于变成自己的模块?

How do I design a pluggable points and badges system which is easy to turn on and off, as well as easy to turn into a module of its own?

经过多次尝试和错误后,我得出的结论是,积分和徽章与应用程序的唯一业务逻辑过于交织,无法以简单的方式将它们具体化(许多规则涉及对应用程序核心结构的理解,这使得事情已经相当耦合)

After many trials and errors I reached the conclusion that points and badges are simply too intertwined into the sole business logic of the application that they cannot be externalized in a simple way (many rules involve understanding of the core structure of the application, which makes things already quite coupled)

我目前以简单的方式做所有事情 - 我在服务类的方法中将所有业务逻辑(验证、持久性、游戏化、通知)具体化.然而,这些方法已经变得相当混乱,而且我担心相当耦合.没有简单的方法可以简单地关闭任何底层系统

I currently do everything the simple way - I externalized all the business logic (validation, persistence, gamification, notifications) in the methods of a service class. Those methods however already became quite cluttered, and I fear quite coupled. There is no simple way to simply shut off any of the underlying systems

推荐答案

作为一个想法,如何将您关心的业务逻辑事件与您如何将它们作为点、徽章、级别对用户进行解释?这样您就可以在一个地方实施一些疯狂的东西,例如在一个足球赛季连续三个星期一购买咖啡的 Ball Buzz 徽章.

As an idea, how about decoupling which business logic events you care about from how you account for them as points, badges, levels to a user? So that you can implement in one place nutty stuff like a Ball Buzz badge for buying coffee on three consecutive Mondays during a football season.

从概念上讲,考虑将所有可能有趣的交易和交互的消息传递给这个 Awards 模块,该模块封装(并向会计师隐藏)这个有趣的功能.

Conceptually, think of passing a message for all potentially interesting transactions and interactions to this Awards module, which encapsulates (and hides from accountants) this fun functionality.

在进一步审查 SO 后,已有大量讨论 主题已经.特别值得注意的是存储徽章标准的最佳方式",包括事件通知和"徽章"系统的数据库架构与整体架构 讨论.

Upon further review of SO, there has been substantial discussion of the subject matter already. Particularly notable are "Best way to store Badge criteria" covering events notification and "Database Architecture for "Badge" System" with overall architecture discussion.

已经讨论了关系 vs. nosql/Mongodb 数据库用于此类功能,以及将业务逻辑划分为存储过程.

There has been discussion of relative merits of relational vs. nosql / Mongodb databases for such a feature, as well as partitioning business logic into stored procedures.

在我看来,重新发明轮子的工作正在进行中.有人知道在这个领域出现的 OSS 框架或 Github 项目吗?另外,有没有关于徽章主题和一般游戏化的有价值的论文或文章?

It appears to me that there is a lot of reinventing the wheel going on. Anybody aware of OSS frameworks or Github projects emerging in this area? Also, any worthwhile papers or articles on the subject of badges specifically and gamification generally?

这篇关于设计一个可插拔的点和徽章系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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