Architecting persistence (and other internal systems). Interfaces, composition, pure inheritance or centralization?
Posted
by
Vandell
on Programmers
See other posts from Programmers
or by Vandell
Published on 2012-12-16T23:04:18Z
Indexed on
2012/12/16
23:19 UTC
Read the original article
Hit count: 211
Suppose that you need to implement persistence, I think that you're generally limited to four options (correct me if I'm wrong, please)
Each persistant class:
- Should implement an interface (IPersistent)
- Contains a 'persist-me' object that is a specialized object (or class) that's made only to be used the class that contains it.
- Inherit from Persistent (a base class)
Or you can create a gigantic class (or package) called Database and make your persistence logic there.
What are the advantages and problems that can come from each of one? In a small (5kloc) and algorithmically (or organisationally) simple app what is probably the best option?
© Programmers or respective owner