centos 初学者

All rights to their respective owners.
各自所有者的所有权利。

A quick skim of Google search results won’t shed much light on what exactly is the “single source of truth” — or the SSOT. Wikipedia defines it as, “the practice of structuring information models and associated data schema such that every data element is mastered in only one place.” If your reaction was along the lines of, “Wait, what?” then you’re not alone. As a software engineering student, when I first heard this term, I thought it sounded more like a line from a Sci-Fi/Fantasy book series than a computer science concept. It was only until I put this into practice when learning about tables and object associations in Ruby, that I understood why this concept is so crucial.

快速浏览一下Google搜索结果不会对“单一真相”或SSOT到底有多大的了解。 维基百科将其定义为“构造信息模型和相关数据模式的实践,这样每个数据元素都只能在一个地方掌握。 ”如果您的React是“等等,那是什么?” 那么你并不孤单。 作为软件工程专业的学生,​​当我第一次听到这个词时,我认为它听起来更像是科幻/奇幻小说系列的一句话,而不是计算机科学的概念。 直到我在学习Ruby中的表和对象关联时将其付诸实践,我才理解为什么这个概念如此重要。

First, it’s important to clarify that SSOT is an overarching computer science term and can be applied towards many languages. I’ll only concentrate on Ruby for purposes of this article. Using an object-oriented programming language, we (aspiring) engineers and developers build objects (or things, whichever is easier to understand) by first considering what the intended use is, and then by how it interacts with different objects.

首先,重要的是要弄清楚SSOT是计算机科学的一个主要术语,可以应用于多种语言。 就本文而言,我将仅关注Ruby。 我们(有抱负的)工程师和开发人员使用面向对象的编程语言来构建对象(或事物,以较容易理解的为准),方法是首先考虑预期的用途,然后考虑其与不同对象的交互方式。

Ok…can I get an example?

好吧...我可以举个例子吗?

Let’s use a hypothetical situation from Avatar: The Last Airbender, when Zuko (“Lee”) and Uncle Iroh (“Mushi”) open a tea shop in Ba Sing Se.

让我们使用《阿凡达》中的一个假设情况:《最后的气宗》,当祖科(“李”)和伊罗叔叔(“木石”)在巴星瑟开设一家茶店时。

Please excuse how uneven the arrows are. Images are not my own.
请原谅箭头的高度。 图片不是我自己的。

You would build a class called Shopkeeper and create the instances “Lee” and “Mushi”. Think of a class as a template — it wouldn’t be very time efficient to create a class for every individual object. These two shopkeepers own a tea shop, the Jasmine Dragon. The Jasmine Dragon is such a success that they have repeat customers. Likewise, you’d create a class Shop with the instance “Jasmine Dragon” and create the class Customer for their many repeat customers. It doesn’t matter if they have 5, 50, or even 500 customers. The shopkeepers know their customers and vice versa, because the tea shop is what links them. In Ruby, these three classes would each be their individual tables, and the tea shop is the single source of truth. They can interact with each other through this source.

您将构建一个名为Shopkeeper的类,并创建实例“ Lee”和“ Mushi”。 将类视为模板–为每个单独的对象创建类并不是很省时。 这两个店主拥有一家茶店,茉莉龙。 茉莉花龙(Jasmine Dragon)如此成功,以致他们拥有回头客。 同样,您将使用实例“ Jasmine Dragon”创建一个Shop类,并为他们的许多回头客创建Customer类。 他们有5个,50个甚至500个客户都没关系。 店主知道他们的顾客,反之亦然,因为茶店是联系他们的。 在Ruby中,这三个类分别是各自的表,而茶馆则是真理的唯一来源。 他们可以通过此来源相互交流。

What happens if we expand our number of classes?

如果我们增加课程数量会怎样?

Previously on Avatar, Aang and his friends travel to Chin Village where they are shocked to discover that not only is the Avatar not welcome, but in a previous life, Avatar Kyoshi allegedly killed their founder, Chin the Conqueror. Aang tries to make amends with the village but his attempts fail to win them over.

以前在阿凡达(Avatar)上,阿昂(Aang)和他的朋友们前往奇恩村(Chin Village),他们震惊地发现,不仅不欢迎阿凡达(Avatar),而且在前世,阿凡达(Avatar Kyoshi)据称杀害了其创始人“征服者奇恩(Chin the Conqueror)”。 阿昂(Aang)试图对村庄进行补偿,但他的努力未能赢得他们。

In this model, the Avatar and Villager are aware of one another and can interact. PastAvatar is needed, but cannot be accessed.
在此模型中,阿凡达和村民彼此了解并可以互动。 PastAvatar是必需的,但无法访问。

Eventually, he figures he needs to go directly to the source. Aang turns to Kyoshi, who confirms to both Aang and the villagers that she indirectly killed Chin (or as Kyoshi put it, “a horrible tyrant”), when she split the peninsula from his empire. Avatars Aang and Kyoshi are aware of each other, but the villagers are not aware of Kyoshi. Similarly, Kyoshi is unable to contact the villagers if not for the Avatar connection. The Avatar connection, in this example, is the single source of truth. Without the Avatar connection, Aang would have no way of knowing about Kyoshi’s presence, let alone getting the truth from Kyoshi, nor would Kyoshi be able to access Aang and speak directly to the villagers.

