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
You can have a non-abstract setImage method in your Account entity bean ,which accepts a byte array, which will inturn create the dependent image entity bean and sets the byte array on the image entity bean.
I hope this helps.
Thanks