将第三方模块集成到您的应用程序中的最佳实践

发布于 2024-07-04 01:59:34 字数 355 浏览 6 评论 0原文

我们有一些项目涉及构建一个应用程序,该应用程序由大约 50% 的自定义功能组成,但随后引入了 wiki、论坛和其他我们尚未发明的“轮子”组件。希望从头开始重写。

这些第三方应用程序通常有自己的数据库、主题和身份验证系统。 根据我的经验,让单点登录、通用主题或跨多个子应用程序中的实体进行标记/搜索等工作是非常具有挑战性的问题。 此类集成项目的最佳实践有哪些?

到目前为止,我们的方法是尝试仔细挑选组件,选择具有明确定义的 API 的组件,最好通过 HTTP(例如 REST 或 SOAP),尽管这并不总是可行(我们还没有找到合适的组件)论坛就是这样运作的)。 人们可以向任何尝试这样做的人提供建议吗?我怀疑我们中的许多人现在越来越频繁地这样做?

We have a few projects that involve building an application that is composed of maybe 50% custom functionality, but then pulls in, say, a wiki, a forum, and other components that are "wheels" that have already been invented that we do not wish to re-write from scratch.

These third-party applications usually have their own databases, themes, and authentication systems. Getting things to work like a single-sign-on, or a common theme, or tagging/searching across entities in multiple sub-apps are pretty challenging problems, in my experience. What are some of the best practices for this kind of integration project?

Our approach, so far, has been to try and pick your components carefully, choosing ones that have a clearly defined API, preferably via HTTP (like REST or SOAP), though that isn't always possible (we haven't found a decent forum that works that way). Are there suggestions folks can give to anyone trying to do this, as I suspect many of us are more and more frequently these days?

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

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

发布评论

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

