EJB design: ejb with access to same data, distict interfaz, which pattern?

  1. Hi,

      I think there will be a suitable pattern for this...

       I need to expose the same data but in different representations, as XML or as a Collection. What I need is an EJB which gave me the data in the format I need in different points of my web application. But, which would the the pattern for this problem at a design phasse?


          Jose R.
  2. You could create a class that implements Collection and has a method for getting the items in the collection as XML.

    Or you could just write 2 methods on your EJB that give you the data as a collection and as xml.