与“抽象器”相反的是“抽象器”。
我有一个函数,它接受对象实例并将它们简化为抽象/通用格式。像这样:
class Dog { id=0, awesome=1 }
=> [id:0, type:'dog'] //abstract, generic version
class Cat { id=1, awesome=0 }
=> [id:1, type:'cat']
class Narwhal { id=42, epic=1 }
=> [id:42, type:'narwhal']
我称之为抽象器。 “通过减少信息内容进行概括。”
“放弃者”的反义词是什么?我有一个与抽象相反的函数(通过使用抽象版本的 id
和 type
来提取其他字段,例如 awesome
和 <代码>史诗,来自数据库)。对于我的一生,我不知道该给它起什么名字。
我最接近的猜测是“实例化器”和“作曲家”,但这两个似乎都不完全正确。
I have a function that takes object instances and reduces them down to an abstract/generic format. Like this:
class Dog { id=0, awesome=1 }
=> [id:0, type:'dog'] //abstract, generic version
class Cat { id=1, awesome=0 }
=> [id:1, type:'cat']
class Narwhal { id=42, epic=1 }
=> [id:42, type:'narwhal']
I call this an abstractor. "Generalization by reducing the information content."
What is the opposite of an "abstactor"? I have a function that does the opposite of abstraction (by using the abstracted version's id
and type
to pull the other fields, like awesome
and epic
, from a database). For the life of me, I can't figure out what to name it.
My closest guesses are "instantiator" and "composer", but neither of these seem quite right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
如前所述,如果 Concertor 听起来有点傻,为什么不使用 concretor 的(某种)同义词——“建造者”。
If, as mentioned, concertor sounds a bit silly, why not a (kind of) synonym for concretor - 'builder'.
与抽象器相反?基于一点信息明确创建完整对象的东西?
我们通常称其为“构造函数”:-)
(但是,老实说,我会将您的整个业务称为“序列化器”/“反序列化器”)
Opposite to abstractor? Something that unambiguously creates full object based on a little piece of information?
We usually call it "constructor" :-)
(But, honestly, I would call whole your business "serializer"/"deserializer")
到目前为止,已经提供了一些合理的答复。我不妨加入“Realizer”以供考虑。
Several reasonable responses provided so far. I might as well toss in 'Realizer' for consideration.
您可以将其称为解抽象器,然后继续编写代码。但这个词不太好。
你可以称它为破坏符,但这听起来太像 - 哦,看!独角鲸!
还提到了具体的东西,但我同意这听起来很愚蠢,而丰富的东西对我来说听起来相当模糊。
我会说说明符。你指定你想要什么,它就会给你其中之一。你说你的功能是概括性的,而一般性的反面是特定性的。
You could just call it a deabstractor and go back to writing code. But that word isn't very good.
You could call it a destractor, but that sounds too much like - Oh, look! A narwhal!
Also mentioned was concretor, but I agree that it sounds silly, and enricher sounds rather vague to me.
I would say specifier. You specify what you want, and it gives you one of those. You say your function generalizes, and the opposite of general is specific.
你可以称它为 Actualizer
You could call it an Actualizer
我以前用过“丰富者”这个词。
I've used the term "Enricher" before.
你可以说我很傻,但我认为
Concretor
适合并且不比Abstractor
更模糊。Call me silly but I think
Concretor
fits and is no less vague thanAbstractor
.我的第一条评论:如果你不知道如何称呼这头野兽,你确定你的做法是正确的吗?
如果您确定要这样做,为什么不称其为“Creator”呢?
请参阅此处“混凝土”和“创造”这两个词的词源。它们都与拉丁语“crescere”有关,意思是“生长”。 “具体”字面意思是“共同成长”。
祝你好运!
My first comment: If you don't know what to call the beast, are you sure you are doing it the right way?
If you are sure you want to do it that way, Why not call it "Creator"?
See etymology for the words "Concrete" and "Create" here. They are both related to the latin "crescere", which means "to grow". "concrete" literally means "grow together".
Good luck!
当我读到这个问题的标题时,我立即想到了像你一样的实例化器。
When I read the title for this question I immeadiately thought of instantiator like you.
我认为这还没有给出,对我来说最好的匹配是Specializer。
在 UML 中,您可以概括或专门化一个类。
I don't think this has been given, to me the best match is Specializer.
In UML, you can generalize or specialize a class.