Classes
Classes encapsulate the object-specific structure and logic of entities in Cherrycake and in your application.
Additionally to your own class implementations, Cherrycake provides core classes for entities that are used throughout the engine and that you can use or extend in your application, like the Result class, which represents the result of an operation of any kind, or the Color class, which simply represents a color.
A more complex example of core classes is the Item class, which provides many useful methods to work with abstractions of objects, or the Items class, which provides methods to work with lists of Item objects.
Auto-loading
Classes are automatically loaded whenever they're needed, meaning you don't need to predict which classes you'll be using.
What's the difference between a class and a module?
Modules are intended to pack process-specific functionality, can be triggered with actions (see Lifecycle), can have configuration files and can even depend on other modules. Classes are intended to pack object-specific functionality, cannot be triggered with actions and don't get configuration files.
Last updated
Was this helpful?