Indeed, I'm not too happy with this either. Which is why I simply tried
to fix bugs rather than continue with the work on Contexts for the last
bitcoinj release... (I did however move some static variables into the
context.)

Mike once compared bitcoinj contexts to OpenGL contexts, but
interestingly OpenGL contexts are mentioned one of the bad design
decisions which were "undone" with the Vulkan API.

Still I'm not sure how to continue here. We certainly would need a
broader discussion before decidiing to go back to parameters. Most (if
not all) of the parameter based calls are still there but I think they
were planned to be removed in future.


On 09/20/2016 04:59 PM, Jarl Fransson wrote:
> 
>     So you suggest to deprecate the use of ThreadLocal for Context? 
> 
> Yes. I think it was a bad choice to put more semantics on threads than
> what is there already, even if it was temporary. It is better and safer
> to be explicit. It seems to have been the goal from start to eventually
> rid this: in the docs, "Eventually this auto-magic will be deleted and
> explicit passing of Context into all classes that need it will be used
> instead."
> 
> All tests that create there own context could get different context than
> they expect so that points to the problems with the design. I would also
> propose to make Context explicitly immutable, which it effectively is now.
> 
>      
> 
>     The idea of contexts is we don't need to carry it around on lots of
>     calls. Not sure if we want to go back to where we came from. Also
>     afaicr
>     the context refactoring isn't finished yet.
> 
> I realise that. I think the change is not too hard to make as most key
> objects like Wallet, Chain etc already has either Context or NetworkParams.
> 
> I think unless we discard the use Context.propagate/get, uses of
> different Context in the same process are unsafe.
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bitcoinj+unsubscr...@googlegroups.com
> <mailto:bitcoinj+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to