問題描述
具有“插件”能力的 ASP.NET 內網應用程序 (ASP.NET intranet application with "plug-in" ability)
I'm working on an ASP.NET 3.5 site that is intended to be an intranet application. How would it be possible to create a kind of "plug-in" architecture, such that I can add additional functionality to the site without recompiling the site? I'm thinking of additional functionality as developing separate modules that can be compiled into DLL's that can just be "added" to the site. Dunno if this is the right way to go about this sort of stuff. I'm aware that DotNetNuke caters for this, and that you can develop 'modules' for it, but for the purpose of learning, I would like to know how this is achieved?
I dont know whether this is the route to follow, or if I should just cater for everything, and give certain functionality the ability to be turned on or off?
參考解法
方法 1:
This isn't as easy as it sounds.
The simplest solution is to use frames and fixed layout. Each frame would then request a specific page, which would be routed to a plugin. Rendering portions of a single page is much more difficult.
For discovery of plugins, the simplest solution would be a IOC framework, which could pick up your dependencies (plugins) for you.