是否有任何结构化方法来定义隐喻以简化程序的复杂性
很抱歉,如果这看起来是一个模糊的问题,但它已经困扰我一段时间了。
在我的日常工作中,我编写的一些代码变得非常复杂。并不是说它通常非常技术性,而是问题域本身是一个处理空间数据以及许多其他事物的复杂问题。我很确定我的保密协议会禁止我透露我正在做的事情的任何细节,所以不幸的是,我必须保持这个非常笼统的内容。
现在,我完全赞成降低复杂性,因此我会尽可能找到正确的抽象,但是有什么方法可以通过明确不处理手头的实际问题而是使用一些隐喻来进一步减少复杂性可以对其进行操作,然后转化为我想要的实际结果吗?
当然,由于该领域本身是如此复杂,..我尝试过但失败了(很多次!)找到正确的比喻:-(
所以我的问题是,是否有人已经完成了这项工作并发现(甚至一半 )找到)一种结构化的方法来推断一组给定的编程问题的适当的隐喻或启发式?
再次,如果这看起来有点奇怪,我很抱歉我只是想找到成为更好的程序员的新方法。
提前致谢。
Sorry if this seems like a hazy question but it's something that's been bugging me for a little while.
In my day job, some of the code I write gets pretty complex. Not that it's usually very technical but the problem domain itself is a complex matter dealing with spacial data amongst many other things. I'm pretty sure my NDA would prohibit me from giving any details of what I'm working on so, unfortunately, I'll have to keep this pretty general.
Now, I'm all for reducing complexity so I try to find the right abstractions when I can but is there any way to reduce it further by explicitly not dealing with the actual matter at hand but rather some metaphor that could be operated on and then translated into the actual result I want later?
Of course, since the area is so complicated in itself,..I've tried but failed (many times!)to find the right metaphor :-(
So my question is, has someone already done this work and found (or even half found) a structured way to extrapolate an appropriate metaphor or heuristic for a set of given programming problems?
Again, my apologies if this seems like a bit of an odd question. I'm just trying to find new ways of being a better programmer.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能已经开始回答你的问题了。这由多个抽象级别组成;多个域的描述;以及以特定方式应用“建模”技术——与通常的建模方式截然不同。我相信,总体方法就是您所寻求的 - 它给出了可操作的隐喻,然后转化为实际结果。它基于许多已发布的方法,并严重依赖其中一些途径和方法。
以下内容受到这些警告的约束:
这种方法所需的三个主要组成部分是:
多个域
我对域的定义比通常采用的更广泛:
根据这个定义,系统内有多个域需要考虑,通常当开发人员提到域时,他们指的是问题(或应用程序)域(以下称为P)。然而,对于这种方法,系统的任何方面或系统开发都是建模的潜在主题。这包括系统架构(A);系统生产工件(代码、制作脚本、数据库模式等)(C); DBA职能;等等。通过隐喻接近P需要开发几个这样的领域 - 与隐喻以及从隐喻到现实世界模型或代码实现的转换相关开发系统中的现实世界。当开发多个这样的模型时,它们都被开发到相同程度的范围和精度。
多层次抽象
为了描述问题和系统,不仅要建模P,还要建模适当的更高抽象层次。因此,选择用来描述 P 的隐喻被建模(M)。以类似的方式,对 A (F) 的形式进行建模,如果认为有必要,则进行转换过程在 P 和 C 之间使用 A (<强>R)。因此,我们可以抽象出问题领域;抽象抽象等等。
多个模型的应用类似于分色——它们相互叠加,系统必须满足所有层的所有描述(“完整图片”)。这又与常见的建模方式不同,常见的建模方式往往通过精心设计原始模型以纳入不同的约束来满足多种要求。当所有架构域都有效地应用于所有问题域的所有元素时,这具有特殊的含义。
建模
我所说的建模与更常用的建模方法在以下方面有所不同:
以下示例源自我的概念验证项目,可能会为我上面的描述提供一些内容。我列出了我的一些领域,以及领域模型的候选内容。
这种方法至少有一个主要缺点 - 管理层可能会认为开发模型所涉及的工作是非生产性的,没有产生真正的可交付成果。
这个答案的来源多种多样,但很大程度上依赖于以下人的著作:
I may have the start of an answer to your query. This consists of multiple levels of abstraction; descriptions of multiple domains; and the application of "modelling" techniques in a particular way - really rather different from what is normally done in modelling. The overall approach is, I believe, what you are seeking - it gives metaphors that are operated on, and then translated into the actual result. It is based on a number of published approaches, and relies heavily on some of these approaches and methods.
What follows is subject to these caveats:
The three main consituents needed for this approach are:
Multiple domains
My definition of a domain is wider than that normally adopted:
Under this definition, there are multiple domains for consideration within a system, Often when developers refer to a domain, they mean the problem (or application) domain (referred to hereafter as P). However for this approach, any aspect of the system, or system development is a potential subject for modelling. This includes the system architecture (A); system production artefacts (code, make scripts, database schemas, etc) (C); DBA functions; etc. To approach P via metaphor requires development of several such domains - relating to the metaphor and transformations from the metaphor to a model of the real world, or to the code realisation of the real world in the developed system. When multiple such models are developed, they are all developed to the same degree of scope and precision.
Multiple levels of abstraction
To describing a problem and system, one models not only P, but also models appropriate higher levels of abstraction. Thus the metaphor chosen to describe P is modelled (M). In a similar way, the formalism of A (F) is modelled, and if deemed necessary the transformation process between P and C using A (R). So one abstracts the problem domain; abstracts the abstraction and so on.
The application of multiple models is similar to colour separations - they lie on top of each other, and the system has to meet all the descriptions (the "complete picture") of all the layers. Again this differs from common ways of modelling which tend to meet such multiple requirements by elaborating the original model to take in the different constraints. This has particular implications when all of the architecture domains are effectively applied to all the elements of all the problem domains.
Modelling
What I mean by modelling differs from more usual approaches to modelling in the following respects:
The following example, derived from my proof of concept project, may give some flesh to my descriptions above. I list some of my domains, together with candidate contents of the domain models.
There is at least one major disadvantage with this approach - the work involved in developing the models can be seen by management as non-productive, with no real deliverables being produced.
The sources for this answer are many and varied, but do rely heavily on works by: