Skip to content

Commit aec3ae3

Browse files
committed
Add database of esug to repository
0 parents  commit aec3ae3

24 files changed

+1093
-0
lines changed

.project

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
'srcDirectory' : 'src'
3+
}

src/.properties

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
#format : #tonel
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Extension { #name : #ArrayedCollection }
2+
3+
{ #category : #'*ESUGApp-Database' }
4+
ArrayedCollection >> deepCopyVisits: visitedParts [
5+
6+
| newObject |
7+
visitedParts at: self ifPresent: [ :it | ^ it ].
8+
newObject := self copy.
9+
visitedParts at: self put: newObject.
10+
newObject doWithIndex:
11+
[ :each :index |
12+
each isActiveRecord ifFalse:
13+
[ newObject
14+
at: index
15+
put: (each deepCopyVisits: visitedParts) ] ].
16+
^ newObject
17+
]
18+
19+
{ #category : #'*ESUGApp-Database' }
20+
ArrayedCollection >> markReferencesVisits: visitedParts [
21+
22+
self class isMeta ifTrue: [ ^ self ].
23+
visitedParts at: self ifPresent: [:it | ^ self ].
24+
visitedParts at: self put: self.
25+
self doWithIndex:
26+
[ :each :index |
27+
each isActiveRecord
28+
ifTrue: [ self at: index put: each asReferenceMarker ]
29+
ifFalse: [ each markReferencesVisits: visitedParts ] ].
30+
^ self
31+
]
32+
33+
{ #category : #'*ESUGApp-Database' }
34+
ArrayedCollection >> resolveReferencesVisits: visitedParts [
35+
36+
self class isMeta ifTrue: [ ^ self ].
37+
visitedParts at: self ifPresent: [ :it | ^ it ].
38+
visitedParts at: self put: self.
39+
self copy doWithIndex:
40+
[ :each :index |
41+
each isMarker
42+
ifTrue: [ self at: index put: each asOriginalObject ]
43+
ifFalse: [ each resolveReferencesVisits: visitedParts ] ].
44+
^ self
45+
]
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Extension { #name : #Boolean }
2+
3+
{ #category : #'*ESUGApp-Database' }
4+
Boolean >> deepCopyVisits: visitedParts [
5+
6+
^ self
7+
]
8+
9+
{ #category : #'*ESUGApp-Database' }
10+
Boolean >> markReferencesVisits: visitedParts [
11+
^ self
12+
]
13+
14+
{ #category : #'*ESUGApp-Database' }
15+
Boolean >> resolveReferencesVisits: visitedParts [
16+
^ self
17+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Extension { #name : #Character }
2+
3+
{ #category : #'*ESUGApp-Database' }
4+
Character >> deepCopyVisits: visitedParts [
5+
6+
^ self
7+
]
8+
9+
{ #category : #'*ESUGApp-Database' }
10+
Character >> markReferencesVisits: visitedParts [
11+
^ self
12+
]
13+
14+
{ #category : #'*ESUGApp-Database' }
15+
Character >> resolveReferencesVisits: visitedParts [
16+
^ self
17+
]
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Extension { #name : #Class }
2+
3+
{ #category : #'*ESUGApp-Database' }
4+
Class >> deepCopyVisits: visitedParts [
5+
6+
ESUGDatabaseCommitError signal: 'An ActiveRecord can not reference a class or another object that references a class.'
7+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Extension { #name : #Dictionary }
2+
3+
{ #category : #'*ESUGApp-Database' }
4+
Dictionary >> resolveReferencesVisits: visitedParts [
5+
6+
super resolveReferencesVisits: visitedParts.
7+
self rehash.
8+
^ self
9+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
"
2+
Abstract class of ESUG
3+
"
4+
Class {
5+
#name : #ESUGAbstractStore,
6+
#superclass : #Object,
7+
#category : #'ESUGApp-Database-Core'
8+
}
9+
10+
{ #category : #actions }
11+
ESUGAbstractStore class >> install [
12+
13+
[ ESUGActiveRecord
14+
setStore: self new;
15+
warmUpAllClasses ] forkAt: Processor userBackgroundPriority named: 'loading new esug store'
16+
]
17+
18+
{ #category : #actions }
19+
ESUGAbstractStore >> abortChanges: anObject [
20+
self subclassResponsibility
21+
]
22+
23+
{ #category : #defaults }
24+
ESUGAbstractStore >> defaultCacheSize [
25+
^ 10000
26+
]
27+
28+
{ #category : #actions }
29+
ESUGAbstractStore >> ensureDown [
30+
]
31+
32+
{ #category : #actions }
33+
ESUGAbstractStore >> ensureForClass: aClass [
34+
35+
self subclassResponsibility
36+
]
37+
38+
{ #category : #'instance creation' }
39+
ESUGAbstractStore >> forClass: aClass [
40+
self subclassResponsibility
41+
]
42+
43+
{ #category : #'delegated queries' }
44+
ESUGAbstractStore >> forClass: aClass at: anId ifAbsent: aHandler [
45+
self subclassResponsibility
46+
]
47+
48+
{ #category : #'delegated queries' }
49+
ESUGAbstractStore >> forClass: aClass detect: aBlock ifFound: aHandler [
50+
self subclassResponsibility
51+
]
52+
53+
{ #category : #'delegated queries' }
54+
ESUGAbstractStore >> forClass: aClass detect: aBlock ifNone: aHandler [
55+
self subclassResponsibility
56+
]
57+
58+
{ #category : #'delegated queries' }
59+
ESUGAbstractStore >> forClass: aClass do: aBlock [
60+
self subclassResponsibility
61+
]
62+
63+
{ #category : #'delegated queries' }
64+
ESUGAbstractStore >> forClass: aClass findAll: aBlock [
65+
self subclassResponsibility
66+
]
67+
68+
{ #category : #actions }
69+
ESUGAbstractStore >> loadClass: aClass atId: anId [
70+
"Given a class and an Id, the store is expected to load a fresh copy of the object
71+
from it's persistent medium'"
72+
self subclassResponsibility
73+
]
74+
75+
{ #category : #actions }
76+
ESUGAbstractStore >> removeObject: anObject [
77+
78+
self subclassResponsibility
79+
]
80+
81+
{ #category : #actions }
82+
ESUGAbstractStore >> storeObject: anObject [
83+
84+
self subclassResponsibility
85+
]
86+
87+
{ #category : #actions }
88+
ESUGAbstractStore >> updateObject: anObject [
89+
self subclassResponsibility
90+
]

0 commit comments

Comments
 (0)