dongxiong2000 2014-07-21 21:27
浏览 41

SOA架构

I am building a PHP web based application using ZF2 and SOA implemented by SOAP and XML. So my developers are now building every single function in SOAP and calling it from the relevant controller like if an external system is using this API/web service. So is what we are doing right or we as the developer of the web service of this app we shouldn't call the web service as well rather than sending the request directly to the controller without passing through soap.

What's the best practice for this?

  • 写回答

1条回答 默认 最新

  • dongtun3328 2014-07-22 03:54
    关注

    Of course the answer to this is "it depends".

    Using your external API layer to build your application has some real advantages. It validates the layer, making sure that your API is complete. It also allows you to do things like separate the tiers of your application, allowing you to scale the different layers much more easily.

    Ultimately, I really prefer building my applications this way, unfortunately, as with all things, there is a cost. That cost is usually performance. Going through SOAP serialization/deserialization is usually a significant performance hit, and usually gets shot down when you realize that you can double your performance by binding to the business logic without going through that deserialization/serialization request/response cycle. My usual compromise is to use the same API that the webservice API exposes, but using a direct binding client.

    This cost could be totally irrelevant for your application though. If you are careful to keep your API very coarse grained, and thus minimize the number of calls, the cost of the SOAP messaging might be low enough as to be unnoticeable. As with all performance concerns though, do not assume, measure. The thing that you think is slowing you down might be totally subsumed by some other component or layer.

    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