-
Notifications
You must be signed in to change notification settings - Fork 0
Resolvable and Relational States
Corda's vault could be described as being more akin to a document-oriented database rather than a relational database. Historically it wasn't easy to maintain references between different Corda states, however Corda 4.0 introduced StatePointer, StaticPointer and LinearPointer to help developers model state relationships. This was a really cool addition to the platform, however I eventually began to feel like pointers should be thought of as a design pattern rather than as an implementation detail. I actually blogged about this a while ago here.
The SingularResolvable interface provides an extensible design pattern for building one-to-one state relationships. This interface can be implemented directly, or through the AbstractSingularResolvable class which further enhances this design pattern providing much of the implementation up front, thus reducing overhead for developers.
The PluralResolvable interface provides an extensible design pattern for building one-to-many state relationship. This interface can be implemented directly, or through the AbstractPluralResolvable class which further enhances this design pattern providing much of the implementation up front, thus reducing overhead for developers.