How to: Create Assembly Groups using BindingContexts
This is the fourth and last step in Walkthrough: Using the System_Runtime Domain. In the preceding step, How to: Query .NET Framework Metadata using "Quadrant", you examined metadata using “M” queries in “Quadrant”. This topic shows how to create groups of assemblies in “Quadrant” that are called binding contexts and are represented by the BindingContexts Extent (System_Runtime Module). Once you’ve created a binding context, you can associate assemblies with that binding context until all dependencies within the binding context are resolved. Developers or administrators can use this approach to ensure that all dependencies are resolved before deployment.
Creating groups of assemblies by using BindingContexts
Close all workpads except for the Repository Explorer.
In the Repository Explorer workpad, expand Database, expand System_Runtime, then double-click the BindingContexts node to open a BindingContexts workpad. Initially there are no binding contexts defined, so you’ll see an empty tree master-detail view.
With the BindingContexts workpad active, right-click the No results text on the left-hand side, select Insert Item, and then click BindingContexts to create a new binding context.
Name the binding context DinnerNowBindingContext and associate the new BindingContext with the DinnerNowFolder folder that you created earlier. Save your work after entering the values. Drag the lower right corner of the workpad to make the workpad larger in order to see more data.
To add assemblies to the newly-created BindingContext, in the Repository Explorer, double-click BindingContextAssemblies, and (with the BindingContextAssemblies workpad active) press CTRL+I to add a new BindingContextAssembly.
Select DinnerNowBindingContext for the Context, DinnerNow.Business for the Assembly, and DinnerNowFolder for the Folder. Save (CTRL+S) when finished.
You can view the results in the BindingContextAssemblies workpad, which is in Table view. To see things a bit better, drag the right-side of the Context column header to the right a bit and all the column sizes expand.
Change the BindingContexts to the Tree master-detail view to see more information and expand the workpad to view more text. Expand and select DinnerNowBindingContext, and the properties of the new binding context are visible in the details pane of the view (on the right), and in the tree view (on the left) the number of bound assemblies in this context.
To see information about the assembly as well as references to other assemblies in DinnerNow.Business, click the DinnerNow.Business assembly node in the tree view.
In the lower right portion of the details pane, note that all these references are unbound. That means that the new DinnerNowBindingContext does not yet include all the assemblies needed to satisfy the dependencies of the DinnerNow.Business assembly.
Now right-click the BindingContextAssemblies group in the BindingContext tree view and add a new BindingContextAssembly to the BindingContext. This time add the DinnerNow.Data assembly.
Press CTRL+S to save the data and then close the workpad.
Look at the BindingContexts tree master-detail workpad again. In the lower right portion of the details pane, the DinnerNow.Data reference is resolved. When an assembly is added to a binding context the assembly types and methods are used automatically to satisfy references in the context.
Tip: It can be hard to see the assembly information in the References detail section above. If you pause the mouse over the Bound to… reference next to DinnerNow.Data, you can see that the reference is bound to DinnerNow.Data.dll, which was added to this binding context. Using the References detail section is very valuable to developers and administrators—especially during deployment—because it shows that a particular group of assemblies do not have any unsatisfied references. Typically a developer would import assemblies to satisfy the remaining dependencies for DinnerNow.Business.dll. As imported assemblies are added to the binding context, references are resolved in the same way as in the DinnerNow.Data.dll example above.