哪些因素促使您在应用程序中使用嵌入式脚本?

发布于 2024-07-24 08:29:26 字数 226 浏览 1 评论 0原文

当您选择嵌入式脚本时,您在决策过程中会权衡哪些因素?配置和变化问题是否可以纯粹通过 IOC 和插件模式来克服?

很多时候,策略模式和装饰器模式是抑制领域逻辑变化的好方法。 我面临的问题是,根据不同的营销活动,工作流程的计算和起点在一年中会有所不同,并且直到活动开始之前才知道所有数据要求和业务规则。 作为一家小商店,我们希望有一个解决方案,我们可以进行配置更改、严格测试,但不会被迫不断地编译/链接和重新部署。

What factors do you weigh in your decision process when you select an embedded scripting, and can issues of configuration and variation be overcome purely with IOC and the Plugin pattern?

Many times the Strategy Pattern and Decorator Pattern are good way to tame variation in domain logic. The problem set I am faced with is that calculations and starting points of workflows will vary from through out the year based on different marketing campaigns, and not all data requirements and business rules are know until just before the campaign begins. Being a small shop we would like to have a solution where we can make configuration changes, test rigorously and yet not be forced to compile/link and re-deploy on a constant basis.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不…忘初心 2024-07-31 08:29:26

我多次通过 Python 或 Lua 使内部数据结构可变。 有时将业务逻辑外部化为可加载模块。 这使得您的解决方案也成为一个可重用框架,您可以廉价部署到其他客户端。 它还使“现场”修复更快(只需更新文本文件),并让客户可以自由修改自己的动态数据。

如果您可以安全地公开 API而不破坏任何东西......为什么不呢?

我担心的两个问题是:

  1. 我可以外部化特定于客户的逻辑吗? 或者稍后可能定制
  2. 我可以在满足性能知识产权限制的同时做到这一点吗?

干净的框架==可重用的代码和平台,您可以快速修改以解决同类问题而无需重新编码。

Many times I have made internal data structures mutable through Python or Lua. Somtimes externalizing business logic into loadable modules. This makes your solution a reusable framework too that you can deploy to other clients cheaply. It also make 'in the field' fixes quicker (just update a text file) and gives clients freedom to modify their own dynamic data.

If you can safely expose the API without breaking things ... why not?

My two concerns are:

  1. Can I externalize logic that is specific to a client? or that might be tailored later?
  2. Can I do this whilst meeting performance and intellectual property constraints?

A clean framework == Reusable code and a platform you can quickly modify to solve problems of the same ilk without recoding.

笙痞 2024-07-31 08:29:26

我在两种情况下使用了这种技术:

  1. 我想为客户/客户提供一些设施,以便能够自己提供一些(有限的)定制。 例如,如果值超过 50,则将图表着色为红色,因此允许他们键入一个简短的脚本,例如“if val > limit then 'red'”等。但是,您必须小心限制用户可以编程的内容(对于显而易见的原因)
  2. 当我需要在现场对软件进行一些定制(即重新编译不是一个选项)并且我知道我需要的不仅仅是能够打开/关闭组件之外。 因此,我将实现一些机制,让应用程序通过可编写脚本的组件进行自身配置

(我主要基于 Java,因此我使用 Java 6 嵌入式脚本加上各种语言来实现上述目标,具体取决于重点)

I've used this technique in 2 scenarios:

  1. I want to provide some facility for customers/clients to be able to provide some (limited) customisation themselves. e.g. to colour a chart red if a value exceeds 50, so allowing them to type a short script like "if val > limit then 'red'" etc. You have to be careful to limit what the user can program, however (for obvious reasons)
  2. When I need some customisation of the software in the field (i.e. recompilation isn't an option) and I know I'll need a little more than being able to turn components on/off. So I'll implement some mechanism where the application configures itself via scriptable components

(I'm mainly Java-based, so I'm using the Java 6 embedded scripting plus a variety of languages to achieve the above, depending on the focus)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文