Allow schema to be extracted from static factory methods #27
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
slendium/ocd#27
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the schema can only be extracted from the constructor parameters. This prevents constructing different subclasses of the entity based on the document contents. More generally it makes it more difficult to use the constructor for passing values that are not related to database storage.
Entities should be able to implement an interface that defines a static factory method and which overrides the default behavior of extracting fields from the constructor.
The method
Schema::fromConstructorParameters()should then also be dropped in favor of a more generally named::fromClass().Allow schema to be extracted from static constructor methodsto Allow schema to be extracted from static factory methods