hold 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/hold.rb +2 -4
- data/lib/hold/version.rb +1 -1
- metadata +26 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6eb66a9b993a58327effef42e2503297ab0fdad6
|
4
|
+
data.tar.gz: 205a84af71021efa70c74995dc8ae0c3bd904e25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fb6def62557bfb2ecfd68c0531f9f70a3b4f2ccacb4a0581862c8edf7c1e2cee1279a2a747760b5bda18e3668ff28996debfcd99a3e5ecbb65577b167ffdf7
|
7
|
+
data.tar.gz: c7571b92d84ff5ae33744636e7326e639674b52e550dcebc6e87337d7e704d43c3bf53d794fa64d8cf9ee19fbcff2dddc27ec7b44ecdf96cfbe8620d4aed2242
|
data/README.md
CHANGED
data/lib/hold.rb
CHANGED
@@ -3,12 +3,10 @@ require_relative 'hold/file/hash_repository'
|
|
3
3
|
require_relative 'hold/sequel'
|
4
4
|
|
5
5
|
module Hold; end
|
6
|
-
Persistence = Hold
|
7
6
|
|
8
|
-
module
|
7
|
+
module Persistence
|
9
8
|
def self.const_missing(const_name)
|
10
|
-
super unless const_name == :Persistence
|
11
9
|
warn "'Persistence' has been deprecated, please use 'Hold' instead"
|
12
|
-
Hold
|
10
|
+
Hold.const_get(const_name)
|
13
11
|
end
|
14
12
|
end
|
data/lib/hold/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Willson
|
8
|
+
- Nick Griffiths
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-16 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rake
|
@@ -136,9 +137,27 @@ dependencies:
|
|
136
137
|
- - "~>"
|
137
138
|
- !ruby/object:Gem::Version
|
138
139
|
version: 0.1.4
|
139
|
-
description:
|
140
|
+
description: |2
|
141
|
+
A persistence library based more closely on the repository model.
|
142
|
+
Used in production for several years.
|
143
|
+
|
144
|
+
To summarize, the idea is that
|
145
|
+
|
146
|
+
* You have Repositories which are responsible for persisting objects in a data store
|
147
|
+
* Your data objects know nothing about persistence. They are just 'plain old' in-memory ruby objects can be created and manipulated independently of any particular repository.
|
148
|
+
|
149
|
+
This is a substantially different approach to the widely used ActiveRecord pattern.
|
150
|
+
|
151
|
+
Of course there are various trade-offs involved when choosing between these two approaches. ActiveRecord is a more lightweight approach which is often preferred for small-to-mid-sized database-backed web applications where the data model is tightly coupled to a database schema; whereas Repositories start to show benefits when it comes to, e.g.:
|
152
|
+
|
153
|
+
* Separation of concerns in a larger system; avoiding bloated model classes with too many responsibilities
|
154
|
+
* Ease of switching between alternative back-end data stores, e.g. database-backed vs persisted-in-a-config-file vs persisted in-memory. In particular, this can help avoid database dependencies when testing
|
155
|
+
* Systems which persist objects in multiple data stores -- e.g. in a relational database, serialized in a key-value cache, serialized in config files, ...
|
156
|
+
* Decoupling the structure of your data model from the schema of the data store used to persist it
|
140
157
|
email:
|
141
|
-
-
|
158
|
+
- mark@mediasp.com
|
159
|
+
- tom@mediasp.com
|
160
|
+
- devs@mediasp.com
|
142
161
|
executables: []
|
143
162
|
extensions: []
|
144
163
|
extra_rdoc_files: []
|
@@ -172,8 +191,9 @@ files:
|
|
172
191
|
- lib/hold/serialized.rb
|
173
192
|
- lib/hold/serialized/json_serializer.rb
|
174
193
|
- lib/hold/version.rb
|
175
|
-
homepage:
|
176
|
-
licenses:
|
194
|
+
homepage: https://github.com/mediasp/hold
|
195
|
+
licenses:
|
196
|
+
- MIT
|
177
197
|
metadata: {}
|
178
198
|
post_install_message:
|
179
199
|
rdoc_options: []
|