转载 “one page, one application”

one page, one application

作者:michael chen

前言:

这篇文章本应该在一个月前就写出来,但是因为种种原因,腹稿打了数十遍,现在才有时间提笔来写。文中某些观点相对目前的 web应用比较前卫,阅读者应当根据自己应用的具体情况,对此文进行批判的阅读。by michael chen

一 定义

one page, one application(后面缩写为opoa,或者1p1a),含义很简单:一个页面就是一个应用。在众多的基于 web的mis系统中,没有人关心页面的组织形式;大多数稍微复杂的mis系统,都采用分祯 (frame)的方式来组织页面,这样,在进行业务操作的时候,url的变化表现在一个 框架页面内,从浏览器的地址看起来,只有一个地址;更有甚者,一些应用干脆弹出一个去掉了浏览器菜单、工具条、地址栏、状态栏的窗口(比如招商银行、民生银行的网上银行系统),连地址都看不见。因此,一个页面就是一个应用,从用户的角度来说,对于操作型系统,是一种非常自然的体现。用户无需了解每一个具体的操作对应的地址是什么。

这种设计背后的含义实际是:是希望由程序来控制用户的行为,还是反过来。在操作型系统中,每一步的操作往往被业务含义严格定义,无论是应用的设计者,还是其使用者,都希望在一种受控的状况下来进行操作。例如,一个审批动作,用户更希望是通过一个按钮来触发,而不是访问类似于 /approve.action?itemid=123的方式。

二 场景

显然,opoa的设计只能针对那些对url不敏感的系统,或者说操作型系统。绝大多数mis系统都属于这一范畴,email系统也是这一范畴,其他领域,如监控系统,聊天室等都可以采用这种思路。反面的例子是,对于内容型系统,如新闻系统,blog系统,论坛系统,用户更希望能够通过一个明确的 url来定位页面内容,搜 索引擎也喜欢这种地址。这种应用需要的是一个合理,易懂,明确的地址。

三 设计与实现

大多数mis系统,无论是有意识或者无意识,都遵循了opoa的思路。要么采用 框架,要么采用弹出窗口来屏蔽url的直接访问。实现上也很简单,这里就不再赘述了。注意到上述的opoa地实现只是对用户而言,看起来好像是一个页面一样,但实际上还是有众多的action, page在后面工作。

下面我要说的一种实现是,采用amowa/ ajax技术来实现真正意义上的opoa. 简而言之:主页面(或者称布局页面)只加载一次,其他的操作页面通过amowa/ ajax技术来加载,并将其中的操作脚本与布局内容分开,最后进行展示。这个设计的原型在buffalo-1.1dr版本中。细心的开发者一定能注意到,在切换不同demo的时候,只是调用了一个switchpage函数,将不同的页面进行读取并显示。demo的演示速度相当快,因为每次只读取一小部 分页面;如果加上缓存机制,将页面进行缓存,那么更快了。

首先存在一个布局页面,这个页面定义了一个应用大致的外观,(例如,大部分mis系统按照上中下三栏,中间部分左右两栏分别为顶部logo, 操作菜单,具体操作内容,底部状态栏)。用你喜欢的网页编辑工具,将这个页面设计美观,然后按照应用的要求,将页面进行拆分。此时的拆分不用frame 了,只需要在不同的部位加上<div id=&rdquo;&hellip;&rdquo;>就可以。

然后在主页面定义一个函数,例如switchpage, 将这个函数使用在需要进行页面切换的地方。在buffalo的sample中,switchpage函数这样实现:

function switchpage(page) {
    pagebuffalo.remotecall(&quot;pageservice.loadpage&quot;, &#91;page&#93;, function(reply) {
        var pageobj = reply.getresult();
        buffalo.getelementbyid(&quot;body&quot;).innerhtml = pageobj.html;
        if (pageobj.script != null pageobj.script != &quot;&quot;) {
            execscript(pageobj.script);
        }
    });
}


你可以用任意你喜欢的ajax/amowa引擎来做这件事情。

