框架与捆绑 [英] Frameworks vs. Bundles

查看:94
本文介绍了框架与捆绑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够为正在开发的应用程序添加插件,并且由于它是一种开发工具,所以我希望其他人能够编写自己的插件.

I want to be able to add plugins for an application I am developing and as it is a development tool I want other people to be able to write their own plugins.

所以我的问题是框架和可装入捆绑包之间的真正区别是什么?哪个更适合作为插件(访问标头等)?而且,如果我使用可加载的包,该如何在运行时加载它们并在开发过程中访问它们的功能?

So my questions are what are the real differences between a framework and a loadable bundle? Which are more suited to being a plugin(accessing of headers, ect) ? And if I use loadable bundles how do I load them at runtime and access their functionality during development?

这些插件不必依赖其他插件.

The plugins should not have to rely on other plugins.

推荐答案

您是否看过

Have you taken a look at NSBundle? It has all the methods you'll need to load the executable code at runtime. You'll want to define some sort of plugin interface to which any plugin will conform.

关于包和框架之间的区别...包和框架都是文件结构,其中包含您的应用程序可以使用的各种资源.框架就像一个库-它是您的程序在构建时所针对的链接.另一方面,捆绑包实际上是一个文件夹结构,其中包含您在运行时加载的已编译代码.

As for the difference between bundles and frameworks... Both bundles and frameworks are file structures that contain various resources that your app can use. A framework is like a library -- it's something your program links against when you build it. A bundle, on the other hand, is essentially a folder structure containing compiled code that you load at runtime.

这篇关于框架与捆绑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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