Createables are classes that must be created. These classes are usually created inside other classes that require their functionality. Classes have a short life span that are usually equivalent to the life span of the method call they are initialized in. In Delphi, these can be classes like
TQueue<T>, which are part of the standard library.
Injectables are classes that are passed to the constructor of the class that requires their functionality. This allows our program to be loosely coupled, meaning those classes that we inherit from our injectable class can be passed as well.
Moreover, it is preferred for injectable classes to be hidden behind an abstraction, which is usually an interface. Normally, classes written for business logic are classified as injectable classes.
View all Courses