Hacker News new | ask | show | jobs
by brigandish 2604 days ago
I've not heard of the supplier pattern, any chance you would direct me to a resource about it?
2 comments

A Supplier is when a function needs a value, and instead of providing a value as an argument, you pass in callable:

Foo(int x){return x+1} becomes Foo(Supplier x){return x() + 1}

Function that supplies value, can also encapsulate alot of data generation code. After that you can write a strategy to select which data generation algorithm (supplier) shpuld be used.

Thats my cause.

Thanks.
Im pretty sure you know what i meant, no need for nitpicking.

(Does not make me any less right)

Just maybe he genuinely doesn't know what you mean. I mainly use Python and have no idea what you are talking about.

(You might consider reflecting on your tone and message. It presupposes bad faith on the other party, is dismissive and condescending, and you are probably less right than you think you are.)

I, too, have no idea what a supplier pattern is. Don't think that's a very mainstream notion.
I'm not OP, but I don't know what you mean... Googling it leads me to Supplier in Java 8, which is probably not what you meant?
I can't nitpick what I don't know about. I know the strategy pattern, not the supplier pattern.

It sounds interesting, that was all.