As far as I see it, you would want to expose an API:
- Either via some functions
new_stream_registryandaddstreamas you suggested. - Or, defining your own type
StreamRegistrywith custom methods ongetindexandsetindex!.
In any case, that a Dict is used internally is an implementation detail and should be hidden. The second way might be nicer syntax wise, but I would only use it if StreamRegistry(...) isa AbstractDict in any reasonable sense.