我的框架将利用其他框架,但我希望这对最终用户是透明的

发布于 2024-09-02 10:32:05 字数 483 浏览 5 评论 0原文

我正在构建一个框架,旨在为用户提供一个新的开发环境,但我需要使用 RegexKit 之类的东西以及几乎肯定一些其他已建立的框架才能做到这一点。出于维护原因,从此类框架公开的任何功能都将通过我自己的框架中的类和方法进行抽象(允许我改变我想要的依赖项的想法)。

在理想的世界中,我只想发布一个 .framework。但是我知道,与标准捆绑包和应用程序不同,不可能在框架捆绑包中嵌入框架。除了告诉最终用户他们还必须安装 RegexKit 和任何其他依赖项之外,我还有其他选择吗?我有一种感觉,这降低了我设想构建的易于使用的嵌入式框架的吸引力。

现在我觉得我有一些有限的选择:

  1. 强制用户安装依赖项。
  2. 编写我自己的类来提供相同的功能——呃!
  3. 如果可能的话,尝试静态链接第三方框架(这可能吗?)

我的最终产品理想情况下是一个使用 @rpath 的单个 .framework 捆绑包,因此可以安装在系统中或简单地与应用程序捆绑在一起使用它。

I'm building a framework, which aims to provide a new development environment for the user, but I need to use things like RegexKit and almost certainly some other established frameworks in order to do this. Any functionality exposed from such frameworks would be abstracted through classes and methods in my own framework for maintenance reasons (allowing me to change my mind on which dependencies I want).

In an ideal world I just want to ship a single .framework. However I'm aware that unlike with standard bundles and applications it is not possibile to embed a framework inside the framework bundle. Do I have any other option other than to tell the end user that they must also install RegexKit and any other dependencies? I have a feeling this lessens the appeal value of the easy to use embedded framework I'd envisaged building.

Right now I'm feeling like I have some limited options:

  1. Force the user to install the dependencies.
  2. Write my own classes that provide the same functionality -- ugh!
  3. If at all possible, try to statically link the third party frameworks (is this possible??)

My end-product is ideally a single .framework bundle that uses @rpath and so can be installed in the system or simply bundled with the app that uses it.

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

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

发布评论

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

评论(1

梦忆晨望 2024-09-09 10:32:05

很抱歉回答我自己的问题,但是如果我想封装依赖项,而用户甚至不必关心它们的存在,那么可加载的包绝对是我想要的。

我实际上正在考虑让我的整个框架成为一个可加载的包而不是一个框架,因为第一印象似乎你可以实现或多或少相同的事情,只是代码加载到内存中的方式不同。或者只有两个文件:框架和运行所需的包。

编辑|如果有人对原来的问题有更好的答案,我会暂时不回答这个问题。

Sorry to answer my own question, but a loadable bundle is definitely what I want if I want encapsulate the dependencies without the user ever having to even concern themselves with their existence.

I'm actually considering just making my whole framework a loadable bundle instead of a framework since on first impressions it appears you can achieve more or less them same thing, just that the way the code is loaded into memory differs. Either that or just have two files: the framework and a bundle it requires in order to run.

EDIT | If anybody has a better answer to the original question I'll keep this question unanswered for a while.

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