Share via


How to: Create Assembly Groups using BindingContexts

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

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

  1. Close all workpads except for the Repository Explorer.

  2. 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.

    Shows the BindingContext in "Quadrant".

  3. 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.

    Shows the BindingContexts menu item in "Quadrant".

    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.

    Shows the DinnerNowFolder in "Quadrant".

  4. 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.

    Shows the added assembly in "Quadrant".

  5. 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.

    Shows the BindingContexts tree view in "Quadrant".

  6. 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.

    Shows the unbound assemblies in "Quadrant."

  7. 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.

    Shows adding a second assembly.

  8. 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.

    Shows the bound assemblies in "Quadrant."

    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.

See Also

Tasks

Walkthrough: Using the System_Runtime Domain