Persistent objects

  • Thread starter Thread starter LC
  • Start date Start date
L

LC

Hi,

Anybody have a design pattern to implement persistent objects. I need to
persist my business objects. Something like this code examples:

//to create a new one
Document doc = new Document("my first document", DateTime.Now);
doc.Save();
....
//to open and edit an existing one
Document doc = new Document(DocumentId);
doc.Copies = 25;
doc.Save();
....
//maybe using lazy initialization when reading
Document doc = new Document(DocumentId);
Datetime authorBirthdate = doc.Author.Birthdate;

Thanks,
LC
 
Check the book called "Patterns of Enterprise Application Architecture"
written by Martin Fowler. It is a great book. Another good book is ".NET
Patterns" (can't remember the author).

I personally use a set of patterns. I use a modified version of Mapper
(PEAA- book above) for persisting business objects, an Abstract Factory
(GOF) for creating mappers, and my factory is a Singleton (GOF) as well.

Fitim Skenderi
 
Thanks Fitim.

LC


Fitim Skenderi said:
Check the book called "Patterns of Enterprise Application Architecture"
written by Martin Fowler. It is a great book. Another good book is ".NET
Patterns" (can't remember the author).

I personally use a set of patterns. I use a modified version of Mapper
(PEAA- book above) for persisting business objects, an Abstract Factory
(GOF) for creating mappers, and my factory is a Singleton (GOF) as well.

Fitim Skenderi
 
Back
Top