I'm still new to trying to comprehend the various ways the Model layer
can be implemented in a J2EE app, so I want to make sure I'm
understanding a few things in relation to the webPIM sample app at
www.basebeans.com.

1) I was under the impression that you want to have your Data Transfer
Objects (or Value Objects) to be as reusable as possible. It looks
like in the case of the webPIM app that a typical bean (ie NameLstBean
) is tightly coupled with the table columns found in the DAO that the
bean has as a member. The design seems to be: call a populate method
on a particular bean which in turn will return a DAO to the bean that
contains a cached rowset of the columns returned from the query. Then
in order to get back say a First Name the bean will actually get a
handle to the DAO stored in the bean and then call a method like
nameLstDAO.getCRString("first_name"). (Forgive me Vic if I explained
that all wrong ). So my question is under this model it seems like if
the underlying implementation changes, such as the column names in a
table change, you end up having to fix all your beans plus all of your
DAOs (as opposed to only having to change it one place if the DAOs are
used to directly populate the beans). I'm guessing the reason for
calling the db columns in the cached rowset might be so that the bean
doesn't have to be populated in the DAO (although I'm not so sure why
that would be so negative ).

2) If each bean ( ie ListNmBean ) is responsible for populating itself
where do you put SQL to populate a Collection of beans? ( I apologize
Vic if you do this somewhere in the application that I haven't found).
In your architecture it looks like the DAOs are only really called
from within beans themselves, so in order to get a Collection of
ListNmBeans would I need to create a CollectionOfNameBeans object
which would call a DAO that would populate me with ListNmBeans?

3) Using an architecture such as the webPIM app it looks like you
would only need one type of bean to hold your main object's fields.
For example I'd only need an EmployeeBean, and wouldn't need an
EmployeeBean plus a Data Transfer Object EmployeeBean. In the webPIM
app am I correct in assuming objects such as the NameLstBean act as a
Data Transfer Object or Value Object and also acts as what I hear
other's mention as an Entity or Session bean?

4) I take it each bean would contain all different overloaded populate
methods for different ways you would want to return an Employee? For
example "populate( int employeeId )" or "populate( String firstName,
String Last Name )" ?


Thanks for any help with this.



--

Rick

mailto:[EMAIL PROTECTED]

"I wish I had a dollar for every time I spent a dollar, because then,
Yahoo!, I'd have all my money back."
  -Jack Handey


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to