# Classes

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](/version-0.x/reference/core-classes/result.md) class, which represents the result of an operation of any kind, or the [Color](/version-0.x/reference/core-classes/color.md) class, which simply represents a color.

> A more complex example of core classes is the [Item](/version-0.x/reference/core-classes/item.md) class, which provides many useful methods to work with abstractions of objects, or the [Items](/version-0.x/reference/core-classes/items.md) class, which provides methods to work with lists of [Item](/version-0.x/reference/core-classes/item.md) 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](/version-0.x/architecture/lifecycle.md)), 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.

{% hint style="info" %}
**Example**

If you're creating a social networking web application, the code to show the user profile page would go in a **module** you might want to call *ProfilePage*. In the other hand, you might want to have a *User* **class** to hold the information and the logic for that specific user.

In your architecture, the *ProfilePage* module will query the [Database](/version-0.x/reference/core-modules/database.md) module for a specific user, and you'll get a *User* object in return. The *ProfilePage* module will then take care of building and showing the profile page using that *User* object, most probably using the [Patterns](/version-0.x/reference/core-modules/patterns.md) module.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cherrycake.tin.cat/version-0.x/architecture/classes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
