在正式软件设计中处理非晶子系统

发布于 2024-08-08 04:58:00 字数 596 浏览 6 评论 0原文

像 Alexander Stepanov 和 Sean Parent 这样的人投票支持软件设计的正式和抽象方法。
这个想法是将复杂系统分解为有向无环图,并将循环行为隐藏在代表该行为的节点中。
家长在 boost-con 和 google 上进行了演示(表格,来自boost-con,第 24 页介绍了该方法,还有一个 视频谷歌谈话)。

虽然我喜欢这种方法并认为它是必要的开发,但我在想象如何处理具有无定形行为的子系统时遇到了问题。
例如,想象一下状态机的常见模式:使用所有状态都支持的接口,并在状态的具体实现中具有不同的行为。

如何解决这个问题?
请注意,我只是在寻找一种抽象方法。

我可以考虑将该行为隐藏在节点后面并为状态定义不同的子 DAG,但是如果您想影响主 DAG 与子 DAG 的行为。

People like Alexander Stepanov and Sean Parent vote for a formal and abstract approach on software design.
The idea is to break complex systems down into a directed acyclic graph and hide cyclic behaviour in nodes representing that behaviour.
Parent gave presentations at boost-con and google (sheets from boost-con, p.24 introduces the approach, there is also a video of the google talk).

While i like the approach and think its a neccessary development, i have a problem with imagining how to handle subsystems with amorphous behaviour.
Imagine for example a common pattern for state-machines: using an interface which all states support and having different behaviour in concrete implementations for the states.

How would one solve that?
Note that i am just looking for an abstract approach.

I can think of hiding that behaviour behind a node and defining different sub-DAGs for the states, but that complicates the design considerately if you want to influence the behaviour of the main DAG from a sub-DAG.

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

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

发布评论

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

评论(1

﹎☆浅夏丿初晴 2024-08-15 04:58:00

你的问题不清楚。定义非晶子系统

您“只是在寻找一种抽象方法”,但您似乎想要有关传统编程语言中实现的详细信息(“状态机的常见模式”)。那么,你要什么?如何实现嵌套有限状态机?

更多细节将有助于对话。

对于真实抽象方法,请查看类似流媒体 X 机器

... X-machine 模型在结构上是
有限状态机相同,除了
用于标记机器的符号
转移表示 X→X 类型的关系。 ...

Stream X-Machine 与 Eilenberg 的不同
模型,因为基本数据类型

<块引用>

X = 输出* × 内存 × 输入*,

其中 In* 是输入序列,
Out* 是输出序列,Mem 是
(其余的)记忆。

这个模型的优点是
允许一个系统被驱动,一步
一次,通过它的状态和
转变,同时观察
每一步的输出。这些都是
见证人价值观,保证
特定功能执行于
每一步。结果,复杂
软件系统可能会被分解
进入 Stream 的层次结构
X-Machines,采用自上而下的设计
方式并以自下而上的方式进行测试。
这种分而治之的方法
设计和测试由以下机构支持
Florentin Ipate 的正确证明
集成,这证明了如何测试
分层机器独立地是
相当于测试组成的
系统。 ...

但我不明白演示文稿与此有什么关系。他似乎谈论的是一种相当主流的编程方法,与 X 机器完全不同。不管怎样,演示文稿相当混乱,我现在没有时间看视频。

对演讲的第一印象,仅阅读幻灯片

作者随意触及了许多领域/问题/解决方案,显然没有意识到这一点:来自 Peopleware(例如编程心理学),到软件工程(例如 软件产品线),到各种编程技术。

各个部分如何联系以及他到底提倡什么根本不清楚(我习惯于只阅读幻灯片,它们通常是重要的):

如果/当我看到视频时,我会更新这个答案。

Your question is not clear. Define amorphous subsystems.

You are "just looking for an abstract approach" but then you seem to want details about an implementation in a conventional programming language ("common pattern for state-machines"). So, what are you asking for? How to implement nested finite state-machines?

Some more detail will help the conversation.

For a real abstract approach, look at something like Stream X-Machines:

... The X-machine model is structurally the
same as the finite state machine, except
that the symbols used to label the machine's
transitions denote relations of type X→X. ...

The Stream X-Machine differs from Eilenberg's
model, in that the fundamental data type

X = Out* × Mem × In*,

where In* is an input sequence,
Out* is an output sequence, and Mem is the
(rest of the) memory.

The advantage of this model is that it
allows a system to be driven, one step
at a time, through its states and
transitions, while observing the
outputs at each step. These are
witness values, that guarantee that
particular functions were executed on
each step. As a result, complex
software systems may be decomposed
into a hierarchy of Stream
X-Machines
, designed in a top-down
way and tested in a bottom-up way.
This divide-and-conquer approach to
design and testing is backed by
Florentin Ipate's proof of correct
integration, which proves how testing
the layered machines independently is
equivalent to testing the composed
system. ...

But I don't see how the presentation is related to this. He seems to speak about a quite mainstream approach to programming, nothing similar to X-Machines. Anyway, the presentation is quite confusing and I have no time to see the video right now.

First impression of the talk, reading the slides only

The author touches haphazardly on numerous fields/problems/solutions, apparently without recognizing it: from Peopleware (for example Psychology of programming), to Software Engineering (for example software product lines), to various programming techniques.

How the various parts are linked and what exactly he is advocating is not clear at all (I'm accustomed to just reading slides and they are usually consequential):

If/when I will see the video I will update this answer.

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