“整体”是什么意思?意思是?

发布于 2024-09-08 02:22:48 字数 154 浏览 3 评论 0原文

我在课堂上看到过它。我怀疑这意味着该类可以被分解为逻辑子单元,但我找不到一个好的定义。你能举一些例子吗?

感谢您的帮助。

编辑:我喜欢聪明的回复,但我显然指的是软件上下文中的“整体”。我了解巨石、巨石、支石墓以及所有与石头相关的背景。哎呀,我的国家已经够多了……

I've seen it in the context of classes. I suspect it means that the class could use being broken down into logical subunits, but I can't find a good definition. Could you give some examples?

Thanks for the help.

Edit: I love the smart replies, but I'm obviously referring to "monolithic" within a software context. I know about monoliths, megaliths, dolmens, and all the stone-related contexts. Gee, I have enough of them in my country...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

再见回来 2024-09-15 02:22:48

有趣的问题。我认为单体类没有任何正式的定义,但你已经明白了。包含逻辑上不连接或无意义耦合的多个组件的类是整体类。

如果您读过我强烈推荐的The Pragmatic Programmer,您可以将整体类定义为与该书中几乎所有内容相悖的反模式。

至于示例,您会在芯片和操作系统设计领域找到更多示例,其中有单片芯片的正式定义/内核,类似于整体类。以下是一些示例,尽管每个示例都可能不适合列入此列表:

  1. JOGL - Java 的 OpenGL 绑定。这可能是有争议的,而且有充分的理由。
  2. 大多数学术项目 - 原因显而易见。

如果您开始独自编程,而不是加入团队,那么您很可能可以打开第一个项目,并且会有一个单一的类。

Interesting question. I don't think there are any formal definitions of what a monolithic class is, but you've got the idea. A class that contains multiple components that are logically unconnected, or pointlessly coupled, is a monolithic class.

If you've read The Pragmatic Programmer, which I strongly recommend, you can define a monolithic class as an anti-pattern that goes against almost everything from that book.

As for examples, you'll find more in the realm of chip and OS design, where there are formal definitions of monolithic chips/kernels, which are similar to a monolithic class. Here are some examples, although each of them can be argued against being on this list:

  1. JOGL - Java bindings for OpenGL. This could be arguable, and with good reason.
  2. Most academic projects - For obvious reasons.

If you started programming alone, rather than joining a team, then chances are you can open one of your first projects, and there will be a class that is monolithic.

迟到的我 2024-09-15 02:22:48

如果你查一下这个词的词源,你会发现它来自希腊语 monos(单一)和 lithos(石头)。在您提到的软件上下文中,它描述了一个单层应用程序,其中用户界面和数据访问的代码被组合成来自单一平台的单一程序

If you look up the etymology of the word you'll see it comes from the Greek monos (single) and lithos (stone). In the context of software as you mention it, it describes a single-tiered application in which the code for the user interface and the data access are combined into a single program from a single platform.

内心荒芜 2024-09-15 02:22:48

“单体”这个术语已被用来开发成功的软件。此链接揭示了该术语固有的假设及其有限的用处。

基本假设是,如果系统是由每个都有单独的、明确定义的任务的软件组件构建的,那么系统会运行得更好。直觉上,这似乎是正确的。如果每个组件都能工作,那么整个系统也必须能工作,对吗?

事实上,这并不那么容易。较大的组合(非整体)系统可能会错过关键功能,即使没有单一组件可责备。当架构设计未能将功能分配给任何特定组件时,就会发生这种情况。这种情况尤其可能发生在函数不能完全映射到单个组件的情况下。

现在,Linux(继续链接的示例)实际上并不是单一的。它在整体内核之上有一个模块化的用户空间,该用户空间附带许多独立的实用程序。 除非没有。

"Monolithic" is a term that has been used to flame succesful software. This link exposes the assumptions inherent in the term, and their limited usefulness.

The basic assumption is that a system works better if it is built from software components that each have an individual, well-defined task. Intuitively, this seems right. If each component works, the entire system must work, right?

In reality, it's not that easy. A larger, compositional (non-monolithic) system can miss a critical function, even when there is no single component to blame. This happens when the architectural design fails to allocate a function to any specific component. This can happen especially if it's a function which doesn't map cleanly to a single component.

Now Linux (to continue with the linked example) in reality is not monolithic. It has a modular userspace on top of a monolithic kernel, a userspace that comes with many separate utilities. Except when it doesn't.

記憶穿過時間隧道 2024-09-15 02:22:48

我对软件开发中的整体设计的定义是一种需要将附加功能添加到单个不可分割的代码块中的设计。

优点:

  • 一切都在一个地方,因此很容易找到
  • 考虑到需要考虑的关系较少,可以更简单(也可以更复杂,参见缺点)

