| Issue 27: | commentary on architecture | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I find myself trying to write Funcito, fittingly, in a functional style. To me, this means as little state as possible and preferably immutable state. This is manifested in constructions like this: new InvocationManager().pushInvokable(i); Interestingly, I'm reasonably certain that we can reduce the state of Funcito down to: (a) lone Invokable pointer in InvokableState (b) StubFactory instance (c) cache maps in StubFactories I find this elegant, to the point where I am questioning (c), but more on that in another note. The main 'rub' right now is that I would like to have Funcito create FuncitoDelegate in the constructor style as shown above. Same thing with InvocationManager and InvokableState. Note that a trivial constructor is super-fast. One NFJS speaker said it is 10 bytecode operations.
Nov 29, 2011
Project Member
#1
kandpwel...@gmail.com
Nov 30, 2011
Re: garbage-collection thrashing. This is wild speculation. We would have to profile to show evidence of that, and I bet that there will be no issues. Objects are inexpensive on modern JVMs. My position is more objective: with respect to thread-safety, it is easier to reason about state if there is less state. This library could be reduced to the 3 items listed above. (Admittedly, my sense of aesthetic and functional style is indeed subjective.) |