证券法律法规体系所有法律

    科技2022-08-01  93

    证券法律法规体系所有法律

    Software Architecture is getting too complicated…

    软件架构变得太复杂了……

    It is easy to look at all those design pattern books, and online articles about hexagonal architectures, or the cake pattern, or the onion architecture and get lost on how you are best able to design applications and services in a world driven by docker containers, edge computing and serverless architectures.

    您可以轻松阅读所有这些设计模式书籍 ,以及有关六角形架构或蛋糕图案或洋葱架构的在线文章,并迷失在由Docker容器驱动的世界中如何最好地设计应用程序和服务, 边缘计算和无服务器架构 。

    There must be a way to cut through all the noise and get to some core principles that have a more rigorous mathematical defense…

    必须有一种方法可以消除所有噪音,并获得一些具有更严格的数学防御能力的核心原理……

    This article is the introduction in a three part series about algebra and software development.

    本文是有关代数和软件开发的三部分系列的介绍。

    基础代数 (Basic Algebra)

    Why don’t we just go back to basics for a minute and talk about algebra. The very same topic we all took in high-school where we were first presented with the notion of variables and factoring expressions out thanks to known properties on the operations we were doing.

    我们为什么不回到基础知识上来讨论代数。 我们所有人都在高中时遇到了同样的话题,由于我们正在执行的操作具有已知的属性,因此我们首先了解了变量和分解表达式的概念。

    I don’t want you to believe this is all just to sneak in Abstract Algebra or Category Theory for which there are more advanced articles or series on these subjects available; like: Algebird for Data Analysis, or Bartosz’ Category Theory for Programmers. Before worrying about how we can compose algebras, we need to refresh the basics of what we mean by a simple algebra…

    我不希望您相信这仅仅是潜入“抽象代数”或“范畴论”中,有关这些主题的更高级文章或系列可在其中找到。 例如: 用于数据分析的Algebird或针对程序员的 Bartosz 类别理论 。 在担心如何组成代数之前,我们需要刷新简单代数的基本含义……

    An algebra are these three things working together:

    代数是这三件事共同作用的结果:

    Some values

    一些价值观 Some operations that can be done with those values

    可以使用这些值完成的一些操作 Some laws or properties that hold for the above combination of values and operations.

    适用于上述值和运算组合的某些定律或属性。

    That is it! Surely we must be able to leverage this idea into our day to day work; we already are dealing with data types, functions, and are asked to write tests that match expected outcomes to the actual result of our function calls. This is quite possibly something we are already doing without noticing, or being explicit about it.

    这就对了! 当然,我们必须能够将这一思想运用到我们的日常工作中。 我们已经在处理数据类型,函数,并且被要求编写将预期结果与函数调用的实际结果相匹配的测试。 这很可能是我们在没有注意到或未明确说明的情况下已经在做的事情。

    这个连接有什么有趣的地方? (What is interesting about this connection?)

    If we are already doing this, then what does it matter what title I give to my work; sure! but every developer already knows naming is important! When you realize we are working in Algebra then you can start looking at all three components from an algebraic perspective. What are the laws for the Cake algebra? or the hexagon algebra? What are the values it works with? All of a sudden you should start seeing all those crevices waiting to get filled with bugs.

    如果我们已经在做这件事,那我给我的作品取什么头衔又有什么关系呢? 当然! 但是每个开发人员都已经知道命名很重要 ! 当您意识到我们正在代数中工作时,就可以从代数的角度开始研究所有三个组成部分。 Cake代数的定律是什么? 还是六角代数? 它使用什么值? 突然之间,您应该开始看到所有这些缝隙都在等待被错误填充。

    By choosing to name what you do Algebra you will recognize so many of those common patterns you saw in school also are true for the properties your own operations are expected to hold. you might already know some of these properties from elsewhere:

    通过选择您要代做的工作来命名,您将认识到您在学校看到的许多常见模式对于您希望自己拥有的资产也适用。 您可能已经从其他地方知道其中一些属性:

    Associativity: I don’t want the order I do two operations in to matter.

    关联性:我不希望执行两次操作的顺序很重要。 Idempotency: I don’t want my operation to change anything if I mistakenly apply it twice.

    幂等性:如果我错误地应用了两次,我不希望我的操作更改任何内容。 Traversability: I want my operation to be applicable to multiple values in some sequence of evaluation.

    可遍历性:我希望我的操作可以按某些求值顺序应用于多个值。

    A very popular example where this has been extremely successful is in database systems where the ACID laws are expressly shared and allowed to be verified by DBMS users. It’s no accident it is so easy to integrate with one of these systems…

    一个非常成功的例子是非常成功的例子是在数据库系统中, ACID法则明确共享并允许DBMS用户进行验证。 与这些系统之一集成是如此容易,这并非偶然。

    This urge to re-use and leverage your existing libraries should be enough motivation to go and take a quick look at one of those abstract algebra libraries already in your language like cats.

    重用和利用现有库的这种冲动应该足以激励并快速浏览已经使用您的语言(如cats)的那些抽象代数库之一。

    By writing algebras you are explicit in the ways your code is allowed to interact / compose; you are also able to provide tests for the different invariants your code is supposed to hold and guides on how your code’s clients are expected to use it.

    通过编写代数,您可以清楚地了解允许代码交互/编写的方式。 您还可以针对您的代码应该持有的不同不变量提供测试,并指导您的代码客户端如何使用它。

    分享这些法律! (Share those Laws!)

    Having an Algebra means you don’t just have your objects and methods (a.k.a data types and functions), you are also carrying around the properties / contracts / invariants that MUST hold in their usage.

    拥有代数意味着您不仅拥有对象和方法(aka数据类型和函数),而且还携带必须使用的属性/协定/不变量。

    This then also means you also get these things for little or no extra work:

    这也意味着您只需很少甚至不需要额外的工作就可以得到这些东西:

    A property based test suite that helps you exercise your operations with values from your domain, proving the laws you set out to define hold. There are a slew of benefits to property based testing above only doing unit tests.

    基于属性的测试套件,可帮助您利用您域中的值来进行操作,证明您设定定律的法律。 仅基于单元测试,基于属性的测试有很多好处。 A domain specific language that is just a derivation from the operations and how your properties allow them to compose with each other.

    一种特定于域的语言,仅源于这些操作以及您的属性如何允许它们相互组合。 A self contained module or library, with a clear definition of what it can do, and how it is supposed to do it, you are free to link to and leverage in whatever form or protocol you want / need to wrap it in.

    一个自包含的模块或库,对它可以做什么以及应该如何做有清晰的定义,您可以自由地链接和利用您想要/需要包装的任何形式或协议。 A complete specification of what your code is expected to do and how it is expected to behave.

    有关代码应执行的操作以及行为的完整说明。

    And when you ship your algebra, this also means shipping your laws. This way users of your code can run the properties and contracts around how their own code interacts with yours.

    当您运送代数时,这也意味着运送法律。 这样,您的代码用户可以围绕自己的代码与您的代码交互的方式运行属性和合同。

    Conversely, you will naturally want to re-use tests and properties you have already written for one of your modules (algebras) your own code uses. This is possible! And you will see it in all the best functional programming libraries already; with projects like discipline where you can publish your own property specifications as test suites your modules clients can use to verify proper usage of your algebras.

    相反,您自然会希望重复使用已经为自己的代码使用的模块(代数)编写的测试和属性。 这个有可能! 您已经在所有最佳的函数式编程库中看到了它; 在诸如学科之类的项目中,您可以发布自己的属性规范作为测试套件,客户可以使用模块来验证代数的正确用法。

    不要为炒作而堕落! (Don’t fall for the hype!)

    As you will notice; the one thing that most architecture designs seem to be lacking is an executable specification about how they are supposed to interact. Without these specifications you start running into unexpected consequences and uses. For example the Cake Pattern was advertised as revolutionary in 2016 only later to be discarded and considered more trouble than it was worth by 2018.

    您会注意到; 大多数架构设计似乎缺少的一件事是关于它们应该如何交互的可执行规范。 没有这些规范,您将开始遇到意想不到的后果和用途。 例如,蛋糕模式在2016年被宣传为具有革命性的东西,直到后来被废弃,被认为比2018年值得的麻烦多 。

    System Design and Architecture is an exercise of distributing cognitive complexity; e.g. it is about organizing a system so we continue to reason about it as it evolves through time; and leveraging the taxonomy of structures studied by mathematicians over the past several thousand years seems like an easy choice; especially when you get to re-use all those objects, methods, and tests already studied.

    系统设计和体系结构是分配认知复杂性的一种练习。 例如,它是关于组织一个系统的,因此我们会随着时间的推移继续对其进行推理; 利用过去几千年来数学家研究的结构分类法似乎是一个容易的选择; 特别是当您要重用已经研究过的所有这些对象,方法和测试时。

    By leveraging algebraic reasoning; you now have an extra axis with which to judge that shiny new upcoming design pattern / architecture for your next serious project:

    利用代数推理; 您现在有了一个额外的轴,可以用它来判断下一个严肃项目的新的闪亮设计模式/体系结构:

    What are the laws it follows?

    它遵循的法律是什么? Does it ship with tests and support me in confirming my own code follows these laws?

    它是否附带测试并支持我确认自己的代码是否遵循这些法律? How are these laws relate to interactions with the code that lives outside the shipped pattern?

    这些法律与与出厂模式之外的代码的交互有何关系?

    翻译自: https://medium.com/swlh/show-me-the-laws-788323f5dd81

    证券法律法规体系所有法律

    相关资源:论文研究 - 私募基金的问题和建议
    Processed: 0.013, SQL: 8