hyperledger-archives / aries-framework-go

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.
https://wiki.hyperledger.org/display/ARIES/aries-framework-go
Apache License 2.0
239 stars 160 forks source link

Define clear relationship between framework and context #212

Open rolsonquadras opened 5 years ago

rolsonquadras commented 5 years ago

@troyronda @rolsonquadras I'm not sure what direction to head in this case. Yes - context needs to be available in order to instantiate the protocol services. However, the user does not (currently) have access to a "default" context that they can use to instantiate their own protocol services and pass in to framework.New(). Perhaps we need to expose a defaults.Context() somewhere?

Originally posted by @llorllale in https://github.com/hyperledger/aries-framework-go/pull/201

llorllale commented 5 years ago

@rolsonquadras @troyronda allow me to explain:

What triggered my comment above is that framework.Aries now has two attributes for the same thing - services and protocolSvcCreators:

https://github.com/hyperledger/aries-framework-go/blob/0890946c897d13975d33fe02a87d396675d83b44/pkg/framework/aries/framework.go#L26-L32

Why is this? Just so that Aries.Context() can keep creating new instances of context.Provider without instantiating new services?

llorllale commented 5 years ago

It's not clear to me if instantiating new dispatcher.Services would present a problem. They certainly are not responsible for managing resources (eg. inbound transports, storage), hence perhaps why Aries.Close() doesn't do anything with them?

rolsonquadras commented 4 years ago

https://github.com/hyperledger/aries-framework-go/pull/1103#discussion_r370353265