Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition [Electronic resources] - نسخه متنی

Andy Wigley; Peter Roxburgh

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید






Considerations for Mobile Devices

You might find the title of this section a little strange. In an object-oriented framework, shouldn't XML Web services be loosely coupled with the applications that consume them and remain independent of the Web applications client? Although this is true, XML Web services offer such a flexible way to provide remote services that they're vulnerable to misuse, which can cause problems for a mobile client. That's why we thought this section was warranted.

You call XML Web services from your application code, such as an ASP.NET Mobile Controls application, and often the output from the Web service will be used to load a List control or to set the Text property of a TextView control, and hence is sent to be displayed in the client browser. For example, consider a stock price Web service: an application might allow the user to enter a code that indicates whether he or she requires the price of an individual stock or the prices of an entire sector, and this code is passed in the call to the stock price Web service. If the stock price Web service returns a response containing the prices of an entire sector, a desktop browser could easily display a page containing all that data. In fact, most desktop browsers could display all the prices of stocks that an individual exchange quotes. However, an application that displays on a mobile client can't display all the information the service returns, even though it can call the service.

This scenario even extends to situations in which you provide a mobile Web Forms page that formats and paginates information on behalf of the user. Imagine an application that displays 100 pages of information. This would certainly test the patience of even the most understanding user. As a developer, it's your responsibility to ensure that a mobile client gains the most benefit from a mobile application. To write usable applications that access XML Web services, you should always keep a few things in mind.

First, when you write an XML Web service, you should not make it provide data that's optimized for a particular client. For example, the idea of providing information in small chunks might appeal to you. However, this breaks the whole design philosophy of .NET applications. You should treat XML Web services as objects that simply return data from some processing function with no regard for the client.

Second, you should always consider the potential limitations of many mobile clients and write code in your mobile Web Forms pages to compensate for them. For example, the stock quote service mentioned earlier can return information in a DataSet object, which can contain the ticker symbol, current price, day high, day low, yield, gearing, and so forth. A desktop browser can easily display all this information. However, if you display all this information as a whole on a mobile client, the application will effectively be unusable. Restructure the information by providing a list of ticker symbols with links to further detail pages. It makes more sense to break this information up and to initially offer the user only the more important parts.

/ 145