Data
Discover what is the data datatype and how to use it
In BuckshotPlusPlus, the data
datatype represents a structured set of information that cannot be directly rendered as visual content. While it shares similarities with the view datatype, its primary purpose is to hold and manage data rather than define visual elements.
How it works
Declaring data
Data objects in BuckshotPlusPlus are declared similarly to views. However, unlike views, they don't have properties related to visual rendering. Instead, they contain properties that define specific pieces of data or information.
For instance, the session object in BuckshotPlusPlus is of type data
. This object contain properties related to a user's session, such as session ID, user preferences, or authentication tokens (coming soon).
Using data
While data objects can't be rendered directly, they can be referenced and used within views or other parts of your application. For example, you might use a data object to store configuration settings and then reference those settings within a view to determine its behavior or appearance.
Use cases
Storing Configuration: Data objects can be used to store configuration settings or other non-visual data that your application needs to reference.
Data Relationships: Data objects can reference other data objects or views, allowing you to establish relationships between different pieces of data.
Important notes
Always ensure that data objects are used for their intended purpose: to store and manage data. Avoid trying to use them as substitutes for views or other visual elements.
Organize and structure your data objects in a way that makes them easy to manage and reference throughout your application.
Last updated
Was this helpful?