这是一个合理的“应用程序入口点”吗?

发布于 2024-07-07 12:35:51 字数 181 浏览 8 评论 0原文

我最近遇到一种情况,代码动态加载一些库,将它们连接起来,然后调用所谓的“应用程序入口点”(其中一个库必须实现 IApplication.Run())。

这是有效的“应用程序入口点”吗?

我总是认为应用程序入口点是在加载库之前,并发现 IApplication.Run() 在经过大量工作后被调用,这有点误导。

I have recently come across a situation where code is dynamically loading some libraries, wiring them up, then calling what is termed the "application entry point" (one of the libraries must implement IApplication.Run()).

Is this a valid "Appliation entry point"?

I would always have considered the application entry point to be before the loading of the libraries and found the IApplication.Run() being called after a considerable amount of work slightly misleading.

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

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

发布评论

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

评论(5

泼猴你往哪里跑 2024-07-14 12:35:51

“应用程序”和“系统”这两个术语的使用非常广泛且多样化,因此您需要预先与对话伙伴就它们的含义达成一致。 例如,有时应用程序是带有 UI 的东西,而系统是“无 UI”的。 一般来说,就是你说土豆,我说土豆的情况。

至于您使用的示例:这正是运行时(例如.NET 或java)所做的:加载一组库并调用应用程序入口点,即“main”方法。

因此,在您的情况下,加载库的代码执行相同的操作,并且可能调用接口上的方法,然后您可以将加载代码视为该应用程序的运行时。 这只是一个视角问题。

The terms application and system are terms that are so widely and diversely used that you need to agree what they mean upfront with your conversation partner. E.g. sometimes an application is something with a UI, and a system is 'UI-less'. In general it's just a case of you say potato, I say potato.

As for the example you use: that's just what a runtime (e.g. .NET or java) does: loading a set of libraries and calling the application entry point, i.e. the "main" method.

So in your case, the code loading the libraries is doing just the same, and probably calling a method on an interface, you could then consider the loading code to be the runtime for that application. It's just a matter of perspective.

稀香 2024-07-14 12:35:51

术语“应用程序”可以表示您想要的任何含义。 “应用程序”仅仅意味着协同工作以帮助您解决问题的资源(库、代码、图像等)的集合。

因此,回答你的问题,是的,这是“应用程序”一词的有效使用。

The term "application" can mean whatever you want it to mean. "Application" merely means a collection of resources (libraries, code, images, etc) that work together to help you solve a problem.

So to answer your question, yes, it's a valid use of the term 'application'.

何时共饮酒 2024-07-14 12:35:51

应用程序本身实际上没有任何意义。 人们经常用它来谈论为用户提供一些价值的计算机程序。 更正确的术语是应用软件,其定义如下:

应用程序软件是
计算机软件采用
直接计算机的能力
并彻底完成用户的任务
想要表演。 这应该是
与系统软件相比
参与整合
计算机的各种功能,但是
通常不直接应用它们
在执行任务时
使用户受益。 在此背景下
术语“应用”指的是
应用软件及其
实施。

由于应用程序实际上意味着应用程序软件,而软件是在计算机上执行任何类型任务的任何代码段,因此我认为库也可以是应用程序。

无论如何,大多数术语都是人造的。 插件不是应用程序吗? 您的浏览器的flash插件没有应用吗? 人们说不,这只是一个插件。 为什么? 因为它不能单独运行,所以需要加载到真实的进程中。 但没有定义说只有“可以自行运行”的东西才是应用程序。 对于图书馆来说也是如此。 核心应用程序可能只是一个空容器,所有逻辑和功能,甚至与用户的交互,都可以由插件或库执行,在这种情况下,它比空容器更像是一个应用程序,只为应用程序提供一些上下文。要运行的应用程序。 将此与 Java 进行比较。 Java 应用程序不能单独运行,它必须在 Java 虚拟机 (JVM) 中运行,这是否意味着 JVM 就是应用程序,而 Java 代码只是......那么什么? 难道 Java 代码不是真正的应用程序,而 JVM 只是一个空的运行时环境,如果没有加载的 Java 代码,它不会向最终用户提供任何内容吗?

Application on its own means actually nothing. It is often used by people to talk about computer programs that provide some value to the user. A more correct term is application software and this has the following definition:

Application software is a subclass of
computer software that employs the
capabilities of a computer directly
and thoroughly to a task that the user
wishes to perform. This should be
contrasted with system software which
is involved in integrating a
computer's various capabilities, but
typically does not directly apply them
in the performance of tasks that
benefit the user. In this context the
term application refers to both the
application software and its
implementation.

And since application really means application software, and software is any piece of code that performs any kind of task on a computer, I'd say also a library can be an application.

Most terms are of artificial nature anyway. Is a plugin no application? Is the flash plugin of your browser no application? People say no, it's just a plugin. Why? Because it can't run on it's own, it needs to be loaded into a real process. But there is no definition saying only things that "can run on their own" are applications. Same holds true for a library. The core application could just be an empty container and all logic and functionality, even the interaction with the user, could be performed by plugins or libraries, in which case that would be more an application than the empty container that just provides some context for the application to run. Compare this to Java. A Java application can't run on it's own, it must run within a Java Virtual Machine (JVM), does that mean the JVM is the application and the Java Code is just... well what? Isn't the Java code the real application and the JVM just an empty runtime environment that provides nothing to the end user without the loaded Java code?

红焚 2024-07-14 12:35:51

我认为在这种情况下“应用程序入口点”意味着“应用程序(您的代码)进入库的点”。

I think in this context "application entry point" means "the point at which the application (your code) enters the library".

听风念你 2024-07-14 12:35:51

我想您可能指的是 C/C++ 代码中的 main() 函数或 Windows 应用程序中的 WinMain 。 也就是说,这是应用程序中通常开始执行的点。 您的问题非常广泛和模糊 - 例如,您在哪个操作系统上运行 - 但是 可能就是您要找的。 也可能解决这个问题。

请记住,当您提出问题时,细节是您的朋友。 当您向他们提供详细信息时,人们可以给您更好、更明智的答案。

编辑:
在更广泛的背景下,从操作系统的角度考虑必须发生什么。 当用户指定他们想要运行某个应用程序时,操作系统必须从硬盘驱动器加载该应用程序,然后当该应用程序加载到内存中时,它必须将控制权传递给新加载的应用程序占用的内存中的某个点应用程序继续执行。 这将是“应用程序入口点”。 当使用动态链接代码构建应用程序时,操作系统必须加载所有动态链接代码,以便将正确的应用程序映像放入内存。 加载这些共享代码并不会改变这样一个事实:当应用程序加载到内存中时,操作系统必须有一个点来传递控制权。

I think probably what you're referring to is the main() function in C/C++ code or WinMain in a Windows app. That is, it's the point where execution is normally started in an app. Your question is pretty broad and vague--for example, which OS are you running this on--but this may be what you're looking for. This might also address the question.

Bear in mind when you're asking questions, details are your friend. People can give you a much better, more informed answer when you provide them with details.

EDIT:
In a broader context consider what has to happen from the standpoint of the OS. When the user specifies that they want to run an app, the OS has to load the app from the hard drive and then when the app is loaded into memory, it has to pass control to some point in the memory blocked occupied by the newly loaded app to continue execution. That would be the "Application Entry Point". When an app is constructed with dynamically linked code the OS has to load all that dynamically linked code in order to get the correct app image into memory. Loading up those shared bits of code does not change the fact that the OS must have a point to which to pass control when the app is loaded into memory.

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