|
How about "Pin A Mutt"? Kind of like "Pin the tail...", however I'm thinking along the lines of blindfold, crochet(sp?) needle, and a live dog running around. PETA may have a problem with that.
PS When I had a dog, I'd never have volunteered him for this "game".
|
|
|
|
|
The closest version of this that I could see without contemplating my navel would be an Identity Map. It's not a 100% fit, but it does fit some of your intent.
|
|
|
|
|
Interesting. I have also implemented this in my framework, but I just called it caching.
Nick
|
|
|
|
|
Nicholas Butler wrote: I just called it caching
Most people do.
First law of patterns. They are a fancy name for stuff you already do.
|
|
|
|
|
Pete O'Hanlon wrote: First law of patterns. They are a fancy name for stuff you already do.
Along with the first law of programming ( "it's already been done" ), I was hoping someone had already come up with the fancy name.
Nick
|
|
|
|
|
Like AJAX, we were doing that "call the server without reloading the page" years before they came up with the name, first using hidden frames, then iFrames and finally XmlHttpRequest!.
And Ajax will always remain a cleaning product for me, not a programming thing.
|
|
|
|
|
Agreed. Some 10 years ago, when I designed an architecture and had it reviewed, I've been told that I've implemented an Observer Pattern. I had to ask what he was talking about - I had never heard of Design Patterns before!
After reading up about them I realized they only really described a ton of things I already knew and did use.I just didn't think to come up with a name for these patterns and write a book! 
|
|
|
|
|
I like to call it poor programming. But I am outnumbered in the MS world.
|
|
|
|
|
Suggestion:
Predicated Queries/Query
Henry Minute
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Cogito ergo thumb - Sucking my thumb helps me to think.
|
|
|
|
|
Henry Minute wrote: Predicated Queries/Query
I like it - thanks Henry
Nick
|
|
|
|
|
You can design any method to use a predicate like that. It isn't rocket science - it's LINQ:
IEnumerable<T> Fetch<T>(Func<T, bool> predicate){
return repository.Where(predicate);
}
...as long as you are using the repository that contains type `T`.
|
|
|
|
|
I know. I use it every day. I was merely suggesting a name that attempted to describe what the OP was doing.
If they had got the hint, they might have opted to modify their Framework/Wrapper/WhateverItWasTheyCalledItICantBeArsedToGoBackAndLook.
If I had suggested changes, that would be turning The Lounge into a programming forum, which it ain't.
Henry Minute
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Cogito ergo thumb - Sucking my thumb helps me to think.
|
|
|
|
|
As an alternative, it also looks a bit like a Query Object - mapping onto a Repository pattern.
|
|
|
|
|
|
I'm thinking condition-based programming. I'm not sure if I just made that up right now though.
Also, isn't that exactly the type of thing you can already do with a Linq query?
It is elegant, just like Linq, and it's a good thing to do as long as you can implement it in such a way that the condition is only executed as little as possible, and you don't have to load the whole potential result set into memory and then filter it.
It's more functional programming than declarative, I think. In languages where functions are first class objects (e.g. Javascript) it is more common to pass filter functions or other types of function (for example a sort order comparator) around and potentially declare them locally as you have done here. What you're passing in the 'where' parameter is a pure function.
|
|
|
|
|
BobJanova wrote: Also, isn't that exactly the type of thing you can already do with a Linq query?
Yes, it's certainly like Linq The difference is that it may or may not cause a Linq-to-Entities query to run and hit the database server.
BobJanova wrote: It's more functional programming than declarative, I think.
Yes, I suppose it is. I was focused on making it easy to use rather than the programming paradigm.
Thanks,
Nick
|
|
|
|
|
I don't know if it's known or not.
You could call it "Query Mapper"
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
YAPNBUDP - Yet another pretentiously named but unnecessary design pattern
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
I use this stuff all the time, and love it !!
Linq, Lamdas, Linq with Lamdas..
It saves a lot of time with EF.
|
|
|
|
|
Baxter R Pearson wrote: It saves a lot of time with EF.
Exactly
I've sent you a PM - could you let me know if it doesn't come through ( sometimes they go missing. )
Nick
|
|
|
|
|
'Specification Pattern' with only one logical chain.
|
|
|
|
|
Isn't it just a simple Facade pattern?
|
|
|
|
|
Nathan Gloyn wrote: Isn't it just a simple Facade pattern?
It does hide a lot of complexity, but I think the difference is that the parameters passed are functions not values.
I don't know if that makes it a different pattern, though
Nick
|
|
|
|
|
From the all knowing Wikipedia:
A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can:
- make a software library easier to use, understand and test, since the facade has convenient methods for common tasks;
- make the library more readable, for the same reason;
Certainly sounds like its a facade based on that definition 
|
|
|
|
|
My favourite patterns in order are:
Paisley, spirals and tiger stripes.
|
|
|
|