That is how I would use it as well, but they have in fact eschewed the value
object pattern for something completely different in the latest PetStore.
I'm just trying to figure out if they have some wisdom, or they were just
having a bad dream.

As far as the Facade, check out GoF.

Cheers
Jay

-----Original Message-----
From: Tinou Bao [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 25, 2001 1:18 PM
To: Jay Walters; [EMAIL PROTECTED]
Subject: Re: [EJB-INT] Petstore/Pattern question


To me, the getDetails() methods [value object pattern], is mainly for
performance reasons because you don't want to make all these remote calls.
The one to one mapping between entity bean and model in the demo is not an
absolute rule.  You can have a complex entity bean and have several detail
models exposing different aspect of the entity bean as needed by the
business.  You can use other patterns to avoid the coupling between your
JSP/servlet and your entities.  Also, I don't think the facade pattern is
just to not expose your client to the domain objects.  This is one aspect of
it but it also allows you to control security and transaction, for example.

--
Tinou Bao
www.tinou.com

----- Original Message -----
From: "Jay Walters" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 25, 2001 9:53 AM
Subject: [EJB-INT] Petstore/Pattern question


> I'm just looking at the latest petstore (1.1.2) and seeing that they use
the
> structure of a separate model object within each entity bean to hold the
> persistent attributes.  They provide a method getDetails() which will
return
> this object to a client.  This seems to be the anti-pattern to facade,
build
> a facade and then expose the data structures behind the facade to the
client
> directly.  It directly couples the client to the structure of the
database.
> I know the big argument is that it saves a few lines of code, but it seems
> like a Faustian bargain.  Does this rub anybody else the wrong way?
>
> Cheers
> Jay
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to