适用于多种设备的演示技术
我们的应用程序应该为多种设备提供服务,从简单的智能手机、iPhone、触摸屏到普通浏览器。
应用程序是分层的,因此我们可以重用业务层和持久层。 然而,我们也想对单个表示层进行编程。 例如,我知道 ASP .NET 根据浏览器类型生成不同的 html 输出。 http://msdn.microsoft.com/en-us/library/ms178620。 aspx
甚至有一些网站承诺将您的网站转换为移动设备: http://instantmobilizer.com
有没有一个java框架能够生成适应客户端浏览器和设备的演示文稿,所以我们不需要为每种设备类型编写不同的表示层?在 Web 应用程序中管理多设备支持要求的标准方法是什么?
Our application is supposed to serve multiple devices, from simple to smart-phones, IPhones, touch-screens to normal browsers.
Application is layered, so we can reuse the business and persistence layer.
However, we would like to program single presentation layer as well.
I know for example that ASP .NET generates different html output based on the browser type.
http://msdn.microsoft.com/en-us/library/ms178620.aspx
There are even some sites that promise to transform your site to mobile:
http://instantmobilizer.com
Is there a java framework capable of producing the presentation that adapts to client browser and device, so that we do not need to program different presentation layer for each device type? What is the standard way to manage multiple devices support requirement in web applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
虽然您确实可以从单个视图实现中生成不同的标记样式(例如,使用根据设备类型选择的不同 XSL 转换),但您最终仍然会背负“最低公分母”界面。
举一个稍微人为(且过时)的示例,假设您想从单个视图实现生成 WML、低端 HTML 和高端 XHTML。由于 WML 是三者中最基本的,因此您的视图将无法利用更高级表示的功能(除了纯粹的装饰性之外)。在此示例中,WML 只能呈现非常基本的表单,而高端 XHTML 设备可以执行精美的 CSS 和 javascript 内容。
您希望能够利用各类设备的功能,否则最终在所有设备上都会显得蹩脚和原始。
当您拥有手机、iPhone 和桌面浏览器等多种设备时,拥有满足所有这些设备的单一视图并不实际。
实际上,最好的选择是在用户进入系统时检测设备类型,然后将他们设置为针对该特定设备定制的视图序列。
While it's true that you can conceivably generate different markup styles from a single view implementation (e.g. using different XSL transforms selected based on device type), you're still going to end up saddled with the "lowest common denominator" interface.
To take a slightly artificial (and dated) example, say you wanted to generate WML, low-end HTML and high-end XHTML from a single view implementation. Since WML is the most basic of the three, your view would not be able to take advantage of the capabilities of the more advanced representations, beyond the purely cosmetic. In this example, WML can only render very basic forms, whereas high-end XHTML devices can do fancy CSS and javascript stuff.
You want to be able to take advantage of the capabilities of the various classes of device, otherwise it'll just end up looking crappy and primitive on all of them.
When you have devices as diverse as mobile phones, iphones, and desktop browsers, having a single view that satisfies all of them isn't really practical.
In practice, the best option is to detect the device type when the user enters the system, and then set them off on a view sequence tailored to that specific device.
处理连接到单个 Web 应用程序的多个设备的标准方法是编写针对每个设备定制的单独表示层。
如果不这样做,您可能需要检查 CSS 引用的
media
属性。它至少允许您为移动设备提供不同的样式表(即使它不会将 Motorola Razr 与 Blackberry Bold 分开):CollyLogic:改善手持浏览的 7 个步骤
The standard way to handle multiple devices connecting to a single web application is to write seperate presentation layers custom tailored to each device.
Short of doing that, you might want to check out the
media
attribute for CSS references. It will at least allow you to provide a different stylesheet for mobile devices (even though it won't seperate a Motorola Razr from a Blackberry Bold):CollyLogic: 7 steps to better handheld browsing
当然,处理连接到单个 Web 应用程序的多个设备的标准方法是为每个设备执行不同的演示。实现这一切的一个框架是 ZK
您可以在 http://www.zkoss.org/zkdemo/userguide/# 观看现场演示f2
Sure the standard way to handle multiple devices connecting to a single web application is doing different presentation for each device. One framework that enables all this is ZK
you can see live demo at http://www.zkoss.org/zkdemo/userguide/#f2