Separate POCO defaults from value-expression evaluation in TableOperations#37
Open
ritchiecarroll wants to merge 1 commit into
Open
Separate POCO defaults from value-expression evaluation in TableOperations#37ritchiecarroll wants to merge 1 commit into
ritchiecarroll wants to merge 1 commit into
Conversation
…ttribute application.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Decouples
TableOperations<T>from theGemstone.Expressionstype registry so the common "just construct and go" case works without any external setup.Previously,
TableOperations<T>.NewRecord()always evaluated attribute-based value expressions (DefaultValueExpressionAttribute/UpdateValueExpressionAttribute) against the type registry. When a model expression referenced an uninitialized dependency (e.g.Settings), simple usage such asnew TableOperations<Device>(connection).NewRecord()would throw — an unknowable hidden dependency for a casual user.Changes
TableOperations<T>is now pure POCO. It honors only the standardSystem.ComponentModel.DefaultValueAttributevia a self-contained compiled applier built withSystem.Linq.Expressions— no type-registry /Settingscoupling. Removed the expression scope, the three expression delegates,InitializeType(), and the staticTypeRegistryproperty.ExpressionTableOperations<T> : TableOperations<T>is the opt-in surface that restores the full value-expression behavior (a strict superset, identical to the prior default). Callers using it own the responsibility of initializing any dependencies their expressions reference.protected virtualseams (CreateRecordInstance,ApplyRecordDefaultValues,ApplyRecordUpdateValues) that the derived type overrides.SecureTableOperations<T>now wrapsExpressionTableOperations<T>to preserve existing behavior.Verification
Gemstone.Databuilds clean (0 errors).TableOperationsDefaultsTest) confirm: baseNewRecord()applies[DefaultValue]but does not evaluate expressions;ExpressionTableOperations<T>.NewRecord()evaluates both.Breaking change
External callers relying on the base
TableOperations<T>to auto-evaluate value expressions must switch toExpressionTableOperations<T>.Related PRs
This is the core library change. Consumer updates:
ExpressionTableOperations<T>in web model controllersExpressionTableOperations<T>in timeseries model operations🤖 Generated with Claude Code