|
|
|
|
|
by regularfry
5136 days ago
|
|
I think what the GP might be trying to get at is this: you've reinvented partial function application and first-class functions. An instance of a class can be regarded as a bundle of functions which all have the constructor's parameters partially applied. If your instance only has one method, it's equivalent to a single, partially applied function. In that sense, what you've done is found a way to reorganise a Rails app in a very functional way - and, if you want to do that, given that Ruby doesn't have first-class functions or partial application (well, without proc hack, anyway), this may be the best way to do it. It may work very well, but it's at least as functional as it is OO. |
|
http://en.wikipedia.org/wiki/Dataflow_programming
Parts of this approach might be valuable, as I tried to emphasize, but as a whole this doesn't look good for plenty of reasons mentioned in the thread.