Vote for the best protocol for the given scenario

后端 未结 9 2259
时光取名叫无心
时光取名叫无心 2021-02-08 22:04

I have a design decision to make. I need your advice.

Requirements:

  • A server and a client. client is typically a mobile phone.
  • Connected through t
9条回答
  •  梦谈多话
    2021-02-08 22:35

    For starters, avoid SOAP if you want to put the client on a mobile phone and have a light solution. SOAP is a pig on wasting CPU and bandwidth. It is not the simplest solution either.

    If you plan on having clients implemented on the browser (using javascript) a JSON based solution is the obvious path to follow, and it is simple too. For an aidea of what it would be like, please read this article:

    • http://www.ibm.com/developerworks/web/library/wa-ajaxintro11.html

    You can find more resources at json.org

    You can probably use a JAX-RS just as a glorified Servlet implementation. (Many of us are saying that JAX-RS's JSR 311 looks like what the Servlet spec should have been from the start... which is not exactly that simple, but... )

    About the "one thread per post" - that is a non issue since all the technologies you mention will behave that same way on most Application Servers / Servlet Engines - each request being processed at a given time will take its own thread.

    (You are not talking about Comet here - a tecnhology which tends to take a thread per session unless you have a special bread of application server.)

提交回复
热议问题