1 Reply Latest reply on Jan 3, 2005 1:11 PM by Hari Velappan

    How to handle 1:1 related beans in facade/value objects

    czernay Newbie

      I created two simple CMP-Beans: Author and Image with a 1:1 relation, thus an author has exactly one image. Additionally I (well, XDoclet) created a ValueObject for the AuthorBean, that also holds a (compose) reference to the Image. This has to be a Set or Collection as far as I understood it.

      I wonder how one would code the facade or the value object to get a "clean" interface to the Author, that completly hides the circumstance that the image is stored elsewere. I just want some clean get/setImage methods using byte[] to directly access the images' data, not collections to iterate over to get the contents.

      Is there any pattern/best-practise to use? Or do I have to hand-code a new ValueObject to use inside my facade to handle all this?

      Thanks for your help,
      Alexander