Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

storing data structures as oposed to a decorator single object as root #534

Answered by hg-ms
guykatz asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
You can store (nearly) any kind of object as root object. Using a custom object instead of a collection as root is always a good option. That object may be composed of several collections, values and references to other objects.
The main benefit is that you can easily add new members to the custom root object class later on.

Edit:
I almost forgot the most obvious point:
With such an custom root object you can structure your data in a more “natural” way. E.g., if you’re working on a shop, you can create a class “MyShop” as root that has Customers, Products, etc.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by guykatz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants