in addition to what chris says (which is good advice btw), keep in mind that
you can achieve a collection like this in more ways than you mentioned
below. as a example, you might have a Company bean that has a method
getContacts() that returns any type of enumeration (as you and Chris outline
below). this is a use-case approach to partitioning the resultset.
findPersonByState doesn't sound like it's addressing a use-case but if it
is, it probably isn't doing it for a UI purpose - if it is... then as long
as you know your resultset is small you're ok in any case.
servicing the getContacts method can be done in any of the ways you
mentioned. some ejb server implementations have very good mechanisms to do
this sort of thing (Valto Ejipt's Set stuff). you can build this
functionality yourself fairly easily. note also that you can use CMP beans
that include some direct JDBC if you want to and it doesn't require a
SessionBean wrapper and you don't need to use BMP to make direct calls.
> -----Original Message-----
> From: Chris Raber [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, June 07, 1999 10:56 AM
> To: [EMAIL PROTECTED]
> Subject: Re: SessionBeans, EntityBeans and Collections?
>
> I suspect find person by state would return quite a few persons! So
> returning an enumeration of these to the client by any means is
> probably not a good idea. Probably better to have a protocol
> that will return a collection of serializable copies of just the bits
> you need to populate your GUI widgets (plus some PK's so you
> can get back the selected lucky person).
>
> -Chris.
>
> > -----Original Message-----
> > From: Rick Gibbs [SMTP:[EMAIL PROTECTED]]
> > Sent: Monday, June 07, 1999 10:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: SessionBeans, EntityBeans and Collections?
> >
> > Howdy,
> >
> > A couple of weeks ago I was watching the thread about wrapping
> entity
> > beans with session beans but I had a couple more questions. I am very
> new
> > to EJB so I 'll try to explain my perdicament as best as I can. Say I
> have
> > a
> > collection of People objects that I need to be abale to sort and query
> by
> > state for an example. I came up with the following modeling scenarios
> but
> > can't seem to decide which path to take.
> >
> > 1 - Use BMP for the PersonBean and implement several finder methods,
> > findPersonById( String id )
> > findPersonById( String id, String sortBy )
> > findPersonByState( String State, String sortBy )
> > This method seems straight forward but requires a lot more coding(JDBC)
> > and
> > wouldn't take advantage of CMP caching
> >
> > 2 - CMP PersonBean with a SessionBean that wraps it. The SessionBean
> > would
> > perform all of the necessary quering and sorting.
> >
> > 3 - CollectionBeans - Have a PersonCollection that was an entity bean
> and
> > perform all of the sorting/quering on the client.
> > This seems like ti would increase the amount of remote method calls.
> >
> > I seem to be missing some fundamental concepts and any suggestions or
> > advice
> > would be appreciated.
> >
> > Thanks
> > Rick
> >
> > _________________________________
> > Rick Gibbs
> > earthcars.com, Inc.
> > [EMAIL PROTECTED]
> > http://earthcars.com
> >
> >
> ==========================================================================
> > =
> > 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".
===========================================================================
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".