You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Jim JXR <ji...@yahoo.com> on 2002/12/04 14:48:40 UTC

PB usage pattern questions

Hi, 

I'm working on a webapp using OJB, and have 2
questions on persistence broker usage patterns. 

1. I have read the beer4all example and the Struts
book, and understand why they use an interface to hide
OJB from web application. However, the example only
addresses object retrival, not insert/update/delete. I
wonder what is the general pattern regarding these
i/u/d operations? Should I add a set of methods for
each business objects I interested in (i.e.
insertUser/updateUser/insertItem/deleteItem, etc)? Or
should I just add 3 generic methods for all business
objects (i.e. insert/update/delete)?

2. When using the persistence broker, should I keep
one broker for every operation inside my application
(i.e. a singleton) or should I create one for an
operation and close it immediately after the operation
(i.e. like a database connection)?

3. PBKey: What is the design rational behind this
class? Is it just a simple way to group repository.xml
and user/password?

Thanks

Jim

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com