+1
"Ritter, Steve" wrote:
>
> Actually George, I think you and Chris both have the right idea.
>
> You are correct in stating that using a SessionBean interface to you appserver is
>best -- the only issue that remains is what datatypes will the SessionBean return?
>
> IMHO, you should avoid the default "pass-by-reference" model supported by EJB and
>rather use a "pass-by-value" model. You really want to avoid returning EntityBean
>references to the Action class, you would rather return "value" classes. Some EJB
>containers support pass-by-value out of the box, others require that you create your
>own value classes by hand (a value class is simply a class that has all the data
>local to the class, calls to the getters are not remote calls). The implementaion of
>the SessionBean ("server side") would be responsible for copying data from the
>EntityBean into the ValueBean.
>
> Just like you SessionBeans are facades providing a specific view into the business
>logic provided by your application server, your value classes are really going to be
>facades (Facade Pattern, Gamma et al). The reason for this is that it is likely that
>what you want to display on your web page is a combination of attributes from several
>EntityBeans. I have found that is easier to model your value objects based on what
>pages they will be used by and only include the data needed to keep them as small as
>possible. This does not mean that a particular ValueBean won't be used by multiple
>pages, its just a loose rule of thumb that I use.
>
> What do you guys all think of this?
>
> --Steve