Designating Overridable Classes

In the generated API, you can indicate which methods in a domain class can be overridden.

Double-Derived Classes

A double-derived class is a domain class for which the generated API creates two classes. The abstract base class has methods and properties that can be overridden in the derived class, which is also generated.

For example, in the sample Library.dsl, the CirculationBook domain class has the HasDoubleDerived property set to true.

Because this domain class has the HasDoubleDerived property set to true, the generated API for that class contains two classes:

  • CirculationBookBase, which is an abstract base class where all the functionality is provided.

  • CirculationBook, which is an empty partial derived class.

All methods in the CirculationBookBase base class are marked with the override keyword, and all properties are marked with the virtual keyword.

CirculationBook is derived from this abstract CirculationBookBase class. CirculationBook is an empty partial class so that you can override any of the methods in this class or redefine any of the virtual properties that are inherited from CirculationBookBase.

To override any part of the functionality that is defined in the base class, you create a partial class, add the code for the functionality that you want to define, and add the partial class to your Visual Studio project.

See Also

Concepts

Library.Dsl Overview

Other Resources

Domain-Specific Language Tools Glossary