评论(4

自控 2024-07-11 01:59:34

Donald Knuth 表示,比可重用代码更好的是可修改代码,因此,如果没有 API,您应该寻找编写良好且可以自定义的开源应用程序。

至于数据库和登录系统以及其他编程部分(我不知道主题如何受益),您也可以尝试,根据情况包装内容,以便该模块认为它是独立的,但实际上与您的代码进行对话。

Donald Knuth said that even better then reusable code is modifiable code, so if there is no API, you should seek for an open source app that is written well and therefore possible to customize.

As for databases and login systems and other programming parts (i don't see how e.g. theming could benefit), you can also try, depending on circumstances wrapping stuff so that module believes it's on it's own, but actually talks to your code.

策马西风 2024-07-11 01:59:34

我的方法是使用第三方代码来实现某些核心功能。 例如,我使用 Subsonic 进行数据访问,使用 Devexpress 组件进行 UI 操作,使用 Peter Blum Data Entry Suite 进行数据输入和验证。 Subsonic 是开源的,Devexpress Peter Blum 的控件提供额外收费的源代码。 如果我尝试自己编写这些控件,我将不可能获得这些控件的功能。

这种方法使我能够专注于应用程序的自定义功能,而不必担心如何访问数据库或如何创建看起来漂亮的可编辑树列表。 当然,我没有完全配置和工作的论坛,但我知道我将为我的应用程序使用 SQL 数据库,并且我不必尝试让不同的数据存储组件一起工作。 我没有 wiki,但我知道如何使用 devexpress ui 组件,并且使用 Peter Blum 的控件格式化和验证数据输入变得轻而易举。 换句话说,学习能够加速所有项目开发的工具(当然要仔细选择它们),然后您就可以专注于应用程序中需要自定义的部分。

只要源代码可用,我不太关心它是否开源。 如果它是开源的,我会向该项目捐款。 如果它是商业组件,我会支付合理的价格。 无论如何,这些工具有助于使编程变得有趣,并且结果具有数据完整性并且美观。 如果我开发一个维基或论坛,我知道我可以让它们无缝地协同工作。 最后,我提到的所有工具都已经存在很长时间了,并且都是由享有盛誉的杰出开发人员编写的。

My approach has been to use third party code for some core functionality. For example, I use Subsonic for my data access, Devexpress components for UI and Peter Blum Data Entry Suite for data entry and validation. Subsonic is open source, Devexpress Peter Blum's controls have source code available for an extra fee. It would be impossible for me to get the functionality of these control if I tried to write them myself.

This approach allows me to focus on the custom functionality of my application without having to worry about how I will access the database or how I make an editable treelist that looks pretty. Sure I don't have a fully configured and working forum but I know that I'll be using a SQL database for my app and I won't have to try and get different data storage components to work together. I don't have a wiki but I know how to use the devexpress ui components and formatting and validating data entry is breeze with Peter Blum's controls. In other words, learn tools (and of course choose them carefully) that will speed development of all of your projects then you can focus on portions of your application that have to be customized.

I'm not too concerned if it's open source or not as long as source code is available. If it's open source I donate to the project. If it's a commercial component I will pay a fair price. In any case, the tools help to make programming fun and the results have data integrity and are great looking. If I develop a wiki or forum I know that I can get them to work together seamlesslessly. Finally, all of the tools I have mentioned have been around for a long time and are written by outstanding developers with great reputations.

断肠人 2024-07-11 01:59:34

如果您要使用开源库,请选择具有良好许可证的库。 我通过艰难的方式(在尝试 OEM 应用程序时)发现许多公司回避 LGPL 等许可证。 我不会详细说明原因,但他们更喜欢 Apache、BSD 或 MIT 风格的许可证。

选择已经存在一段时间的工具。 检查社区并确保其处于活跃状态。 看看其他人在使用什么并使用这些工具。

选择协同工作的技术。 我已经组合了一个使用 ORM 和 Web 服务的应用程序。 Spring Framework + Apache CXF + JPA 为 ORM 创建了一个很好的技术堆栈。 我使用的所有工具都可以在 Spring 中轻松地结合在一起,从而可以轻松地一起使用它们。 您最不想做的就是选择一些工具,您必须编写一堆代码才能将它们一起使用。

选择基于标准的技术。 这样,如果库或工具失效,您可以轻松切换到使用相同标准的另一个库或工具。

If you are going with open source libraries, pick ones with a good license. I have found out the hard way (when trying to OEM an application) that many companies shy away from licenses like LGPL. I won't go into the details on why but they prefer Apache, BSD or MIT style licenses.

Pick tools that have been around for a while. Check out the community and make sure it is active. See what other people are using and use those tools.

Pick technologies that work well together. I've put together an application that uses ORM and Web Services. Spring Framework + Apache CXF + JPA for the ORM created a nice technology stack. All of the tools I use easily tie together in Spring making it easy to use them together. The last thing you would want to do is pick tools that you have to write a bunch of code just to use them together.

Pick technologies that are based on standards. That way if the library or tool dies, you can easily switch to another that uses the same standard.

暮年慕年 2024-07-11 01:59:34

确保您的应用程序和第三方应用程序或库之间的接口使得您可以轻松地将其替换为其他应用程序,以防万一。 在某些情况下,第三方软件可能只是标准 API 的实现(Java 通过 JDBC、JMS、JNDI 等实现了很多功能)。 在其他情况下,这意味着将第三方库包装在您提供的某些 API 中。

当然,有时会抛弃这个想法,并将东西与第三方软件紧密集成。 只要确保您确实想要将您的应用程序绑定到该第三方即可。 一旦你走上这条路,就很难回头改变主意。

Make sure that the interface between your application and the third-party application or library is such that you can replace it easily with something else just in case. In some cases the third-party software may just be an implementation of an standard API (Java does this a lot with JDBC, JMS, JNDI, ...). In other cases this means wrapping the third-party library in some API that you come up with.

Of course there are times to throw that idea out the window and have things tightly integrated with the third-party software. Just be sure that you REALLY want to bind your application to that third-party. Once you go down this road it's REALLY hard to go back and change your mind.

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