缺点:

  • 随着时间的推移,随着功能的添加,系统的复杂性可能呈指数级增加,新功能非常难以或不可能实现
  • 可能会使多个开发人员难以使用,例如实体框架 EDMX 文件将整个数据库放在一个文件中,这对于多个开发人员来说可能非常困难。
  • 可重用性降低,根据定义,它不具有可以重用并重新用于解决其他问题的较小组件,除非制作了代码的完整副本然后进行修改。

My definition of a Monolithic design in software development, is a design which requires additional functionality to be added to a single indivisible block of code.

PRO:

  • Everything is in one place, and therefore easy to find
  • Can be simpler, given there less relations to consider (can also be more complex see cons)

CONS:

  • Over time as functionality is added the complexity of the system may exponentially increase, to the point new features are extremely hard or impossible to implement
  • Can make it difficult for multiple developers to work with e.g Entity Framework EDMX files have the entire database in a single file which can be extremely difficult for multiple developers to work on.
  • Reduced re-usability, by definition it does not have smaller components which can be then reused and re-purposed to solve other problems, unless a complete copy of the code is made and then modified.
断爱 2024-09-15 02:22:48

整体架构是一种软件结构模型,它被创建为一个整体,所有 Rails 工具(ActionMailer、ActiveJob、ActionCable 等)都可以与这些工具应用的代码聚集​​在一起。这些工具彼此不相关,但也不是自治的。

如果一项功能需要更改,它将影响整个流程和其他功能的工作,因为它们是一个流程的一部分。

让我们回想一下 Ruby on Rails 是什么、它能提供什么、它的优点和缺点。它最重要的好处是易于使用。

如果您编写rails new,您会立即获得一个新应用程序,然后您可以创建您想要的任何 REST API 并使用 Rails 帮助程序和生成器,这使开发变得更加容易。

如果您需要在 Rails 应用程序中发送电子邮件,请使用 Rails ActionMailer。当你需要做一些硬处理时,ActiveJob会帮助你。使用 Rails 5,您还可以开箱即用地使用 Websocket。因此,创建聊天或使您的应用程序更具交互性将很容易。

如果您使用正确的 DSL 语法,您就可以使用所有这些,甚至更立即。而且,您不必了解这些工具的内部实现的所有内容,将其视为 DSL,并获得预期的结果。

A monolithic architecture is a model of software structure which is created as one piece where all Rails tools (ActionMailer, ActiveJob, ActionCable, etc.) can be gathered together with the code that these tools applies. The tools are not connected with each other but they are also not autonomous.

If one feature needs changes, it will influence the work of the whole process and other features because they are parts of one process.

Let’s recall what Ruby on Rails is, what it can offer, its pros and cons. Its most important benefit is that it is easy to work with.

If you write rails new you immediately get a new application at once, then you can create any REST API you want and use Rails helpers and generators, which makes development even easier.

If you need to send emails in your Rails app, then use Rails ActionMailer. When you need to do some hard processing, ActiveJob will help you. With Rails 5 you will also be able to use websockets out of the box. Thus, it will be easy to create chats or make your application more interactive.

In case you use correct DSL syntax, you can use all that and even more immediately. Moreover, you don’t have to know everything about the internal implementation of these tools, consider it’s DSL, and receive the expected result.

紫瑟鸿黎 2024-09-15 02:22:48

这意味着某些东西与模块化相反。模块化应用程序可以更换称为模块的部件,而无需更换整个应用程序。而单体应用程序在修复或升级部分部件后,必须全部更换。

来自 Wikipedia:“一般来说,模块化是可取的,因为它支持重用部分应用程序逻辑并且还可以通过允许维修或更换应用程序的部件来方便维护,而无需批量更换。”

因此,在整体类的上下文中,它的所有功能都是独立的,如果您想向类添加或更改功能,您需要更改/添加类中的代码并重新编译它。相反,模块化类公开对外部实现的功能的访问。例如,“计算器”类可以使用单独的“添加”类来实际添加数字;从单独的库调用“乘法”函数;或者甚至从网络服务调用“摊销”功能。只要这些功能部分中的每一个都可以从类外部进行更改,它就是模块化的。

It means something is the opposite of modular. A modular application can have parts, referred to as modules, replaced without requiring replacement of the entire application. Whereas a monolithic application, after having a part fixed or upgraded, must be replaced in it's entirety.

From Wikipedia: "Modularity is desirable, in general, as it supports reuse of parts of the application logic and also facilitates maintenance by allowing repair or replacement of parts of the application without requiring wholesale replacement."

So in the context of a monolithic class, all its features are self-contained and if you want to add or alter a feature to the class you would need to alter/add code in the class and recompile it. Conversely a modular class exposes access to functionality which is implemented externally. For example a "Calculator" class may use a separate "Add" class for actually adding numbers; call a "Multiply" function from a separate library; or even call an "Amortize" function from a web service. As long as the each of these functional parts can be altered externally from the class, it is modular.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文