Alexander
Alexander

Reputation: 387

Is any meaning difference between 'Storage' and 'Repository' in the class-naming conventions?

For example, I usually name SessionStorage but ProductRepository... It is something mental I couldn't explain to myself. Does anybody understand the meaning of suffixes Repository and Storage? :)

Upvotes: 3

Views: 4022

Answers (3)

Carlo Wood
Carlo Wood

Reputation: 6811

I think that repository is more something "to rely on". It might keep a history of things or you store it for safekeeping. Its more like a database. While a storage is just memory where you (temporarily) park something without handing over responsibility or any special guarantees other than that you (the thread or class storing it) keep ownership and can retrieve the stored object at a later time.

Upvotes: 0

Ivan
Ivan

Reputation: 1444

In english...

Repository: a place, building, or receptacle where things are or may be stored.

Storage: the action or method of storing something for future use.

Upvotes: 3

jrg
jrg

Reputation: 116

I guess there is no difference in that.

Think about naming for a while and you may figure that it might be important to name things containing equal concepts equally.

So if there's no conceptual difference you should go for either Storage or Repository..

Upvotes: 3

Related Questions