REST 阅读 (1) - Software Architecture

本文介绍了Representational State Transfer (REST) 架构风格的关键概念及其在现代Web软件设计中的应用。REST强调组件交互的伸缩性、接口的通用性和组件开发的独立性。文章详细讨论了REST的约束条件和组成要素,包括资源、资源标识符和表现形式。
Representational State Transfer (REST)

[color=blue][b]REST Constraints[/b][/color]

Null -> Client-Server -> client-stateless-server ->
client-cache-stateless-server -> Uniform-client-cache-stateless-server ->
Uniform-Layered-client-cache-stateless-server ->
code-on-demand(optional) - Uniform-Layered-client-cache-stateless-server

[color=blue][b]REST Architectural Elements[/b][/color]

[b]Data Elements[/b]

resource ------------------ the intended conceptual target of a hypertext reference
resource identifier ----------------- URL, URN
representation ---------------------- HTML document, JPEG image
representation metadata media type -- last-modified time
resource metadata ------------------- source link, alternates, vary
control data ------------------------ if-modified-since, cache-control

架构样式和基于网络的软件架构的设计

Roy Thomas Fielding


摘 要


万维网(WWW)已经取得很大的成功,因为它的架构设计满足了互联网级别的分布式超媒体系统的需求。Web已被迭代式的开发了十几年,对定义其架构的标准进行了一系列的修改。为了识别需要修改的和不需要修改的哪些方面,我们需要一种现在web架构模型来引导它的设计、定义和开发。

软件架构的研究寻找了很多方法来决定怎样最优地划分系统,组件彼此如何识别和通信,信息如何沟通,系统元素如何独立进化,以及上面这些问题如何通过正式的和非正式的概念描述。受这种需求的驱动,我的工作就是要利用一些原则上的约束来理解和评估基于网络的软件架构,从而期望满足该架构的功能、性能和社会的需求。一种架构样式是一种有名字的和一组架构约束等价的概念。

本文定义了一种通过架构样式来理解基于网络的软件架构的框架,并阐述了该样式是如何引导基于网络的软件架构的设计的。我对基于网络的软件架构的样式进行了调查研究,并根据他们的促进分布式超媒体架构的属性对他们进行分析。然后我就引入了REST样式,并解释该样式是如何引导现代web软件架构的设计何开发的。

REST强调组件交互的伸缩性,接口的通用性,组件开发的独立性,减少交互时间的中间组件,增强安全,兼容遗留系统。

1. Software Architecture
1.1 Run-time Abstraction
A software architecture is an abstraction of the run-time elements of a software system during some phase of its operation. A system may be composed of many levels of abstraction and many phases of operation, each with its own software architecture.

Therefore, architectural design and source code structural design, though closely related, are separate design activities.
1.2 Elements
A software architecture is defined by a configuration of architectural elements—components, connectors, and data—constrained in their relationships in order to achieve a desired set of architectural properties.
1.2.1 Components
A component is an abstract unit of software instructions and internal state that provides a transformation of data via its interface.

Example transformations include loading into memory from secondary storage, performing some calculation, translating to a different format, encapsulation with other data, etc.

A component is defined by its interface and the services it provides to other components, rather than by its implementation behind the interface.
1.2.2 Connectors
A connector is an abstract mechanism that mediates communication, coordination, or cooperation among components.
Examples include shared representations, remote procedure calls, message-passing protocols, and data streams.

Connectors enable communication between components by transferring data elements from one interface to another without changing the data.
1.2.3 Data
A datum is an element of information that is transferred from a component, or received by a component, via a connector.

Examples include byte-sequences, messages, marshaled parameters, and serialized objects, but do not include information that is permanently resident or hidden within a component.

The nature of the data elements within a network-based application architecture will often determine whether or not a given architectural style is appropriate.
1.3 Configurations
A configuration is the structure of architectural relationships among components, connectors, and data during a period of system run-time.
Strictly speaking, one might think of a configuration as being equivalent to a set of specific constraints on component interaction.
1.4 Properties
The set of architectural properties of a software architecture includes all properties that derive from the selection and arrangement of components, connectors, and data within the system. Examples include both the functional properties achieved by the system and non-functional properties, such as relative ease of evolution, reusability of components, efficiency, and dynamic extensibility, often referred to as quality attributes.
1.5 Styles
An architectural style is a coordinated set of architectural constraints that restricts the roles/features of architectural elements and the allowed relationships among those elements within any architecture that conforms to that style.
1.6 Patterns and Pattern Languages

