For Programmers: Free Programming Magazines  


Home > Archive > Extreme Programming > February 2005 > When should i use shared data base in my domain layer?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author When should i use shared data base in my domain layer?
Julia

2005-02-20, 8:56 am


I wonder if I have two components in my domain layer

A and Z, in such a way that A can create Z1,Z2,Z3..... and pass them to a
thread

and I also have a data base which hold Z properties

1.Should I load the properties of Z in A and pass them to each Zn component?
2.Should I load them in Zn?
3.Will your answer will be the same in case Z is placed in lowest level of
the domain model
in such a way that many component separate between A and Z?
4.Will you answer be the same in case Zn component are pooled COM+
components?
5.Shoukd i create Y component which is in one higher level from Z componet
to cach Z properties?
(a factory)

Thanks in advance.



Manco

2005-02-20, 8:56 pm

Julia wrote:
> I wonder if I have two components in my domain layer
>
> A and Z, in such a way that A can create Z1,Z2,Z3..... and pass them
> to a thread
>
> and I also have a data base which hold Z properties
>
> 1.Should I load the properties of Z in A and pass them to each Zn
> component?
> 2.Should I load them in Zn?
> 3.Will your answer will be the same in case Z is placed in lowest
> level of the domain model
> in such a way that many component separate between A and Z?
> 4.Will you answer be the same in case Zn component are pooled COM+
> components?
> 5.Shoukd i create Y component which is in one higher level from Z
> componet to cach Z properties?
> (a factory)
>
> Thanks in advance.


Write yourself a cache manager. If your application is running in ASP.NET,
you can delegate to the Cache object to use. If you have a desktop
application, then you have to write a singelton Cache object which is thread
safe. Even in the web-app scenario, your cache manager singleton has to be
thread-safe. Meaning you you should have the calls that access the
underlying Cache object in lock{} sections.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com