DOM and Database

"j.vieten" <[email protected]>
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
Hello,
I am very new to DDD...
Many examples I have seen so far more or less reconstruct their Domain Object Model (DOM) on every service call. In the following "persistence" could be Hibernate or even just jdbc
So the flow is 
1) service call A 
2) "persistence" goes to DB and constructs the needed DOM 
3) DOM returns result to service A
4) service call B
5) "persistance"  goes to DB and constructs again the needed DOM 
6) DOM returns result to service B
...
But I would much prefer the following: 
1) At the beginning of my application I construct a DOM which can answer all server requests.
2) service call A
3) DOM returns result to service A
4)service call B
5) DOM returns result to service B
....
Since in most of the examples I `ve seen the first approach seems to be mostly used....
Is there something wrong with using
the second approach together with a persistence framework? Or is it just not practical for a enterprise application?



------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.