Questions tagged [persistence]

In computer science, persistence refers to the characteristic of state that outlives the process that created it. From Wikipedia: http://en.wikipedia.org/wiki/Persistence_%28computer_science%29

In computer science, persistence refers to the characteristic of state that outlives the process that created it. Without this capability, state would only exist in RAM, and would be lost when this RAM loses power, such as a computer shutdown.

This is achieved in practice by storing the state as data in non-volatile storage such as a hard drive or flash memory.

Picture editing programs or word processors, for example, achieve state persistence by saving their documents to files.

From Wikipedia: Persistence

131 questions
22
votes
9 answers

In agile development, should I try persistence in flat file before database?

Somebody explained to me that since in agile development, policy and the application logic should be more important than details such as persistence method, persistence decision should be taken at the end. So it might be a good idea to start with…
Louis Rhys
  • 6,042
  • 11
  • 42
  • 59
19
votes
6 answers

INI files or Registry or personal files?

I want to save the configuration of my project which includes Screen size Screen position Folder paths Users settings and so on. The standard places where you can save these are configuration values are: Registry INI files Personal files (like…
Shirish11
  • 1,469
  • 10
  • 22
16
votes
2 answers

Is domain/persistence model isolation usually this awkward?

I'm diving into the concepts to Domain-Driven Design (DDD) and found some principles strange, especially regarding the isolation of domain and persistence model. Here is my basic understanding: A service on the application layer (providing a…
Double M
  • 446
  • 3
  • 8
13
votes
3 answers

Should I use a layer between service and repository for a clean architecture - Spring

I'm working in an architecture, it is going to offer a rest api for web client and mobile apps. I'm using Spring(spring mvc, spring data jpa, ...etc). The domain model is coded with JPA specification. I'm trying to apply some concepts of clean…
Alejandro
  • 139
  • 1
  • 1
  • 5
12
votes
2 answers

Persisting natural language processing parsed data

I've recently started experimenting with natural language processing (NLP) using Stanford's CoreNLP, and I'm wondering what are some of the standard ways to store NLP parsed data for something like a text mining application? One way I thought might…
user25791
12
votes
2 answers

Are Persistence-Ignorant objects able to implement lazy loading?

Persistence Ignorance is an application of single responsibility principle, which in practice means that Domain Objects (DO) shouldn't contain code related to persistence, instead they should only contain domain logic. a) I assume this means that…
12
votes
2 answers

Is Spring + Hibernate prefered instead of EJB 3?

It is my perception that whenever new JEE projects start (where these technologies would be applicable), people prefer to use a combination of Spring + Hibernate instead of EJB 3. It seems junior programmers are even advised to go for that instead…
JohnDoDo
  • 2,309
  • 2
  • 18
  • 32
11
votes
2 answers

Caching factory design

I have a factory class XFactory that creates objects of class X. Instances of X are very large, so the main purpose of the factory is to cache them, as transparently to the client code as possible. Objects of class X are immutable, so the following…
max
  • 1,075
  • 11
  • 19
9
votes
2 answers

What is a Ruby on Rails way to save images?

I develop on iOS, and I'm switching from a PHP backend to Ruby on Rails. The interchange format is JSON. A quick Google search for 'save images in Rails' has nearly every result talking about saving image data as blobs to the database. I might be…
user
  • 263
  • 1
  • 2
  • 10
8
votes
4 answers

How are account balances persisted

I am currently building a finance application that contains "accounts" Each account has a balance that is dynamically generated based on platform charges vs payments. e.g simplified example. $account->balance =…
Daniel Benzie
  • 269
  • 1
  • 5
8
votes
2 answers

Is it ok to have dependencies inside a class that's meant to be exchangable?

Let's say I'm having a domain-model and I want to read and save it from any persistence layer - right now it might be a json file but in the future it could be xml or a database (which might also change in its type). To generate the domain-model…
8
votes
3 answers

Strategy for backwards compatibility of persistent storage

In my experience, trying to ensure that new versions of an application retain compatibility with data storage from previous versions can often be a painful process. What I currently do is to save a version number for each 'unit' of data (be it a…
vaughandroid
  • 7,569
  • 4
  • 27
  • 37
7
votes
1 answer

How to prevent concurrency problems when using the repository pattern?

Considering that: when using the repository pattern you deal with entities - those are the atomic units you persist (regardless of Hibernate or "manually") when changing an entity you save it as a whole (there's no set or increment field) multiple…
7
votes
2 answers

Is there a practical reason not to use a .NET "setting" to store data that is not a setting?

.NET applications developed using Visual Studio have an easy way to store and recover user settings. You can add the default value of a setting in a special class and have read/write access to it at run time through…
George T
  • 295
  • 1
  • 6
7
votes
3 answers

What data type should Gateway return in Repository Pattern to eliminate refactoring when switching persistence mechanisms?

Following this description of the Repository Pattern, we have three main concerns that need their own classes: The "Repository," which takes and returns Domain Models. The "Gateway," which takes data from the Domain Model and returns some sort of…
Greg Burghardt
  • 34,276
  • 8
  • 63
  • 114
1
2 3
8 9