Summary

Completed

In this module, you learned how to work with interfaces for AL. You can use an interface when you want to decide which capabilities need to be available for an object while allowing actual implementations to differ, assuming that they comply with the defined interface.

This approach allows you to write code that reduces the dependency on implementation details, helps make code reuse easier, and supports a polymorphic way of calling object methods, which you can use for substituting business logic.

You can use the new interface object to declare an interface name along with its methods and then apply the implements keyword along with the interface names on objects that implement the interface methods. You also learned how to use the tinterface snippet to create a new interface object.

Examples in this module described how interfaces are used in Business Central, making it possible for you to extend existing business logic, such as price calculation.