Exforsys
+ Reply to Thread
Results 1 to 2 of 2

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

This is a discussion on When should i use shared data base in my domain layer? within the Software Patterns forums, part of the Testing category; I wonder if I have two components in my domain layer A and Z, in such a way that A ...

  1. #1
    Julia Guest

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


    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.






  2. #2
    Manco Guest

    Re: When should i use shared data base in my domain layer?

    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.





Latest Article

Network Security Risk Assessment and Measurement

Read More...