在设计软件平台时,构成成功的可插拔架构的关键要素是什么?

发布于 2024-07-21 02:54:24 字数 1436 浏览 12 评论 0原文

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

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

发布评论

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

评论(4

画离情绘悲伤 2024-07-28 02:54:24

就我个人而言,我是否学习(并且确实)为任何给定系统编写应用程序有 3 个主要贡献因素:

该系统是否非常有用,以至于我想要充分使用它并有足够的动力来扩展它?

该系统是否使用我熟悉的语言,或者是否易于学习,而不是一些晦涩的或专有的或其他过于复杂的解决方案(参见 elisp)?

插件系统是否以清晰的语言记录得非常好,以便我可以继续编写插件的工作,而不是花费数小时(或数天)来破译系统?

如果这些都是真的,那么您不想为平台进行开发的唯一原因是其他人已经为您的所有想法编写了插件。 :)

我认为拥有一个众所周知的中央存储库来容纳用户贡献的插件(根据您的示例项目)也非常有帮助/重要。 我讨厌必须在网络上搜索个别的、可能是低质量的、甚至可能是恶意的附加组件来完成我想做的事情。 这应该是一个网站或维基百科,因为即使是论坛或邮件列表档案也可能会令人厌烦且耗时。

Personally there's 3 major contributers to whether I learn to (and do) write apps for any given system:

Is the system very useful so that I'd want to use it enough to be motivated enough to extend it?

Is the system using a language that I'm familiar with, or is easy to learn as opposed to some obscure or proprietary or otherwise overly complicated solution (see elisp)?

Is the plugin system extremely well documented in clear language so that I can go about the work of writing my plugin and not spending hours (or days) deciphering the system?

If these things are all true, the only reason you would not want to develop for a platform is that somebody else has already written plugins for all your ideas. :)

I think it's also extremely helpful/important to have a central and well known repository to house user contributed plugins (as per your example projects). I hate having to scour the web to find individual, possibly low quality or even possibly malicious add-ons for something I'm trying to do. This should be a website or wiki as even forums or mailing list archives can be annoying and time-consuming to dig through.

傲世九天 2024-07-28 02:54:24

你没有抓住要点。

JVM 是一个可插拔的架构。 每个类文件都插入其中并扩展它。

Apache 是一个多层次的可插拔架构。 有“模组”。 一些 mod 运行其他解释器,它们本身就是可插入架构。 PHP、mod_wsgi/Python 等都插入了 Apache。

Python 是一种可插入架构,具有可插入其中的 Python .pyc 文件和对象文件(.DLL、.SO)。

实际上,每种语言框架都是可插入架构。

You're missing the point.

The JVM is a pluggable architecture. Every class file plugs into it and extends it.

Apache is a pluggable architecture at several levels. There are the "mods". Some mods run other interpreters, which are themselves pluggable architectures. PHP, mod_wsgi/Python, etc. are all plugged into Apache.

Python is a pluggable architecture with Python .pyc files and object files (.DLL's, .SO's) that plug into it.

Every language framework is -- in effect -- a pluggable architecture.

过潦 2024-07-28 02:54:24

平台是一个基础

软件平台的一种观点是作为其他软件执行另一项任务所依赖的基础。 这可能是一个简单且相当明显的陈述,但它是一个重要的陈述。

基础知识应该很简单

平台必须有一个目的,平台开发人员在设计 API 时应该意识到这一点,以便清楚地了解主要用例是什么,并且围绕它们的 API 应该是直接的尽可能根据它们的设计方式和周围的文档来使用。

扩展点应该是显而易见的

平台的可扩展性是指为开发人员提供扩展或更改平台的机会。 如果这是您想要鼓励的事情,那么您需要非常清楚这种可扩展性的性质和限制,并提供一组定义良好的接口来实现这一点。

这听起来可能是显而易见的,但如果您希望社区围绕某个平台进行开发,那么该平台必须具有用途,并且扩展它应该是一种简单的体验。

抱歉,如果这听起来有点“建筑宇航员”,我确实认为我提出了一些有效的观点,我很可能把它们说得不好,请随意指出这一点或添加到它们

The Platform is a Foundation

One view of a software platform is as a foundation upon which other software relies in order to perform another task. This may seam a simple and rather obvious statement, but it's an important one.

The Basics Should Be Easy

A platform must have a purpose and platform developers should be aware of this when designing APIs so that it becomes obvious what the primarry use cases are and the APIs around them should be made as straightford as possible to use with respect to the way they are designed but also with respect to the doccumentation around them.

Extension Points Should Be Obvious

Extensibility in a platoform is about providing developers the oppotunity to extend or change the platform. If this is something you want to encourage then you need to make very clear the nature and limitations of this extensibility and provide a well-defined set of interfaces to allow for this.

This might all sound obvious, but if you want a community to develop around a platform, that platform must have a use and extending it should be a straightforward experience.

Sorry if this seams a little "achitectural astronaught", I do think I made some valid points, I may well have made them poorly, feel free to point this out or add to them

岁月流歌 2024-07-28 02:54:24

不要忘记 Eclipse (使用 >1000 个注册的第 3 方“插件”(事实上,它们是由 Eclipse 术语中更小的插件组成的)。 它的成功部分可能来自于如何设计一个可由其他人扩展的插件有良好的经验规则。 还有严格的 API 版本控制策略(当然也有其缺点)。

Don't forget Eclipse (with >1000 registered 3rd party "plugins" (in fact they are made of even smaller plugins in Eclipse terminology)). Part of its success may come from that there are good rules of thumb on how to design a plugin that is also extendable by others. There's also a strict API versioning policy (which of course has its drawbacks, too).

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