与POS系统通讯
我想为客户实现一个简单的 POS,因为当前的专有软件不容易使用。PDA(Windows)直接连接到数据库以获取当前软件中的数据。
对于我的系统,我相信网络服务是一种矫枉过正的做法。我可以与 pda 和服务器进行套接字通信,但这非常基本!服务器将用java编写。
在搜索时,我发现 Apache Thrift 是一种解决方案,但我不确定 Thrift 中的服务器是否是应用程序...
其他解决方案是使用兼容 java/c# 的序列化器,但随后我必须为逻辑编写代码。
另外我希望能够从服务器向客户端发送通知,否则我看不到解决方案而不是使用计时器..
直接与数据库连接会导致编写两次或更多数据库代码,这似乎不是一个好主意。除了数据库之外,还有其他服务(打印机、税务等) 对于此/通信还有其他解决方案/建议吗?
I want to implement a simple POS for a client because current proprietary software isnt easy to use.. PDAs(windows) connect directly to database to fetch data in current software.
For my system i believe that webservices would be an overkill. I can do a socket communication with pdas and server but this is very basic! Server would be written in java.
While searching i found that Apache Thrift is one solution but i am not sure whether server in thrift is the application...
Other solution would be using a serializer compatible java/c# but then i would have to write code for the logic.
Also i would like to be able to send notifications from server to client,otherwise i see no solution instead of using a timer..
Direct connection with database would result in writing twice or more the database code which doesnt seem good idea.. Also apart from databases there are other services too(printers,tax etc)
Any other solution/reccomendation for this/communication?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 PDA 可以使用的服务器上构建 RESTful API。
至于服务器到客户端的通信,对于 Android,您可以使用 C2DM 框架。这会向您的 Android 设备发送通知,然后您的 Android 设备就可以联系服务器。我相信iOS也有类似的概念。对于 Windows Mobile,您可以使用原始套接字(客户端启动到服务器的连接)和您自己的通知协议(或构建基于 HTTP 的协议),或者开发一个 SMS 拦截器,带有特制消息,以便客户端知道要联系服务器。
使用 Web 服务器可能是一件好事。您可以获得一些相当便宜的功能,例如 SSL/TLS 和身份验证支持。将此与原始套接字方法进行比较,在原始套接字方法中,任何人都可以明文传输数据。您最终将构建自己的协议来解决 HTTP 已经解决的一系列问题。
Build RESTful APIs on the Server that your PDAs can consume.
As for server to client communication, for Android you could use the C2DM framework. This sends a notification to your Android device, and then your Android device could contact the Server. I believe iOS has a similar concept. For Windows Mobile, you could use a raw socket (client initiated connection to the server) with your own notification protocol (or build an HTTP-based one) or perhaps develop an SMS intereceptor with specially crafted messages so that the client knows to contact the server.
Using a Web Server could be a good thing. You get a few features fairly cheap, such as SSL/TLS and authentication support. Compare this to a raw sockets approach, where data gets transmitted in the clear by anybody. You'll end up building your own protocol that solves a bunch of problems HTTP already addresses.