Skip to content

Commit

Permalink
Rename classes from Gemstone to GemStone
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabacman committed Jan 5, 2024
1 parent eefa026 commit 6be4a73
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Class {
#name : 'GemstoneRepositoryProviderTest',
#name : 'GemStoneRepositoryProviderTest',
#superclass : 'RepositoryBasedTest',
#category : 'Sagan-GemStone-Tests',
#package : 'Sagan-GemStone-Tests'
}

{ #category : 'initialization' }
GemstoneRepositoryProviderTest >> setUpRepositoryWith: aConflictCheckingStrategy [
GemStoneRepositoryProviderTest >> setUpRepositoryWith: aConflictCheckingStrategy [

extraterrestrials := GemstoneRepositoryProvider new
extraterrestrials := GemStoneRepositoryProvider new
createRepositoryStoringObjectsOfType: Extraterrestrial
checkingConflictsAccordingTo: aConflictCheckingStrategy.
ships := GemstoneRepositoryProvider new
ships := GemStoneRepositoryProvider new
createRepositoryStoringObjectsOfType: Spaceship
checkingConflictsAccordingTo: aConflictCheckingStrategy
]

{ #category : 'tests' }
GemstoneRepositoryProviderTest >> testSpaceshipQueryingForPositiveFirepower [
GemStoneRepositoryProviderTest >> testSpaceshipQueryingForPositiveFirepower [

| solvalou solgrado zeodalley |

Expand All @@ -42,7 +42,7 @@ GemstoneRepositoryProviderTest >> testSpaceshipQueryingForPositiveFirepower [
]

{ #category : 'tests' }
GemstoneRepositoryProviderTest >> testSpaceshipQueryingForZeroFirepower [
GemStoneRepositoryProviderTest >> testSpaceshipQueryingForZeroFirepower [

| solvalou solgrado zeodalley |

Expand All @@ -63,7 +63,7 @@ GemstoneRepositoryProviderTest >> testSpaceshipQueryingForZeroFirepower [
]

{ #category : 'utility' }
GemstoneRepositoryProviderTest >> withAllSpaceshipsMatching: aMatchingCriteria do: aOneArgBlock [
GemStoneRepositoryProviderTest >> withAllSpaceshipsMatching: aMatchingCriteria do: aOneArgBlock [

aOneArgBlock value: ( ships findAllMatching: aMatchingCriteria )
]
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"
I'm a Gemstone repository. I will keep the managed objects in an collections optimized for Gemstone indexes, and provide transactional semantics.
I'm a GemStone repository. I will keep the managed objects in an collections optimized for GemStone indexes, and provide transactional semantics.
I require a working Gemstone connection.
I require a working GemStone connection.
"
Class {
#name : 'GemstoneRepository',
#name : 'GemStoneRepository',
#superclass : 'RepositoryBehavior',
#instVars : [
'conflictCheckingStrategy',
Expand All @@ -15,68 +15,68 @@ Class {
}

{ #category : 'instance creation' }
GemstoneRepository class >> checkingConflictsAccordingTo: aConflictCheckingStrategy [
GemStoneRepository class >> checkingConflictsAccordingTo: aConflictCheckingStrategy [

^self new initializeCheckingConflictsAccordingTo: aConflictCheckingStrategy
]

{ #category : 'instance creation' }
GemstoneRepository class >> withoutCheckingConflicts [
GemStoneRepository class >> withoutCheckingConflicts [

^ self checkingConflictsAccordingTo: DoNotCheckForConflictsStrategy new
]

{ #category : 'configuring' }
GemstoneRepository >> configureMappingsIn: aBlock [
GemStoneRepository >> configureMappingsIn: aBlock [


]

{ #category : 'private - accessing' }
GemstoneRepository >> conflictCheckingStrategy [
GemStoneRepository >> conflictCheckingStrategy [

^ conflictCheckingStrategy
]

{ #category : 'querying' }
GemstoneRepository >> countMatching: aCriteriaOrBlockClosure [
GemStoneRepository >> countMatching: aCriteriaOrBlockClosure [

^ contents count: ( self asMatchingCriteria: aCriteriaOrBlockClosure )
]

{ #category : 'querying' }
GemstoneRepository >> findAll [
GemStoneRepository >> findAll [

^ contents copy
]

{ #category : 'querying' }
GemstoneRepository >> findAllMatching: aCriteriaOrBlock [
GemStoneRepository >> findAllMatching: aCriteriaOrBlock [

^ contents select: ( self asMatchingCriteria: aCriteriaOrBlock )
]

{ #category : 'querying' }
GemstoneRepository >> findAllMatching: aCriteriaOrBlock sortedBy: aSortFunction [
GemStoneRepository >> findAllMatching: aCriteriaOrBlock sortedBy: aSortFunction [

^ ( self findAllMatching: aCriteriaOrBlock ) sorted: aSortFunction
]

{ #category : 'initialization' }
GemstoneRepository >> initializeCheckingConflictsAccordingTo: aConflictCheckingStrategy [
GemStoneRepository >> initializeCheckingConflictsAccordingTo: aConflictCheckingStrategy [

conflictCheckingStrategy := aConflictCheckingStrategy.
contents := OrderedCollection new
]

{ #category : 'private - accessing' }
GemstoneRepository >> matchingCriteriaBuilder [
GemStoneRepository >> matchingCriteriaBuilder [

^ GemstoneRepositoryMatchingCriteriaBuilder new
^ GemStoneRepositoryMatchingCriteriaBuilder new
]

{ #category : 'private - management' }
GemstoneRepository >> purgeAfterCheckingInclusion: aDomainObject [
GemStoneRepository >> purgeAfterCheckingInclusion: aDomainObject [

contents remove: aDomainObject ifAbsent: [
DataInconsistencyFound signal:
Expand All @@ -87,32 +87,32 @@ GemstoneRepository >> purgeAfterCheckingInclusion: aDomainObject [
]

{ #category : 'management' }
GemstoneRepository >> purgeAllMatching: aCriteriaOrBlock [
GemStoneRepository >> purgeAllMatching: aCriteriaOrBlock [

contents := contents reject: ( self asMatchingCriteria: aCriteriaOrBlock )
]

{ #category : 'private - management' }
GemstoneRepository >> storeAfterCheckingConflicts: aDomainObject [
GemStoneRepository >> storeAfterCheckingConflicts: aDomainObject [

contents add: aDomainObject.
^ aDomainObject
]

{ #category : 'management' }
GemstoneRepository >> transact: aBlock [
GemStoneRepository >> transact: aBlock [

^ aBlock value
]

{ #category : 'management' }
GemstoneRepository >> update: aMutableDomainObject executing: aBlock [
GemStoneRepository >> update: aMutableDomainObject executing: aBlock [

aBlock value: aMutableDomainObject
]

{ #category : 'private - management' }
GemstoneRepository >> updateAfterCheckingConflicts: aDomainObject with: anUpdatedDomainObject [
GemStoneRepository >> updateAfterCheckingConflicts: aDomainObject with: anUpdatedDomainObject [

self purgeAfterCheckingInclusion: aDomainObject.
[ aDomainObject synchronizeWith: anUpdatedDomainObject ] ensure: [
Expand All @@ -121,7 +121,7 @@ GemstoneRepository >> updateAfterCheckingConflicts: aDomainObject with: anUpdate
]

{ #category : 'querying' }
GemstoneRepository >> withOneMatching: aCriteriaOrBlock do: foundBlock else: noneBlock [
GemStoneRepository >> withOneMatching: aCriteriaOrBlock do: foundBlock else: noneBlock [

^ contents
detect: ( self asMatchingCriteria: aCriteriaOrBlock )
Expand All @@ -130,7 +130,7 @@ GemstoneRepository >> withOneMatching: aCriteriaOrBlock do: foundBlock else: non
]

{ #category : 'querying' }
GemstoneRepository >> withOneMatching: aCriteriaOrBlock sortedBy: aSortFunction do: foundBlock else: noneBlock [
GemStoneRepository >> withOneMatching: aCriteriaOrBlock sortedBy: aSortFunction do: foundBlock else: noneBlock [

^ ( contents sorted: aSortFunction )
detect: ( self asMatchingCriteria: aCriteriaOrBlock )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
"
I'm an implementation for Gemstone Repositories.
I'm an implementation for GemStone Repositories.
I will try to solve everything using plain messages without any DSL.
"
Class {
#name : 'GemstoneRepositoryMatchingCriteriaBuilder',
#name : 'GemStoneRepositoryMatchingCriteriaBuilder',
#superclass : 'RepositoryMatchingCriteriaBuilder',
#category : 'Sagan-GemStone',
#package : 'Sagan-GemStone'
}

{ #category : 'identity operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> does: anObjectInRepository equal: anObject [
GemStoneRepositoryMatchingCriteriaBuilder >> does: anObjectInRepository equal: anObject [

^ anObjectInRepository = anObject
]

{ #category : 'string matching' }
GemstoneRepositoryMatchingCriteriaBuilder >> does: aStringInRepository includeSubstring: aString [
GemStoneRepositoryMatchingCriteriaBuilder >> does: aStringInRepository includeSubstring: aString [

^ aStringInRepository includesSubstring: aString
]

{ #category : 'identity operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> does: objectInRepository notEqual: objectInMemory [
GemStoneRepositoryMatchingCriteriaBuilder >> does: objectInRepository notEqual: objectInMemory [

^ objectInRepository ~= objectInMemory
]

{ #category : 'testing' }
GemstoneRepositoryMatchingCriteriaBuilder >> is: anObject includedIn: aCollection [
GemStoneRepositoryMatchingCriteriaBuilder >> is: anObject includedIn: aCollection [

^ aCollection includes: anObject
]

{ #category : 'testing' }
GemstoneRepositoryMatchingCriteriaBuilder >> isUndefined: anObject otherwiseSatisfy: aBooleanExpression [
GemStoneRepositoryMatchingCriteriaBuilder >> isUndefined: anObject otherwiseSatisfy: aBooleanExpression [
"It is assumed anObject will always be defined when in memory.
By defined we refer to any object except nil."

^ aBooleanExpression
]

{ #category : 'boolean operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> satisfying: aBoolean and: aBlock [
GemStoneRepositoryMatchingCriteriaBuilder >> satisfying: aBoolean and: aBlock [

^ aBoolean and: aBlock
]

{ #category : 'boolean operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> satisfying: aBoolean or: aBlock [
GemStoneRepositoryMatchingCriteriaBuilder >> satisfying: aBoolean or: aBlock [

^ aBoolean or: aBlock
]

{ #category : 'boolean operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> satisfyingAll: aBooleanCollection [
GemStoneRepositoryMatchingCriteriaBuilder >> satisfyingAll: aBooleanCollection [

^ aBooleanCollection allSatisfy: [ :each | each ]
]

{ #category : 'boolean operations' }
GemstoneRepositoryMatchingCriteriaBuilder >> satisfyingAny: aBooleanCollection [
GemStoneRepositoryMatchingCriteriaBuilder >> satisfyingAny: aBooleanCollection [

^ aBooleanCollection anySatisfy: [ :each | each ]
]
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
Class {
#name : 'GemstoneRepositoryProvider',
#name : 'GemStoneRepositoryProvider',
#superclass : 'RepositoryProvider',
#category : 'Sagan-GemStone',
#package : 'Sagan-GemStone'
}

{ #category : 'building' }
GemstoneRepositoryProvider >> createRepositoryStoringObjectsOfType: aBusinessObjectClass
GemStoneRepositoryProvider >> createRepositoryStoringObjectsOfType: aBusinessObjectClass
checkingConflictsAccordingTo: aConflictCheckingStrategy [

^ GemstoneRepository checkingConflictsAccordingTo: aConflictCheckingStrategy
^ GemStoneRepository checkingConflictsAccordingTo: aConflictCheckingStrategy
]

{ #category : 'controlling' }
GemstoneRepositoryProvider >> destroyRepositories [
GemStoneRepositoryProvider >> destroyRepositories [

" In memory all repositories are destroyed once the system is shut down "
]

{ #category : 'controlling' }
GemstoneRepositoryProvider >> prepareForInitialPersistence [
GemStoneRepositoryProvider >> prepareForInitialPersistence [


]

{ #category : 'controlling' }
GemstoneRepositoryProvider >> prepareForShutDown [
GemStoneRepositoryProvider >> prepareForShutDown [


]

{ #category : 'initialization' }
GemstoneRepositoryProvider >> reset [
GemStoneRepositoryProvider >> reset [


]

0 comments on commit 6be4a73

Please sign in to comment.