這是一個合理的“申請入口點”嗎?

[英]Is this a reasonable “Application entry point”?


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()).

我最近遇到過這樣一種情況:代碼動態加載一些庫,連接它們,然后調用所謂的“應用程序入口點”(其中一個庫必須實現IApplication.Run())。

Is this a valid "Appliation entry point"?

這是一個有效的“Appliation入口點”嗎?

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.

我總是認為應用程序入口點是在加載庫之前,發現IApplication.Run()在大量工作之后被調用有點誤導。

5 个解决方案

#1


1  

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.

應用程序和系統這兩個術語是如此廣泛和多樣化使用的術語,您需要與對話伙伴達成一致意見。例如。有時,應用程序是具有UI的東西,而系統是“無UI”的。一般來說,這只是你說土豆的情況,我說馬鈴薯。

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.

至於你使用的例子:這就是運行時(例如.NET或java)的作用:加載一組庫並調用應用程序入口點,即“主”方法。

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.

因此,在您的情況下,加載庫的代碼也是一樣的,並且可能在接口上調用方法,然后您可以將加載代碼視為該應用程序的運行時。這只是一個透視問題。

#2


0  

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'.

所以,回答你的問題,是的,它是“應用程序”一詞的有效用法。

#3


0  

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?

無論如何,大多數術語都是人為的。插件沒有應用程序嗎?您的瀏覽器的Flash插件是否沒有應用程序?人們說不,這只是一個插件。為什么?因為它不能獨立運行,所以需要將其加載到實際進程中。但沒有定義說只有“可以自行運行”的東西才是應用程序。同樣適用於圖書館。核心應用程序可能只是一個空容器,所有邏輯和功能,甚至是與用戶的交互,都可以通過插件或庫來執行,在這種情況下,這將是一個應用程序,而不是僅為空容器提供一些上下文的應用程序。應用程序運行。將其與Java進行比較。 Java應用程序不能獨立運行,它必須在Java虛擬機(JVM)中運行,這是否意味着JVM是應用程序而Java代碼只是......那么什么呢? Java代碼不是真正的應用程序,而JVM只是一個空的運行時環境,在沒有加載的Java代碼的情況下不向最終用戶提供任何內容嗎?

#4


0  

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

我認為在這種情況下,“應用程序入口點”意味着“應用程序(您的代碼)進入庫的位置”。

#5


0  

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.

我想你可能指的是C / C ++代碼中的main()函數或Windows應用程序中的WinMain。也就是說,通常在應用程序中啟動執行。你的問題是相當廣泛和模糊的 - 例如,你在運行這個操作系統 - 但這可能是你正在尋找的。這也可能解決這個問題。

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.

編輯:在更廣泛的背景下,考慮從操作系統的角度來看會發生什么。當用戶指定他們想要運行應用程序時,操作系統必須從硬盤驅動器加載應用程序,然后當應用程序加載到內存中時,它必須將控制權傳遞給被新加載占用的內存中的某個點應用程序繼續執行。這將是“應用程序入口點”。當使用動態鏈接代碼構建應用程序時,操作系統必須加載所有動態鏈接代碼,以便將正確的應用程序映像存入內存。加載那些共享的代碼位並不會改變操作系統必須具有一個點,以便在應用程序加載到內存時傳遞控制權。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2008/09/30/d8f287e685ac24661f39bb7173cf7f83.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com