[英]C++: Application architecture with API
My application it's C++ service. 我的应用程序是C ++服务。 And I need to add API for it.
而且我需要为其添加API。 I consider that it will be XML/JSON RPC based API.
我认为它将是基于XML / JSON RPC的API。 How should I design a program for reusing existing code base and provide API.
我应该如何设计一个程序以重用现有代码库并提供API。
I see following options: 我看到以下选项:
Thanks. 谢谢。
If you can use a web server, then the FastCGI concept might be what you're looking for. 如果您可以使用Web服务器,那么FastCGI概念可能就是您想要的。 One of the main duties of FastCGI is to allow you to put on a public API (from the web server) that internally calls the "real" application, in your case the resident C++ service.
FastCGI的主要职责之一是允许您放置一个公共API(来自Web服务器),该API在内部调用“真实”应用程序(在您的情况下为常驻C ++服务)。 So all work is done at the web server to create the public API using any technology you wish, and little or no code changes done in your C++ service.
因此,所有工作都在Web服务器上完成,以使用您希望使用的任何技术来创建公共API,并且在C ++服务中几乎没有代码更改或根本没有代码更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.