最终,他认为自己需要直接去找源头。 Aang求助于Kyoshi,她向Aang和村民证实,当她将半岛与帝国分开时,她间接杀害了Chin(或正如Kyoshi所说,是“可怕的暴君” )。 头像Aang和Kyoshi彼此了解,但村民们并不了解Kyoshi。 同样,如果没有Avatar连接,Kyoshi将无法与村民联系。 在此示例中,头像连接是事实的唯一来源。 没有阿凡达(Avatar)的联系,Aang将无法得知Kyoshi的身影,更不用说从Kyoshi那里获得真相了,而且Kyoshi也无法访问Aang并直接与村民交谈。

In this model, Past Avatar, Avatar, and Villager are aware of one another because the Avatar Connection exists.在此模型中,“过去头像”,“头像”和“村民”彼此了解,因为存在“头像连接”。

What’s the difference between a join table and a Single Source Of Truth?

联接表和单一真相之间有什么区别?

SSOT is a concept, and a join table is a method of how we would address relationships or associations in Ruby/Rails, in order to have a Single Source of Truth. There are likely many variations of this across programming languages.

SSOT是一个概念,而联接表是一种方法,我们可以通过它解决Ruby / Rails中的关系或关联,以使 真相。 跨编程语言,这可能会有很多变化。

Ok, but I still don’t get why it’s important.

好的,但是我仍然不明白为什么它很重要。

Here are a few reasons why understanding the Single Source of Truth is essential.

以下是为什么理解真理的单一来源至关重要的几个原因。

  1. Clarity. At some point, the classes in your code need to interact with each other and access certain attributes. As Mulesoft put it, your code and data don’t exist in silos. Understanding SSOT will make it clearer for you as you write your code and build more features. You’ll need to know whether or not to generate a new class or join table based on how your code interacts with what you’re intending to build.

    明晰。 在某些时候,代码中的类需要相互交互并访问某些属性。 正如Mulesoft所说,您的代码和数据并不孤岛。 了解SSOT将使您在编写代码和构建更多功能时更加清楚。 您将需要根据代码与您要构建的代码之间的交互方式来知道是否生成新类或联接表。

  2. Keeping your code DRY. If you’ve heard it once, you’ve heard it a thousand times. You don’t want repetitive code. Understanding SSOT will help you create methods and even improve your method’s efficiency in their classes so they can build upon one another other. It may not seem like a big deal with the few lines of code you’ve created locally, but imagine the implications when you’re dealing with much bigger batches of information.保持代码干燥。 如果您听过一次,则听过一千次。 您不需要重复的代码。 了解SSOT将有助于您创建方法,甚至可以提高方法在类中的效率,从而使它们可以彼此建立。 您在本地创建的几行代码看起来似乎没什么大不了的,但是请想象一下在处理大量信息时的含义。

演示地址

Single source of truth can be a confusing concept, especially when you’re starting your coding journey. When in doubt, think about how the classes you’re building interact with one another and if helpful, create or base it on an example (in my case, a story subplot). Even code needs to understand how it relates to one another.

单一事实来源可能是一个令人困惑的概念,尤其是在您开始编码之旅时。 如有疑问,请考虑您正在构建的类之间如何交互,如果有帮助,请基于示例(在我的情况下为故事子情节)创建或建立类。 甚至代码也需要理解它们之间的关系。

Sources:

资料来源:

What is a Single Source of Truth? by Mulesoft

什么是真理的单一来源? 由Mulesoft

Single Source of Truth by Wikipedia

维基百科的真相单一来源

翻译自: https://medium.com/swlh/single-source-of-truth-for-beginners-e3dae44877d5

centos 初学者


http://www.taodudu.cc/news/show-5605470.html

相关文章:

  • 元宇宙永远不会发生
  • js学习76-107
  • 推荐系统-知识图谱:KGRS(基于知识图谱的推荐系统)综述
  • 阿凡达变脸器,教你在线变脸(含网址及用法)
  • 电信的女小年青和阿凡达
  • java创建ee项目_项目头像–下一个Java EE功能?
  • AI阿凡达降临CES! 三星Neon聊天机器人竟然会学习、能进化、有记忆!
  • 如何换wordpress头像
  • 项目头像–下一个Java EE功能?
  • 阿凡达是脸,教你的脸在线(包括URL和使用)
  • 一种头像缓存策略
  • 【Python百日进阶-Web开发-Feffery】Day343 - fac数据展示01:AntdAvatar头像(阿凡达)
  • 怎么在水果音乐制作软件播放列表中排列样式
  • FL Studio 10.0.9 水果音乐制作软件 10.0.9
  • 水果音乐制作软件钢琴卷轴中的文件菜单怎么用
  • 水果音乐制作软件杂项设置页使用教程
  • 怎么在水果音乐制作软件中导出音频
  • 电脑备份iphone_如何在Linux上备份iPhone?
  • mac iphone 备份_PC或Mac上我的iPhone或iPad备份在哪里?
  • 我的天王心
  • 启用计算机无线网络连接,win10怎么打开无线网络连接_win10系统打开无线网络连接的教程-win7之家...
  • 【老米之家老域名课堂小知识】谁在管理域名?
  • 信安之家一周年纪念
  • 社团之家
  • 下载网络图片
  • linux 桥接网络不通,Centos 桥接网络连接不上方案
  • 一个神经网络模式识别的例子------螃蟹识别
  • opencart之加盟会员affiliate功能
  • 实现会员注册功能时如何通过qq邮箱获取验证码,从而验证登录? 详细步骤
  • 【3DMAX】教你如何在中秋建模出一个好看的月亮(最详细3DMAX教程)

