views:

125

answers:

9

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.

A: 

I've used the term "Enricher" before.

Paul Mitchell
+1  A: 

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.

Chris Lutz
+2  A: 

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")

Pavel Shved
I like "constructor" the best so far. As for serialize/deserialize: it's not really *serialization*...
brianreavis
Except constructor/destructor is so ingrained, it'll be hard to imagine abstractor/constructor.
paxdiablo
That's very true...
brianreavis
"serializer"/"deserializer"
Adrian
+2  A: 

If, as mentioned, concertor sounds a bit silly, why not a (kind of) synonym for concretor - 'builder'.

Paddy
I like this one the best - you're building your thing from its basic parts.
paxdiablo
+2  A: 

Several reasonable responses provided so far. I might as well toss in 'Realizer' for consideration.

Brandon E Taylor
+1  A: 

You could call it an Actualizer

Jordan Stewart
A: 

Call me silly but I think Concretor fits and is no less vague than Abstractor.

onedaywhen
A: 

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!

Erik A. Brandstadmoen
A: 

When I read the title for this question I immeadiately thought of instantiator like you.

graham.reeds