ROCA Resource-oriented Client Architecture
A collection of simple recommendations for decent Web application frontends
Introduction
A Web application's architecture is heavily influenced by the design decisions, both implicit and explicit, that have been made by framework developers. Sometimes these decisions are consciously accepted as being in line with the intended overall system architecture. More often, though, they are accepted simply because developers assume they embody the state of the art of development practices.
ROCA is an attempt to define a set of recommendations — independent of any particular framework, programming language, or tooling — that embodies the principles of what we consider to be good web application architecture. Its purpose is to serve as a reference, one that can be implemented as-is or be compared to other approaches to highlight diverging design decisions.
ROCA splits into two parts: The server-side and the client-side architecture. The server-side consists of RESTful backends, serving human-readable content as well as services for machine-to-machine communication, either public or internal. The client-side focuses on a sustainable and maintainable usage of JavaScript and CSS, based on the principle of Progressive Enhancement. This technique is pursued by nearly every basic web technology, e.g. HTML or HTTP. Client and server are largely independent from, yet complement each other.
Server-side
- The server application adheres to REST principles, i.e. it exposes a set of resources that are meaningful to a user sitting in front of a browser, each resource has its own URI, all of the information necessary for handling a request is contained within the request itself, HTTP methods are used in line with their definition, and the resource state is maintained by the server (stateless communication). [rest]
- All application logic resides on the server. [application-logic]
- The client interacts with the server through RESTful HTTP requests. [http]
- A user must be able to link to a specific piece of information, e.g. by copying the address from the browser's address bar and pasting it into an e-mail, creating a bookmark, or using any of the fancier ways to share URIs. [link]
- It must be possible to use the server's logic through user agents other than a browser, e.g. a command-line client such as curl or wget. [non-browser]
- Resources have additional representations in other formats, e.g. JSON and/or XML. [should-formats]
- All authenticated communication relies on HTTP Basic or Digest Authentication, typically combined with SSL, possibly with client certificates. Alternatively, because of the limits of browser-native authentication (e.g. no logout, no styling), form-based authentication in conjunction with cookies can be used. If cookies are used, they should include all of the state needed for the server to process them, and another authentication mechanism should be supported for non-browser access. [auth]
- Cookies may not be used for purposes other than authentication or user tracking. [cookies]
- There may not be any session state beyond what’s needed for simple algorithmic validation of authentication information. [session]
- The browser controls like the back, forward and refresh buttons must work as expected. I.e. the back button should take the users where they expect to be taken to (the last meaningful resource they worked with). A browser refresh should not cause a re-rendering of the login or home page instead of the page the user was looking at, or a (to the user) unexpected question about wanting to submit the same data again (when the user doesn't recall submitting any data, indicating a mis-use of the POST verb). [browser-controls]
Client-side
- The server returns structured semantic HTML markup that is independent of layout information and client behavior. [posh]
- It must be possible to access each page's information and functionality by using accessibility tools like screen readers. [accessibility]
- CSS is used for formatting and layout. This is done following the principles of progressive enhancement, e.g. to allow a browser not capable of CSS3 features still to use a CSS3-based site.
- In line with the principles of progressive enhancement, JavaScript is used unobtrusively and the application remains usable (albeit with a decrease in usability and convenience) if JavaScript is disabled. [unobtrusive-javascript]
- The same functionality must not be implemented redundantly on both the client (JavaScript) and the server. Thus, due to the application logic requirement, application logic must not reside on the client-side. [no-duplication]
- The server code may not "know" the HTML structures the client code generates (beyond CSS) or vice versa. Exceptions are some well defined HTML structures the server generates to initialize the client functionality above. [know-structure]
- All JavaScript code and CSS code must be static, and must not be dynamically generated by the server in a form specific to the resource requested. (Note that this does not prohibit the use of preprocessors like CoffeeScript or LESS, as the respective code is usually pre-compiled as part of the release process.) [static-assets]
- Any dynamic routing or URI state modification triggered by JavaScript on the client side should use the HTML5 History API. [historyapi]
相关推荐
资源分类:Python库 所属语言:Python 资源全名:roca-detect-1.2.8.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源分类:Python库 所属语言:Python 资源全名:roca-detect-1.0.9.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
"JoseRoca's Powerbasic最新头文件 WINAPI_III_1_03"是一个由用户Jose Roca创建的资源,它包含了用于在PowerBasic中调用WinAPI函数的头文件。 这个头文件集合对于使用PowerBasic的开发者来说极其重要,因为它提供了...
关于是一个小型演示应用程序,它向最终用户和开发人员展示了 的好处。 它建立在初始选座演示并提供了其他示例,说明如何基于渐进增强原则实现客户端验证、AJAX 调用或组件间通信等功能。 由创建,但基于全球网络拥护...
java语言ssh项目源码ROCA检测工具 该工具与 . 它使您能够测试公共 RSA 密钥是否存在所描述的漏洞。 2017 年 11 月 4日更新:支持 Python 2.7、3.4+。 2017 年 10 月 30 日更新:攻击已经上线,。 2017 年 10 月 30 ...
开发者GuillemÁlavaBurgueño( )-线索Sergi Colomer Ferrer( )-程序员/支持Abraham ( )-设计师/支持Aram Galarza Roca( )-设计师/程序员David Montufo Montero( )-质量检查/程序员Arnau Lucena Cobo( )...
【PowerBASIC入门教程(第一部分)】 PowerBASIC是一种高级编程语言编译器,专为熟悉BASIC语法的程序员设计,用于创建高效、小型的动态链接库(DLLs)和可执行程序(EXEs)。它允许开发者充分利用Windows API,构建各种...
- Roca - 等等。 - 这些厂商总共占据了大约 58% 的市场份额。 ### 4. 主要生产商介绍 - **科勒(KOHLER)**:这是一家历史悠久的美国卫浴品牌,以其高品质、高工艺水平和多样化的设计风格而闻名。 - **东陶...
入门安装依赖 $ pip install flask $ npm install设置第三方资产 $ npm run assets编译JavaScript模块 $ npm run dist # alternatively, watch file system changes and recompile automatically $ npm run dev-css ...
van Sark、Lars Korte和Francesco Roca等专家编写,他们分别来自乌得勒支大学、赫尔姆霍兹柏林材料与能源中心以及意大利国家新技术、能源和可持续经济发展署。这三位博士在太阳能电池的物理和技术领域拥有深厚的...
Roca(诺卡)是一家知名的门锁制造商,其产品在宾馆行业广泛应用。下面将详细阐述电子门锁接口、门锁软件、Roca门锁以及宾馆门锁接口的相关知识点。 首先,电子门锁接口是门锁系统的核心组成部分,它定义了一系列...
Roca公司通过CFD模拟优化马桶设计,提高用户体验。在汽车行业,CFD广泛用于降低风阻,提升新能源汽车的性能。此外,就连混凝土搅拌车的搅拌效率,也能通过CFD进行改进。 总的来说,《无痛苦N-S方程笔记》提供了一个...
- **主要企业**:包括Kohler、American Standard、Roca、Duravit和TOTO等。这些企业在技术研发、产品设计、生产制造等方面不断创新,提升产品品质和竞争力。 - **市场策略**:通过优化供应链管理、拓展销售渠道等...
用仿射映射逐层投影,生成目标曲面,提出基于Roca算法的内部节点定位的新算法,运用由外向内推进的波前法思想,生成全部的六面体网格。通过实例表明,该算法快速,稳定,可靠,可处理大量复杂2.5维实体六面体网格...
Sakae Yamamura写的,出版社Bosa Roca, United States,高清英文原版扫描。
Soft computing and nature-inspired computing both play a significant role in developing a better understanding to machine learning. When studied together, they can offer new perspectives on the ...
- **ROCA**:西班牙著名品牌,产品覆盖全球多个国家和地区。 - **Villeroy & Boch**:德国高端卫浴品牌,以其优雅的设计著称。 - **Kohler**:美国知名卫浴品牌,提供多样化的卫浴解决方案。 - **Hocheng ...
巴塞罗那是当时最强大的足球队伍,以其技术和艺术性的足球风格著称,而乐家ROCA,作为全球知名的卫浴品牌,同样以其卓越的设计和环保理念脱颖而出。乐家的产品不仅追求美学,而且注重节水节能,与巴塞罗那资助儿童...
例如,Dongpengjieju、Aosman、HEGII、WDI、MKW Pressalit、A/S HUIDA、JOMOO、Roca、R&T、Villeroy & Boch、GEBERIT、Hamberger Sanitary、Kohler、BEMIS、Panasonic、Lixil和TOTO等企业,通过不断提升产品质量、...