centos 初学者_初学者的唯一真理来源相关推荐

  1. centos 初学者_初学者的时间序列

    centos 初学者 If you are walking the path of becoming a data scientist, you might have already come acr ...

  2. centos 初学者_初学者:如何在Outlook 2013中创建和管理任务

    centos 初学者 If you're one of those people who has a whiteboard or notepad with an ever-evolving to-do ...

  3. java 初学者_初学者:如何在Outlook 2013中创建,管理和共享日历

    java 初学者 Unless you're living a life free of responsibilities, the sun probably rises and settles on ...

  4. 程序代码初学者_初学者:如何使用热键在Windows中启动任何程序

    程序代码初学者 Assigning shortcut keys to launch programs in Windows is probably one of the oldest geek tri ...

  5. python初学者_初学者使用Python的完整介绍

    python初学者 A magical art of teaching a computer to perform a task is called computer programming. Pro ...

  6. android初学者_初学者:如何在Android设备上的打开的应用程序之间切换

    android初学者 When you run an app on your Android device, you can minimize it and return to the home sc ...

  7. 使用qt设计登录界面初学者_初学者素描:设计登录表单界面

    使用qt设计登录界面初学者 由Bohemian Coding的好伙伴制作的Sketch是界面设计的出色程序. 本入门级教程将向您介绍使用Sketch进行设计. 您将不需要任何程序经验,只需要一些空闲时 ...

  8. 动态瑜伽 静态瑜伽 初学者_初学者:如何在Mac OS X中设置静态IP

    动态瑜伽 静态瑜伽 初学者 When organizing your home or small office network sometimes it can be easier to assign ...

  9. 程序代码初学者_初学者极客:在Windows 7和Vista中设置默认程序

    程序代码初学者 If you've ever installed a program and suddenly found certain file types opening with it ins ...

最新文章

  1. M-point moving-average(M点滑动平均)Matlab 实现
  2. 2014年第五届蓝桥杯C/C++ A组国赛 —— 第二题:六角幻方
  3. Go 程序是怎样跑起来的
  4. 浙江师范大学python试卷_2014考研计算机真题试卷及答案(浙江师范大学考点)
  5. HDOJ--1269--迷宫城堡
  6. Nodejs的各种数据库驱动地址汇总
  7. css3优惠券的样式集合
  8. openwrt 添加usb网卡_【沙发管家】路由器USB接口的用处你真的了解么?
  9. 太牛X了,大四学生自创文言文编程语言,Hello World竟然这样写!?
  10. 数据库课程设计——人才市场管理系统、教学管理系统、产品销售管理系统、小区物业管理系统
  11. 如何获得大学教材的PDF版本?
  12. 上海计算机应用基础自考上机,上海市自学考试公共实践课程《计算机应用基础(实践)》上机考核大纲_自考资讯自考_自考报名_中国教育在线...
  13. python输出文本框_python如何使用文本框
  14. ubuntu加了张固态_UbuntuToGo——打造属于自己的移动固态热插拔Liniux操作系统
  15. 有米科技股份有限公司
  16. 【Android】二进制图片和Bitmap的getPixel方法解析
  17. 【拼多多】新手卖家的启蒙贴 ,如何快乐的做图,快乐的开店
  18. 移动UI设计-表单设计
  19. Web安全防攻(渗透测试)
  20. 阿里千万级实时监控系统技术揭秘TSDB时序业务场景

热门文章

  1. Python多线程爬取小说网站小说
  2. 饿了么同事拼单,单人价格计算JS 拼单小工具
  3. Flutter 创建第一个应用程序
  4. 再次了解max_allowed_packet
  5. 世界服装名牌各自的定位
  6. Python+Excel系列: 案例三:批量重命名一个工作薄中的所有工作表、批量重命名一个工作簿中的部分工作表
  7. 【Phaser】Phaser监听键盘WASD按下事件
  8. 行业门户网站、论坛的微信内容运营策划
  9. mysql查询语句题目_MySQL经典练习题及答案,常用SQL语句练习50题
  10. #435 津津有味:为了多活几年,人类终于对粗杂粮下手了