Odoo架构

阅读(332) 最后更新: 2019年1月25日 06:38

上一页 基本概念 | Odoo社区与Odoo企业 下一页

翻译进度 100%

自助翻译

Odoo采用多层体系结构,我们可以识别三个主要层-数据、逻辑和表示:数据层是最底层,负责数据存储和持久化。
Odoo follows a multi-tier architecture, and we can identify three main tiers—data, logic, and presentation: The Data Tier is the lowest-level layer, and is responsible for data storage and persistence.
Odoo在这方面依赖于PostgreSQL服务器,PostgreSQL是唯一受支持的数据库服务器,这是一种设计选择,因此不支持MySQL等其他数据库。
Odoo relies on a PostgreSQL server for this.PostgreSQL is the only supported database server, and this is a design choice.So, other databases such as MySQL are not supported.
二进制文件,例如文档或图像的附件,通常存储在文件系统中的一个称为filestore的目录中。
Binary files, such as attachments of documents or images, are usually stored in the filesystem, in a directory referred to as the filestore.
这意味着Odoo实例的完整备份既需要数据库转储,也需要文件副本。
This means that a full backup of an Odoo instance needs both a database dump and a copy of the filestore.
逻辑层负责与数据层的所有交互,并由Odoo服务器处理。作为一般规则,低级数据库只能由该层访问,因为它是确保安全访问控制和数据一致性的唯一方法。我们有这个接口的对象-关系映射(ORM)引擎,ORM提供了插件模块用来与数据交互的应用程序编程接口(API)。
The Logic Tier is responsible for all the interactions with the data layer, and is handled by the Odoo server.As a general rule, the low-level database should only be accessed by this layer, since it is the only way to ensure security access control and data consistency.At the core of the Odoo server, we have the object-relational mapping (ORM) engine for this interface.The ORM provides the application programming interface (API) used by the add-on modules to interact with the data.
例如,客户或供应商等合作伙伴数据实体在ORM中由模型表示。该模型是一个Python对象类,支持几种交互方法,例如CREATE()来创建新的合作伙伴记录,或者READ()用于查询现有记录及其数据。这些通用方法可以实现特定的业务逻辑,特别是模型。create()方法可能实现默认值或强制执行验证规则;read()方法可能支持某些自动计算的字段,或者根据执行该操作的用户强制执行访问控制。
For example, the partner data entity, such as a customer or a supplier, is represented in the ORM by a model.This model is a Python object class supporting several interaction methods, such as create() to create new partner records, or read() to query existing records and their data.These generic methods can implement specific business logic in particular models.For example, the create() method might implement default values or enforce validation rules; the read() method might support some automatically computed fields, or enforce access controls depending on the user performing that action.
表示层负责提供数据和与用户交互。它由负责所有用户体验的客户端实现。客户端与ORMAPI交互,通过远程过程调用(RPC)调用ORMAPI方法,读取、写入、验证或执行任何其他操作。这些操作被发送到Odoo服务器进行处理。然后将结果发送回客户端以供进一步处理。
The Presentation Tier is responsible for presenting data and interacting with the user.It is implemented by a client responsible for all the user experience.The client interacts with the ORM API to read, write, verify, or perform any other action, calling ORM API methods through remote procedure calls (RPCs).These are sent to the Odoo server for processing, and then the results are sent back to the client for further handling.
对于表示层,odoo提供了一个功能齐全的Web客户端,它支持业务应用程序所需的所有功能:登录会话、导航菜单、数据列表、表单等等。全局外观和感觉并不像前端开发人员所期望的那样可定制,但它使创建功能和一致的用户体验变得更加容易。
For the Presentation Tier, Odoo provides a full-featured web client out of the box.The web client supports all the features needed by a business application: login sessions, navigation menus, data lists, forms, and so on.The global look and feel are not as customizable as a frontend developer might expect, but it makes it easy to create a functional and consistent user experience.
一个互补的表示层包括网站框架,它提供了与其他CMS框架相同的用户界面创建网页的充分灵活性,而牺牲了一些额外的工作和网络经验。网站框架支持Web控制器实现用于表示特定逻辑的代码。将它与模型的内在逻辑分开,前端开发人员可能会在这个空间感到非常自在。
A complementary presentation layer includes the website framework.It gives full flexibility to create web pages with the exact user interface intended, like in other CMS frameworks, at the expense of some additional effort and web expertise.The website framework supports web controllers to implement code for presenting specific logic, keeping it separate from the model's intrinsic logic.Frontend developers will probably feel very much at home in this space.
Odoo服务器API非常开放,所有服务器功能都可以通过它获得。官方Web客户端使用的服务器API与任何其他应用程序使用的服务器API是一样的。因此,其他客户端实现是可能的,可以在几乎任何平台或编程语言中构建。桌面和智能手机应用程序可以构建来提供特定的用户界面。利用Odoo数据和逻辑层进行业务逻辑和数据持久性。
The Odoo server API is very open, and all server functions are available through it.The server API used by the official web client is the same as the one available to any other application.So, other client implementations are possible, and could be built in almost any platform or programming language.Desktop and smartphone applications can be built to provide specific user interfaces, leveraging the Odoo data and logic tiers for business logic and data persistence.

odoo技术交流2 群号 625337975

http://www.odoogo.com/post/58/Odoo开发视频教程

文档不断更新中,添加微信odoogo,获取最新视频课程和模块

留言提问