Discussion:
Need help recalling a design pattern
Trey Harris
2005-04-26 07:21:20 UTC
Permalink
There's a design pattern whose name I'm having trouble remembering (which
is making it hard for me to look up any literature on it). I'm hoping
maybe someone here can help me.

I thought it was called the "recognizer" pattern, but Googling isn't
turning up anything by that name. Basically, you have a data blob, and a
list of candidate classes, and you throw the data at the classes one by
one until one of them "recognizes" the blob and returns an object
encapsulating it.

In more advanced usage, you get responses back from the candidate classes
about how well they recognize the blob, and you eventually use the class
that can best recognize it, even if several can recognize it to some
extent.

Sound familiar?

Thanks,

Trey
Andrew W. Gibbs
2005-04-26 12:41:27 UTC
Permalink
When I've employed such patterns, I've been under the impression that
they fell under the umbrella of "Factory". Perhaps, though, you are
looking for a sub-pattern of Factory?

Maybe the obviousness of the answer is what is making you have a hard
time finding it? :-)

-- Andrew
Post by Trey Harris
There's a design pattern whose name I'm having trouble remembering (which
is making it hard for me to look up any literature on it). I'm hoping
maybe someone here can help me.
I thought it was called the "recognizer" pattern, but Googling isn't
turning up anything by that name. Basically, you have a data blob, and a
list of candidate classes, and you throw the data at the classes one by
one until one of them "recognizes" the blob and returns an object
encapsulating it.
In more advanced usage, you get responses back from the candidate classes
about how well they recognize the blob, and you eventually use the class
that can best recognize it, even if several can recognize it to some
extent.
Sound familiar?
Thanks,
Trey
_______________________________________________
sw-design mailing list
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
Rob Kinyon
2005-04-26 12:49:31 UTC
Permalink
I'm with Andrew here; it sounds like a subpattern of Factory. At
least, that's how I've conceived of it whenever I had to do something
similar. Maybe it has a touch of Dispatcher in it, too.

Rob
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
When I've employed such patterns, I've been under the impression that
they fell under the umbrella of "Factory". Perhaps, though, you are
looking for a sub-pattern of Factory?
Maybe the obviousness of the answer is what is making you have a hard
time finding it? :-)
-- Andrew
Post by Trey Harris
There's a design pattern whose name I'm having trouble remembering (which
is making it hard for me to look up any literature on it). I'm hoping
maybe someone here can help me.
I thought it was called the "recognizer" pattern, but Googling isn't
turning up anything by that name. Basically, you have a data blob, and a
list of candidate classes, and you throw the data at the classes one by
one until one of them "recognizes" the blob and returns an object
encapsulating it.
In more advanced usage, you get responses back from the candidate classes
about how well they recognize the blob, and you eventually use the class
that can best recognize it, even if several can recognize it to some
extent.
Sound familiar?
Thanks,
Trey
_______________________________________________
sw-design mailing list
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFCbjcDH8bbEWqt2qYRAjchAJ9ge9UP72vpAXFykTk7GmgI0vk25wCgq7+w
12hM2o0duAk3eIIfI03rWws=
=2ipU
-----END PGP SIGNATURE-----
_______________________________________________
sw-design mailing list
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design
Chris Winters
2005-04-26 14:13:38 UTC
Permalink
Post by Trey Harris
There's a design pattern whose name I'm having trouble remembering (which
is making it hard for me to look up any literature on it). I'm hoping
maybe someone here can help me.
I thought it was called the "recognizer" pattern, but Googling isn't
turning up anything by that name. Basically, you have a data blob, and a
list of candidate classes, and you throw the data at the classes one by
one until one of them "recognizes" the blob and returns an object
encapsulating it.
In more advanced usage, you get responses back from the candidate classes
about how well they recognize the blob, and you eventually use the class
that can best recognize it, even if several can recognize it to some
extent.
It sounds like a Chain of Responsibility (list of candidates +
throwing the data at them) implementing a Factory (passing in some
generic data and getting back an appropriate object).

Chris
--
Chris Winters (http://www.cwinters.com)
Building enterprise-capable snack solutions since 1988
Loading...