1.7 Views
An architectural viewpoint is often application-specific and varies widely based on the application domain. ... we have seen architectural viewpoints that address a variety of issues, including: temporal issues, state and control approaches, data representation, transaction life cycle, security safeguards, and peak demand and graceful degradation. No doubt there are many more possible viewpoints.
A process view emphasizes the data flow through the components and some aspects of the connections among the components with respect to the data. A data view emphasizes the processing flow, with less emphasis on the connectors. A connection view emphasizes the relationship between components and the state of communication.
Chapter 1, Principles of Software Architecture, introduces the topic of software architecture, giving you a brief on architectural quality attributes and the general principles behind them. This will enable you to have strong fundamentals in software architectural principles and foundational attributes. Chapter 2, Writing Modifiable and Readable Code, covers developmental architectural quality attributes, namely, modifiability and readability. It will help you gain an understanding of the architectural quality attribute of maintainability and tactics of writing code in Python to test your applications. Chapter 3, Testability Writing Testable Code, helps you understand the architectural quality attribute of testability and how to architect Python applications for testability. You will also learn about various aspects of testability and software testing and the different libraries and modules available in Python to write testable applications. Chapter 4, Good Performance is Rewarding!, covers the performance aspects of writing Python code. You will be equipped with the knowledge of performance as a quality attribute in architecture and when to optimize for performance. You will learn when to optimize for performance in the SDLC. Chapter 5, Writing Applications that Scale, talks about the importance of writing scalable applications. It discusses different ways to achieve of application scalability and discusses scalability techniques using Python. You will also learn about theoretical aspects of scalability and the best practices in the industry. Chapter 6, Security Writing Secure Code, discusses the security aspect of architecture and teaches you best practices and techniques of writing applications that are secure. You will understand the different security issues to watch out for and to and to architecture applications in Python that are secure from the ground up. Chapter 7, Design Patterns in Python, gives you an overview of design patterns in Python from a pragmatic programmer's perspective, with brief theorotical background of each pattern. You will gain knowledge of design patterns in Python that are actually useful to pragmatic programmer. Chapter 8, Python Architectural Patterns – The Pythonic Approach, introduces you to the modern architectural patterns in Python from a high-level perspective while giving examples of Python libraries and frameworks to realize the approaches of these patterns to solve high-level architecture problems. Chapter 9, Deploying Applications with Python – Devops with Python, covers the aspect of easily deploying your code on remote environments or on the cloud using Python the right way. Chapter 10, Techniques for Debugging, covers some of the debugging techniques for Python code––from the simplest, strategically placed print statement to logging and system call tracing which will be very handy to the programmer and also help the system architect to guide his team.
Software Architecture with Python by Anand Balachandran Pillai English | 28 Apr. 2017 | ASIN: B01IF7NLI2 | 556 Pages | AZW3 | 12.29 MB Key Features Identify design issues and make the necessary adjustments to achieve improved performance Understand practical architectural quality attributes from the perspective of a practicing engineer and architect using Python Gain knowledge of architectural principles and how they can be used to provide accountability and rationale for architectural decisions Book Description This book starts off by explaining how Python fits into an application architecture. As you move along, you will understand the architecturally significant demands and how to determine them. Later, you'll get a complete understanding of the different architectural quality requirements that help an architect to build a product that satisfies business needs, such as maintainability/reusability, testability, scalability, performance, usability, and security. You will use various techniques such as incorporating DevOps, Continuous Integration, and more to make your application robust. You will understand when and when not to use object orientation in your applications. You will be able to think of the future and design applications that can scale proportionally to the growing business. The focus is on building the business logic based on the business process documentation and which frameworks are to be used when. We also cover some important patterns that are to be taken into account while solving design problems as well as those in relatively new domains such as the Cloud. This book will help you understand the ins and outs of Python so that you can make those critical design decisions that not just live up to but also surpass the expectations of your clients. What you will learn Build programs with the right architectural attributes Use Enterprise Architectural Patterns to solve scalable problems on the Web Understand design patterns from a Python pers
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值