Skip to content

Auto-instantiate nested singular Data Object properties #81

@thibaultzanini

Description

@thibaultzanini

Following the goal of simplifying Data Object creation, we should also automatically instantiate nested properties that are, themselves, Data Objects.

When a parent Data Object is created, any singular property that is typed as another Data Object should be automatically instantiated. This will prevent common null errors and save developers from having to manually initialize every nested object.

In order to provide full control to developers and possible infinite loops, the DataObjectDescriptor should define the instantiating strategy to adopt for any singular Data Object properties.

Acceptance Criteria:

  • When a new Data Object (e.g., new Order()) is created, its singular Data Object properties (e.g., Order.ShippingAddress) are automatically instantiated and are not null.
  • The DataObjectDescriptor is updated to include a "Loading" attribute for relevant properties.

Goal:

  • Reduce boilerplate code for nested object initialization.
  • Improve developer experience by preventing common null reference errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions