使用Objective-C的Web应用程序编程? [英] Web application programming using objective-c?

查看:133
本文介绍了使用Objective-C的Web应用程序编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是说你有写在MVC正确写入目标c /可可一个相当大的,复杂的桌面应用程序。然后,您要更换的V和C,以便它是一个Web应用程序?

Just say you have a quite large and complicated desktop application written in objective-c/cocoa written properly in MVC. You then wish to replace the V and C so that it is a web application?

有没有如Tomcat但目标C什么?我能想到的是某种转换模型code到Apache模块最接近Apache中加载?

Is there anything like Tomcat but for objective c? The closest thing I can think of is somehow convert the Model code into an apache module to load in apache?

很显然,我可以嵌入某种形式的HTTP服务器和写入code的一大堆管理会话和请求和响应等,但可能会有一个更简单的方法?

Obviously I could embed some sort of HTTP server and write a whole pile of code to manage sessions and requests and responses and so on, but might there be a simpler way?

推荐答案

您可以保留服务器几乎原样。我想运行在后台的守护程序。

You can leave the server almost as-is. I'd run it as a daemon in the background.

我想分裂控制器部分。它的一部分驻留在服务器的HTTP请求和守护程序之间的连接上。

I'd split the controller part. One part of it resides on the server as a connection between HTTP requests and the daemon.


  • 您可以运行自制http服务器。

  • 您可以建立它变成一个Apache模块,你提到的。

  • 您可以通过CGI访问控制器。这是最简单的选择,因为我看到了。

控制器的第二部分被写入的Javascript在浏览器中,与服务器交换数据和更新所述图形用户界面。

The second part of the controller is written in Javascript in the browser, exchanging data with the server and updating the GUI.

视图部分是在JavaScript完全写入。

The view part is written completely in javascript.



  • 您可以 - 如果你想 - 离开了服务器上的控制器,使模型理解HTTP请求

  • You could - if you want - leave out the controller on the server and make the model understand HTTP requests.

有关控制器/视图部分可以考虑使用一个框架。

For the Controller / View part consider using a framework.


  • 的jQuery 只有一个光接口。 (或类似的框架。)

  • 我还没有找到一个框架,离开所有的模型东西到服务器。也许你可以相应地使用了SproutCore或卡布奇诺。

  • SproutCore的,全面支持MVC框架所使用的苹果。 (想想这样至少。)

  • 卡布奇诺,另一个完整支持MVC框架。

  • jQuery for only a light interface. (Or a similar framework.)
  • I haven't yet found a framework that leaves all the model stuff to the server. Maybe you can use SproutCore or Cappuccino accordingly.
  • SproutCore, the full-backed MVC framework that is used by Apple. (Think so at least.)
  • Cappuccino, another full-backed MVC framework.

这篇关于使用Objective-C的Web应用程序编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