Hello Andreas,

Wednesday, July 25, 2001, 1:59:50 PM, you wrote:


AL> Hi again,

AL> I would like to seperate my buisness logic from the data layer. Say I
AL> have an object Person, that has the fields id, firstName and lastName.
AL> The only constructor I provide is one which takes two arguments (id,
AL> firstName and lastName). The person objects will be stored in a certain
AL> Database, but this may change in the future, this is why I use a
AL> factory. The factory takes an id, connects to the DB, retrieves the
AL> data, creates the Person object and returns it. 

AL> This pattern also comes in handy, when you have classes that inherit
AL> from Person. If the DB access would happen in the constructor, one could
AL> only create Person objects, with a factory, you can create an object of
AL> the real type instead.

AL> Anyway, what I want is to get a DataSource without knowing about a
AL> servlet. Is this somehow possible? Is there some static access to the
AL> DataSource Repository?

Take a look to the Castor project -
http://castor.exolab.org

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to