剩下的工作都可以想象了。你可以将web应用的网页资源全部用html编写,并放在一个不为人知的地方,而通过pageservice来读取他们;你可以任意组织你的应用外观,更加自如的切换他们。应用的url地址永远只有真正的一个,你的应用也要比别人快很多,因为只加载那么一小块内容。

四 小结

ajax/amowa的兴起为我们开阔了很多视野。比起原来的web框架,这种opoa的方式能够更快,减少更多的编码量,并提供更好的用户体验。当然,上文中提出的只是一个原型实现,如果尝试自行实现,可能更多的东西需要考虑,如安全,缓存,事件回调机制,内存管理等等。但这将是一个方向,一个可以提高开发体验与用户体验的方向。

转载自:http://www.sosof.com/detail/132/752132721634307.html
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ComponentOne 2012 V2 ActiveReports 7 3/3 ar7.zip ActiveReports 7 共三个压缩分卷,请全部下载后解压 Award-winning .NET reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an end-user Report Designer, Visual Studio integration, and more. The Preferred .NET Reporting Component with Pure Power See What's New in the ActiveReports 7 Release! Award-winning .NET Reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an End-User Report Designer, Visual Studio integration, and more. ActiveReports 7 brings Microsoft .NET developers everything from familiar Visual Studio integrated designers to extensive APIs. Create reports ranging in functionality from form-based reports such as invoices and insurance documents, to transaction reports such as sales and accounting, to analytical reports such as sales and budget analysis and portfolio analysis. Why Choose ActiveReports 7? § Multiple Report Types to Fit Your Reporting Needs § Fixed Page Layout gives developers a new way of creating reports where layout is the primary focus. Great for creating invoices, prospectus reports, forms, or other highly structured reports. § Continuous Page Layout makes it easy to create reports using tables, crosstabs, charts, and other data regions with flexible layouts. § Section-based Reports follow the tradition of previous ActiveReports versions as well as being similar to Access reports. Using code-behind or scripts, you can respond to the various events that occur while the report generates to create extremely customized reports that are hard to produce with other products. § Fast .NET Reporting Engine ActiveReports 7 is optimized for speed. Its unique architecture allows the lean reporting engine to quickly read records from the data source and immediately render them to the output device. The simplicity of the design allows the data to pass through quickly from processing to rendering. § Flexible .NET API The extensive ActiveReports 7 API allows Visual Basic and C# developers to completely control the report processing engine to fit their needs. Events and properties control: § Data retrieval § Data transformation § Layout § Rendering In addition, the API gives the developer complete control over the rendered document to allow selective printing or export, post-render drawing or stamping on pages, n-page, and booklet printing. For added control, ActiveReports 7 provides unmanaged access to the print job, allowing tray selection and duplex printer management as the document is rendered to the printer. § Data Visualization and Layout Whether you need a simple listing or groups with keep-together control, master-detail reports, sub-reports, horizontal and vertical multi-column reports, address labels and badges, or richly formatted letters with mail merge support, ActiveReports is the solution. Simple and lightweight report controls allow you to easily create dazzling reports. With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a wide range of business reports. You can create reports of any size with nearly endless layout options. § Rich Data Binding .NET data sources allow you to connect to any of the standard databases, plus .NET in-memory objects and collections. In addition, unbound data mode opens up the report to data from anywhere, in any form. If your application can access it, so can the report engine. § Visual Studio Integrated Design Time The ActiveReports 7 report designer integrates with the Microsoft Visual Studio IDE allowing C# and Visual Basic developers to create reports and compile them into their Windows Forms, ASP.NET, and Silverlight applications. ActiveReports Professional Edition users can also use the royalty-free end-user report designer control to give similar report design functionality to end users within the business application. § Cross-platform Support ActiveReports 7 offers versatile viewers to extend the reach of your reports to every platform. Built-in report viewers include Windows Forms, Adobe Flash, Microsoft Silverlight, and a rich HTML viewer, all with built-in search functions, hyperlink interaction, a table of contents, and multi-page zoom view support. ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over the exported documents and their properties. The ActiveReports reporting engine supports cloud computing on Microsoft's Windows Azure platform under partial trust as well as full trust. § Support for Migration from Other Reporting Tools ActiveReports 7 helps you preserve your past investments with easy report conversion from Microsoft Access and SAP Crystal Reports, thus greatly reducing the effort involved in recreating old reports when you migrate. No need to start from scratch! § Global Options and Localization Support Localize the ActiveReports user interface to meet the needs of all of your international users. (There are fully localized Chinese and Japanese versions for those specific markets.) Localization also extends to the reports themselves: the reporting engine can use locale-specific text and formatting without creating multiple reports. § Deployment ActiveReports 7 uses XCOPY deployment, making installation of your applications incredibly simple. There are no special merge modules to include, no licensing servers to install alongside your application, and no onerous activation procedures to go through.
ComponentOne 2012 V2 ActiveReports 7 ar7.zip ActiveReports 7 共三个压缩分卷,请全部下载后解压 Award-winning .NET reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an end-user Report Designer, Visual Studio integration, and more. The Preferred .NET Reporting Component with Pure Power See What's New in the ActiveReports 7 Release! Award-winning .NET Reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an End-User Report Designer, Visual Studio integration, and more. ActiveReports 7 brings Microsoft .NET developers everything from familiar Visual Studio integrated designers to extensive APIs. Create reports ranging in functionality from form-based reports such as invoices and insurance documents, to transaction reports such as sales and accounting, to analytical reports such as sales and budget analysis and portfolio analysis. Why Choose ActiveReports 7? § Multiple Report Types to Fit Your Reporting Needs § Fixed Page Layout gives developers a new way of creating reports where layout is the primary focus. Great for creating invoices, prospectus reports, forms, or other highly structured reports. § Continuous Page Layout makes it easy to create reports using tables, crosstabs, charts, and other data regions with flexible layouts. § Section-based Reports follow the tradition of previous ActiveReports versions as well as being similar to Access reports. Using code-behind or scripts, you can respond to the various events that occur while the report generates to create extremely customized reports that are hard to produce with other products. § Fast .NET Reporting Engine ActiveReports 7 is optimized for speed. Its unique architecture allows the lean reporting engine to quickly read records from the data source and immediately render them to the output device. The simplicity of the design allows the data to pass through quickly from processing to rendering. § Flexible .NET API The extensive ActiveReports 7 API allows Visual Basic and C# developers to completely control the report processing engine to fit their needs. Events and properties control: § Data retrieval § Data transformation § Layout § Rendering In addition, the API gives the developer complete control over the rendered document to allow selective printing or export, post-render drawing or stamping on pages, n-page, and booklet printing. For added control, ActiveReports 7 provides unmanaged access to the print job, allowing tray selection and duplex printer management as the document is rendered to the printer. § Data Visualization and Layout Whether you need a simple listing or groups with keep-together control, master-detail reports, sub-reports, horizontal and vertical multi-column reports, address labels and badges, or richly formatted letters with mail merge support, ActiveReports is the solution. Simple and lightweight report controls allow you to easily create dazzling reports. With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a wide range of business reports. You can create reports of any size with nearly endless layout options. § Rich Data Binding .NET data sources allow you to connect to any of the standard databases, plus .NET in-memory objects and collections. In addition, unbound data mode opens up the report to data from anywhere, in any form. If your application can access it, so can the report engine. § Visual Studio Integrated Design Time The ActiveReports 7 report designer integrates with the Microsoft Visual Studio IDE allowing C# and Visual Basic developers to create reports and compile them into their Windows Forms, ASP.NET, and Silverlight applications. ActiveReports Professional Edition users can also use the royalty-free end-user report designer control to give similar report design functionality to end users within the business application. § Cross-platform Support ActiveReports 7 offers versatile viewers to extend the reach of your reports to every platform. Built-in report viewers include Windows Forms, Adobe Flash, Microsoft Silverlight, and a rich HTML viewer, all with built-in search functions, hyperlink interaction, a table of contents, and multi-page zoom view support. ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over the exported documents and their properties. The ActiveReports reporting engine supports cloud computing on Microsoft's Windows Azure platform under partial trust as well as full trust. § Support for Migration from Other Reporting Tools ActiveReports 7 helps you preserve your past investments with easy report conversion from Microsoft Access and SAP Crystal Reports, thus greatly reducing the effort involved in recreating old reports when you migrate. No need to start from scratch! § Global Options and Localization Support Localize the ActiveReports user interface to meet the needs of all of your international users. (There are fully localized Chinese and Japanese versions for those specific markets.) Localization also extends to the reports themselves: the reporting engine can use locale-specific text and formatting without creating multiple reports. § Deployment ActiveReports 7 uses XCOPY deployment, making installation of your applications incredibly simple. There are no special merge modules to include, no licensing servers to install alongside your application, and no onerous activation procedures to go through.
ComponentOne 2012 V2 ActiveReports 7 ar7.zip ActiveReports 7 共三个压缩分卷,请全部下载后解压 Award-winning .NET reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an end-user Report Designer, Visual Studio integration, and more. The Preferred .NET Reporting Component with Pure Power See What's New in the ActiveReports 7 Release! Award-winning .NET Reporting tool for Silverlight, Windows Forms, ASP.NET, and Windows Azure with an End-User Report Designer, Visual Studio integration, and more. ActiveReports 7 brings Microsoft .NET developers everything from familiar Visual Studio integrated designers to extensive APIs. Create reports ranging in functionality from form-based reports such as invoices and insurance documents, to transaction reports such as sales and accounting, to analytical reports such as sales and budget analysis and portfolio analysis. Why Choose ActiveReports 7? § Multiple Report Types to Fit Your Reporting Needs § Fixed Page Layout gives developers a new way of creating reports where layout is the primary focus. Great for creating invoices, prospectus reports, forms, or other highly structured reports. § Continuous Page Layout makes it easy to create reports using tables, crosstabs, charts, and other data regions with flexible layouts. § Section-based Reports follow the tradition of previous ActiveReports versions as well as being similar to Access reports. Using code-behind or scripts, you can respond to the various events that occur while the report generates to create extremely customized reports that are hard to produce with other products. § Fast .NET Reporting Engine ActiveReports 7 is optimized for speed. Its unique architecture allows the lean reporting engine to quickly read records from the data source and immediately render them to the output device. The simplicity of the design allows the data to pass through quickly from processing to rendering. § Flexible .NET API The extensive ActiveReports 7 API allows Visual Basic and C# developers to completely control the report processing engine to fit their needs. Events and properties control: § Data retrieval § Data transformation § Layout § Rendering In addition, the API gives the developer complete control over the rendered document to allow selective printing or export, post-render drawing or stamping on pages, n-page, and booklet printing. For added control, ActiveReports 7 provides unmanaged access to the print job, allowing tray selection and duplex printer management as the document is rendered to the printer. § Data Visualization and Layout Whether you need a simple listing or groups with keep-together control, master-detail reports, sub-reports, horizontal and vertical multi-column reports, address labels and badges, or richly formatted letters with mail merge support, ActiveReports is the solution. Simple and lightweight report controls allow you to easily create dazzling reports. With a selection including textbox, checkbox, line, shape, cross-section box, image, formatted text with mail merge, barcode (2D and 3D), chart, and other data visualization controls, they support a wide range of business reports. You can create reports of any size with nearly endless layout options. § Rich Data Binding .NET data sources allow you to connect to any of the standard databases, plus .NET in-memory objects and collections. In addition, unbound data mode opens up the report to data from anywhere, in any form. If your application can access it, so can the report engine. § Visual Studio Integrated Design Time The ActiveReports 7 report designer integrates with the Microsoft Visual Studio IDE allowing C# and Visual Basic developers to create reports and compile them into their Windows Forms, ASP.NET, and Silverlight applications. ActiveReports Professional Edition users can also use the royalty-free end-user report designer control to give similar report design functionality to end users within the business application. § Cross-platform Support ActiveReports 7 offers versatile viewers to extend the reach of your reports to every platform. Built-in report viewers include Windows Forms, Adobe Flash, Microsoft Silverlight, and a rich HTML viewer, all with built-in search functions, hyperlink interaction, a table of contents, and multi-page zoom view support. ActiveReports includes Adobe PDF export with advanced encryption and international font support, Microsoft Excel export, and Rich Text Format (RTF) export. The extensive API allows fine control over the exported documents and their properties. The ActiveReports reporting engine supports cloud computing on Microsoft's Windows Azure platform under partial trust as well as full trust. § Support for Migration from Other Reporting Tools ActiveReports 7 helps you preserve your past investments with easy report conversion from Microsoft Access and SAP Crystal Reports, thus greatly reducing the effort involved in recreating old reports when you migrate. No need to start from scratch! § Global Options and Localization Support Localize the ActiveReports user interface to meet the needs of all of your international users. (There are fully localized Chinese and Japanese versions for those specific markets.) Localization also extends to the reports themselves: the reporting engine can use locale-specific text and formatting without creating multiple reports. § Deployment ActiveReports 7 uses XCOPY deployment, making installation of your applications incredibly simple. There are no special merge modules to include, no licensing servers to install alongside your application, and no onerous activation procedures to go through. ActiveReports
ComponentOne Studio for WinRT XAML2012 v3 Powerful WinRT XAML controls for building better Windows Store apps. Powerful UI and Data Visualization Controls for the Windows Store Get UI controls for data visualization, layout, input, and more inside ComponentOne Studio® for WinRT XAML. Based off our popular Silverlight controls and designed to enhance the rich user experience of the WinRT platform, these controls give you powerful and unique functionality to help you build better and more compelling Windows Store apps. What's Inside? Calendar Chart PdfViewer Why Choose Studio for WinRT XAML? Consistent Windows 8 Themes Studio for WinRT XAML supports the Modern UI design and interaction guidelines specified by Microsoft. By default, each control supports a consistent Windows Store theme and can inherit the dark or light theme set by the user. Deliver uniform apps across devices with confidence. Filling the Gaps of WinRT Studio for WinRT XAML provides many controls and features missing from WinRT, such as date/time pickers, calendars, data visualization, layout panels, masked text and numeric input. Stunning and Powerful Data Visualization With 30+ chart types, flexible data binding, run-time interaction, rich styling capabilities, and so much more, Chart for WinRT XAML is the most advanced charting control on the market. Apply styles, animations, markers and live updates to bring your dashboards to life! Edit Tabular Data Only with the legendary ComponentOne FlexGrid control can you get tabular data editing for the Windows Store. Display data records across columns and down rows with this simple, yet powerful grid control. View Documents and Reports Add document viewing capabilities to your Windows Store apps. PdfViewer for WinRT XAML can display PDF documents within your applications without requiring any external application. Load arbitrary PDF documents with support for page navigation and zooming. MVVM Support Customize the controls in your preferred method: XAML, C# or VB.NET code-behind, or both. Use the latest presentation model or MVVM (Model-View-ViewModel) design patterns in your applications with confidence. Each control supports dependency properties, complete XAML configuration and WPF data-binding techniques. Reuse Your Code Leverage your WPF, Silverlight and Windows Phone knowledge to build modern applications for Windows 8. Studio for WinRT XAML controls share the same codebase as our other XAML studios so they have similar feature sets and APIs. Reuse your code and XAML and save development time. Weekly Updates Studio for WinRT XAML has three major updates each year that includes major changes and new features. Between each major release you can get access to weekly hot-fixes that address bugs reported by users. With ComponentOne you don't have to wait for months to get your issues addressed.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值