Skip to content

Commit

Permalink
Merge pull request #339 from seandenigris/enh_element-initial-answer
Browse files Browse the repository at this point in the history
[Enh]: Element Descriptions - Initial Answer
  • Loading branch information
seandenigris authored Oct 21, 2023
2 parents ae35667 + 23259d2 commit d0eab4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/Magritte-Model/MADescription.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,10 @@ MADescription >> undefined: aString [

{ #category : #'accessing-properties' }
MADescription >> undefinedValue [
self flag: 'could this be simplified with maLazyXyz?'.
^ (self propertyAt: #undefinedValue ifAbsent: [ self class defaultUndefinedValue ])
ifNil: [ self class defaultUndefinedValue ]

^ self
propertyAt: #undefinedValue
ifAbsent: [ self class defaultUndefinedValue ]
]

{ #category : #'accessing-properties' }
Expand Down
10 changes: 10 additions & 0 deletions source/Magritte-Model/MAElementDescription.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ MAElementDescription >> handlesSelector: aSelector [
^ self accessor handlesSelector: aSelector
]

{ #category : #accessing }
MAElementDescription >> initialAnswer [
^ self propertyAt: #initialAnswer ifAbsent: [ self default ]
]

{ #category : #accessing }
MAElementDescription >> initialAnswer: aValuable [
self propertyAt: #initialAnswer put: aValuable
]

{ #category : #'lazy initialization' }
MAElementDescription >> lazilyInitializeFrom: currentValue for: anObject [
"- The default value is cached if the description's #shouldCacheDefault property is true. An example when caching is necessary is for to-many relations because the user may modify the collection, which will then be thrown away if not cached
Expand Down

0 comments on commit d0eab4e

Please sign in to comment.