开发者

Making wide application (with plugins)

开发者 https://www.devze.com 2022-12-19 11:10 出处:网络
I\'m going to make my application extensible. Where I can read information about writingprogr开发者_StackOverflow中文版ams which support plugins?

I'm going to make my application extensible. Where I can read information about writing progr开发者_StackOverflow中文版ams which support plugins? C++


A plug-in architecture is what you need to look-up and read about. A SO answer will not help beyond providing a few stray links. I'll try to explain as briefly as I can: Typically, plug-ins are a set of dynamic libraries that the host application loads (usually at start up, sometimes delay loaded for efficiency purposes). They then become part of the application and behave as if they were a native/core component. Hence, you need to rethink about your application's architecture and module design as well. Here are a set of questions you'll need to answer:

  • What do you call the core?
  • What do you want the plug-ins to do?
  • What set of core functionality will the plug-ins need?
  • If your application is cross-platform you'll need to make sure your plug-in APIs are cross-platform too -- which usually involves some work.
  • Do you want the plug-ins to modify the UI? This opens up a whole new box of surprises.


your best bet is looking at something like Lua. It will allow you to have cross platform plugins and load code without having to start and restart your application. Dynamic code loading in C++ is very platform specific and non-portable without a tremendous amount of work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号